Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

How to import an glb object with no gemotery prop in node #145

Closed
alcaponepl opened this issue Aug 16, 2022 · 2 comments
Closed

How to import an glb object with no gemotery prop in node #145

alcaponepl opened this issue Aug 16, 2022 · 2 comments

Comments

@alcaponepl
Copy link

Hi,

I am trying to import glb file and add the imported object to scene but I do not know hot to achieve this because the object that I have imported does not have any geometry property
<ng-container *ngIf="character$ | async as character"> <ngt-mesh receiveShadow castShadow [ref]="boxRef.ref" [position]="position" [rotation]="rotation" [material]="character.materials['VanguardBodyMat']" [geometry]="$any(character.nodes['Scene']).geometry"> </ngt-mesh> </ng-container>
Do you know how to import this object
image
https://cdn.jsdelivr.net/gh/tamani-coding/threejs-character-controls-example@6a5ea138d6ea45455ef18cf5502df8289cd42137/src/models/Soldier.glb

@alcaponepl
Copy link
Author

It works with primitives but the question is how set a castShadow & receiveShadow
<ng-container *ngIf="model"> <ngt-primitive receiveShadow castShadow [object]="model.scene" (beforeRender)="onBeforeRender($event)"></ngt-primitive> </ng-container>

@alcaponepl
Copy link
Author

characterModel.traverse(function (object: any) { if (object.isMesh) object.castShadow = true; });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant