Three.js移动几何体的中心

Rec*_*cur 21 three.js

我已经创建了一个圆柱体,我想通过更改它的边界框将其旋转中心移动到其中一个但是它不起作用.

http://jsfiddle.net/736a7/1/

有一个我一直在努力的例子.

基本上我想要将圆柱体旋转,好像是一把剑被它的手柄摆动.

Rec*_*cur 31

发现感谢一些帮助.

geometry.applyMatrix( new THREE.Matrix4().makeTranslation(x, y, z) );
Run Code Online (Sandbox Code Playgroud)

使用它我将圆柱体的y转换为100点,因此它基本上在它的下端旋转.

  • 您现在可以使用此快捷方式`geometry.translate(x,y,z);`,请参阅http://stackoverflow.com/questions/12835361/three-js-move-custom-geometry-to-origin (6认同)
  • @Tyguy7 - 你需要设置geometry.verticesNeedUpdate = true (2认同)