THREE JS TextureLoader

前端 未结 3 506
遥遥无期
遥遥无期 2020-12-17 07:09

I am trying to add texture to a model that I converted to json and imported from 3ds Max. I searched but didn\'t find any code online which applies texture to json models us

3条回答
  •  有刺的猬
    2020-12-17 07:29

    May be the other answer worked on the older version, this is how I got it working

    var textureLoader = new THREE.TextureLoader();
    textureLoader.load(url);
    
    // Add the event listener
    textureLoader.addEventListener('load', function(event){
    
        // The actual texture is returned in the event.content
        sphere.material.map = event.content;
    
    });
    

提交回复
热议问题