Three.js move geometry's center

Recur picture Recur · Aug 11, 2012 · Viewed 23.6k times · Source

I've created a cylinder and I want to move its center of rotation to one of its ends by changing it's bounding box but its not working.

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

There's an example of what I've been working on.

Basically I want to rotate the cylinder around as if it was a sword being swung by it's handle.

Answer

Recur picture Recur · Aug 12, 2012

Found out thanks to some help.

geometry.applyMatrix( new THREE.Matrix4().makeTranslation(x, y, z) );

using that I translated the cylinder's y by 100 points so it basically rotates on it's lower end.