如何解决THREE.js什么是从Blender导出的gltf添加照明的最佳方法
我想找到一种将混合器场景中的灯光添加到THREE.js项目中的最佳方法。我找不到任何地方如何将照明从搅拌机导入THREE.js的解释。您应该已经在THREE.js项目中有了照明。在处理大型场景时,效率不是很高。
使用gltf格式从Blender Import导入的THREE.js输出
这是我的进口声明
initGLTFLoader(){
this.gltfLoader = new THREE.GLTFLoader();
}
loadCTF(){
// Load a glTF resource
this.gltfLoader.load(
// resource URL
'ctf.gltf',// called when the resource is loaded
function ( gltf ) {
// this console.log indicates that the light are actually in the import,// but dont get added to the scene
console.log(gltf);
this.scene.add( gltf.scene );
}.bind(this),// called while loading is progressing
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},// called when loading has errors
function ( error ) {
console.log( 'An error happened',error );
}
);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。