I’m trying to load a 3d model from 3dsMax to three.js. Within 3dsMax I added a texture to the object, but I can’t see the texture in the scene
this is what I see in the scene:
This is what I see in 3dsMax:
Here is the relevant code:
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(
35,
window.innerWidth / window.innerHeight,
0.1,
1000
);
camera.position.z = 8;
camera.position.y = 1;
// Specify a canvas which is already created in the HTML.
const canvas = document.getElementById(this.canvasId);
renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
});
renderer.shadowMap.enabled = true
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// Lightning
//ambient light
ambientLight = new THREE.AmbientLight(0xffffff, 0.5);
scene.add(ambientLight);
//Directional Light
directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
directionalLight.castShadow = true;
directionalLight.position.set(-20, 20, 32);
directionalLight.shadow.normalBias = 0.03
scene.add(directionalLight);
// Importing GLTF model
let gltf = new GLTFLoader()
gltf.load("../src/folded_clothes4.glb", (glb) => {
glb.scene.traverse ( (child) => {
if ( child.isMesh )
{
child.castShadow = true;
child.receiveShadow = true;
}
});
let loader = glb.scene;
loader.position.y = -0.17
loader.position.z = 0
loader.position.x = 0
scene.add(loader)
})
Here is the material setting in 3dsMax: