three.js - THREE.js 什么是从搅拌机导出的 gltf 添加照明的最佳方法
问题描述
我想找到将搅拌机场景中的灯光添加到 THREE.js 项目中的最佳方法。我在任何地方都找不到关于如何将照明从搅拌机导入到 THREE.js 的解释。你应该已经在你的 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 );
}
);
}
解决方案
推荐阅读
- groovy - Groovy 脚本在获取 22k 行时挂起
- sql - sql中的累计和
- html - 为什么 HR 标签不是 Internet Explorer 和 Microsoft Edge 浏览器的中间屏幕
- mysql - 这个 SQL 命令的语法有什么问题
- java - 更新:从 Java 执行 SQL 查询的问题
- python - 对 Pandas 数据框的多个查询结果
- mysql - 如何计算有多少工人休假 - mysql
- dynamics-crm - CRM 2016 快速查找视图未找到活动记录
- r - keras::fit() 错误中的 class_weight 参数。类存在于数据中,但不存在于 class_weight
- python - IOError:[Errno 2] 没有这样的文件或目录:'requirements.txt'(没有名为 c 的模块)