Skip to content Skip to sidebar Skip to footer

Imported 3D Objects Are Not Casting Shadows With Three.js

I'm currently wrapping my brain around three.js and I've imported 3d model I made in C4D via the three.OBJMTLLoader successfully, but I can't get the object to cast a shadow. I've

Solution 1:

Your object has child meshes, each of which needs to have castShadow set to true.

In your loader callback, add this:

object.traverse( function( node ) { if ( node instanceof THREE.Mesh ) { node.castShadow = true; } } );

three.js r.66


Post a Comment for "Imported 3D Objects Are Not Casting Shadows With Three.js"