Answer the question
In order to leave comments, you need to log in
Why is the 3d model not showing on stage?
Why, when I try to insert a 3d model in obj format into the scene using three js, the model is not shown? Who needs to be corrected?
Here is an example Javascript code that I am trying to insert this 3d model:
var oLoader = new THREE.OBJLoader();
oLoader.load('model/untitled.obj', function(object, materials) {
var material2 = new THREE.MeshLambertMaterial({ color: 0xa65e00 });
object.traverse( function(child) {
if (child instanceof THREE.Mesh) {
// apply custom material
child.material = material2;
// enable casting shadows
child.castShadow = true;
child.receiveShadow = true;
}
});
object.position.x = 0;
object.position.y = 0;
object.position.z = 0;
object.scale.set(1, 1, 1);
lesson6.scene.add(object);
});
Answer the question
In order to leave comments, you need to log in
material.needsUpdate = true
https://threejs.org/docs/#manual/en/introduction/H...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question