0

I have rotated a group called pivot following this example:

https://jsfiddle.net/of1vfhzz/1/

And applying the function rotateAroundObjectAxis(object, axis, radians) from this thread:

Rotation around an axis three.js

the function is showed belove

function rotateAroundObjectAxis(object, axis, radians) {
                rotObjectMatrix = new THREE.Matrix4();
                rotObjectMatrix.makeRotationAxis(axis.normalize(), radians);

                object.matrix.multiply(rotObjectMatrix);

                object.rotation.setFromRotationMatrix(object.matrix);
            }`

The meshes inside pivot, rotate in the right way but also the axis orientation change and since I want move these object along the z axis, how can I do? There is a way to set up, after a rotation ,the z axis as before, without changing the rotation of this group of objects?

3
  • Tip: rotateAroundObjectAxis() is outdated and incredibly inefficient. Do not use it. Commented Apr 26, 2019 at 17:36
  • What I could use? Commented Apr 26, 2019 at 17:46
  • 1
    Object3D.rotateOnWorldAxis() or Object3D.rotateOnAxis() or stackoverflow.com/questions/31953608/…. Commented Apr 26, 2019 at 18:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.