Can anyone explain why the .obj file is not displaying directional light similar to the box?
Both have identical materials.
You can find the code on GitHub: https://github.com/triple-verge/triple-verge-website/blob/master/src/js/modules/logo-3d.js#L52
Here's a snippet of the code:
logo.addLogo = function () {
loader.load('img/logo.obj', function (obj) {
var material = new THREE.MeshLambertMaterial({
color: 0xff0000
}),
cube; // Test
_logo.obj = obj;
obj.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.geometry.applyMatrix(
new THREE.Matrix4().makeTranslation(-0.5, 0, 0)
);
child.material = material;
// Test
cube = new THREE.Mesh(
new THREE.BoxGeometry(0.5, 0.5, 0.5),
material
);
$(_logo.container).on('frame', function () {
child.position.set(0, Math.sin(Date.now() / 750) * 0.1, 0);
child.rotation.set(
Math.PI * 0.5,
0,
Math.sin(Date.now() / 500) * 0.8
);
cube.rotation.set(
Math.PI * 0.5,
0,
Math.sin(Date.now() / 500) * 0.8
);
});
}
});
_logo.scene.add(obj);
_logo.scene.add(cube); // Test
});
};
Appreciate any help with this issue!
Using three.js version r.70