I exported my blender model, to OBJ and loaded it to Three.js.
- For the wheels the normals seem to be facing inwards.
- For the track, only mesh appears and does not appear to be mapped correctly.
I reimported the OBJ in blender, and it seems to be displaying correctly, so it seems to be a problem in Three.js.
Image in blender showing the normals of the wheels are correct, and the track appears correctly.
Codepen of the Three.js code, and OBJ model is here
var material = new THREE.MeshLambertMaterial({ color: 0xcc8729 });
//Loader for the model
var loader = new THREE.OBJLoader();
var geometry = loader.parse(getObjFileAsString());
geometry.position.set(0, 0, 0);
geometry.castShadow = true;
geometry.receiveShadow = true;
geometry.traverse(child => {
if (child instanceof THREE.Mesh) {
child.material = material;
}
});
scene.add(geometry);
Do I need to remodel the wheels and track? Or is there a way to fix it in Three.js?