nartc / angular-three

🧊 THREE.js integration for Angular 🧊
https://angular-three.netlify.app/
MIT License
306 stars 26 forks source link

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

Closed alcaponepl closed 2 years ago

alcaponepl commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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