0
votes

I tried absolutely everything, and it's second day that I can't move an child mesh around it's center.

https://github.com/mrdoob/three.js/issues/1219 - This doesn't work for me.

I think I can't create correctly the position matrix between the child and the parent center points.

I'd like to set the object central point, in the place the object is on the scene, and rotate by any axis with it staying in it's place.

Any help is most welcome...I'm getting frustrated by that ;/

1

1 Answers

0
votes

If you want change position, you have to set property position.

If you want rotate child object, you have to pick axis and degrees. Object will rotate around it's center (point [0,0,0])

obj.rotateOnAxis(new THREE.Vector3(0,0,1), 90*Math.PI/180); 
// rotate 90 degrees around Z axis

But if you want rotate child object and ensure, that specific child vertex will stay at same place, it's not that easy. I do it this way - prepare child object and place its center (0,0,0) vertex in point, where you want "do" rotation. If you changes child object this way, you can translate it and then rotate it around axis you want. And it's center point will stay at same place during rotation.