在带有 GLTF 加载器的 Three.js 中,有没有一种方法可以访问对象以在加载后执行转换
这样做似乎不起作用
gltf.scene.position.set(10,10,10)
Run Code Online (Sandbox Code Playgroud)
代码:
function loadObject(){
var loader = new THREE.GLTFLoader();
loader.load('test.gltf',
function ( gltf ) {
scene.add( gltf.scene );
},
function ( xhr ) {
//console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
function ( error ) {
//console.log( 'An error happened' );
}
);
}
loadObject()
// Translate
gltf.scene.position.set(10,10,10)
Run Code Online (Sandbox Code Playgroud)