Tunan Posted February 14, 2017 Share Posted February 14, 2017 Hello everyone,I've search for two days for ways to clone a gltf object but no one works. I've trired deep clone the object, but no thing works. It seems like the object only be added once to the glTF render list when it be loaded. The clone body can't be render in screen. Here is the result of scene.add(obj.clone()); `var gltfLoader = new THREE.GLTFLoader(); gltfLoader.load('assets/model/gltf/tree/tree.gltf', function ( data ) { var gltf = data; var gltfobj = gltf.scene !== undefined ? gltf.scene : gltf.scenes[ 0 ]; gltfobj.position.z += 5; gltfobj.name = "tree"; scene.add(gltfobj); var tree2 = gltfobj.clone(); tree2.position.x+=1; scene.add( tree2 ); }); ` The cloned object only show shadow in the scene. I've test the colladaLoader and the daeobject is working well, so now I don't know what is going wrong.So,what should I do to clone it in three js scene? If anybody can help me?Thanks! Quote Link to comment Share on other sites More sharing options...
donmccurdy Posted February 14, 2017 Share Posted February 14, 2017 This is a known bug with THREE.GLTFLoader: https://github.com/mrdoob/three.js/issues/8869 If you could add a comment to the GitHub issue there, giving these same details and including your model if possible, that would help us to debug this. Thanks! Tunan 1 Quote Link to comment Share on other sites More sharing options...
Tunan Posted February 15, 2017 Author Share Posted February 15, 2017 Well, It seems like this problem is still no solution.I'm testing the other format to see if they can replace the .gltf in actual use. Thank you! @donmccurdy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.