gpt4 book ai didi

webgl - 如何在Three.js中克隆object3d?

转载 作者:行者123 更新时间:2023-12-03 22:55:37 24 4
gpt4 key购买 nike

我想克隆一个加载了加载器的模型,我在github上找到了this issue,但是该解决方案不起作用。看来Object3D发生了结构性变化。

如何在Three.js的当前稳定版本中克隆Object3D?

最佳答案

在Three.js的新版本中,您具有方法clone

例如,我使用国际象棋中的皇后,我不得不重复多次:

// queen is a mesh
var newQueen = queen.clone();

// make sure to re position to be able to see the new queen!
newQueen.position.set(100,100,100); // or any other coordinates


它将与任何网格一起使用。

我用three.js r61。

关于webgl - 如何在Three.js中克隆object3d?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11919694/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com