Jump to content

Global and local 3D rotation


whynotme

Recommended Posts

Hi,

 

I want to covert between global and local coordinates when rotating 3D object because some program only allow to rotate by global or local coordinate.

 

 

 

coordinate.png

 

Example in this image, if I rotate Y by global coordinate (black coordinate) then the red object will rotate around black y axis. But I want to rotate it around y' axis, the local axis of the object. How can I rotate object around local axis using global rotation?

 

And how can I rotate around global axis using local axis?

 

Thanks

Edited by whynotme
Link to comment
Share on other sites

Hi,

 

I want to covert between global and local coordinates when rotating 3D object because some program only allow to rotate by global or local coordinate.

 

 

 

coordinate.png

 

Example in this image, if I rotate Y by global coordinate (black coordinate) then the red object will rotate around black y axis. But I want to rotate it around y' axis, the local axis of the object. How can I rotate object around local axis using global rotation?

 

First apply a rotation transformation to rotate your black coordinates to the red coordinates. Then perform your desired rotation around the red coordinates -- this is just the composition of two transformations and hence can be viewed as a single transformation with respect to the black coordinates.

 

And how can I rotate around global axis using local axis?

 

Thanks

 

Same idea as above but in reverse order.

Link to comment
Share on other sites

Thanks, but I still don't fully understand

 

I am not good at maths, especially at 3D transform. I am working with Flash, it is a 3D environment but has only 3 rotation tools: around fixed x, y, and z axes.

Now I have a cube at a random position and inclined at random angle. And I want to rotate the cube around its edge, but I only have rotation around global x, y, z axes, how can I rotate the cube around its edge - a random axis?

 

And there is another problem, I don't know why and how to solve:

When I apply the rotation, ie rotationX(30) then rotationY(50), rotationZ(70) - the angle is just for example.

Then I reverse the rotation, rotationX(-30), rotationY(-50), rotationZ(-70), the angles are exactly like the previous step, just negative, but the cube didn't come back to the beginning, it stopped at a random position. What is this problem and how to solve it?

 

Regards.

Edited by whynotme
Link to comment
Share on other sites

Thanks, but I still don't fully understand

 

I am not good at maths, especially at 3D transform. I am working with Flash, it is a 3D environment but has only 3 rotation tools: around fixed x, y, and z axes.

Now I have a cube at a random position and inclined at random angle. And I want to rotate the cube around its edge, but I only have rotation around global x, y, z axes, how can I rotate the cube around its edge - a random axis?

 

And there is another problem, I don't know why and how to solve:

When I apply the rotation, ie rotationX(30) then rotationY(50), rotationZ(70) - the angle is just for example.

Then I reverse the rotation, rotationX(-30), rotationY(-50), rotationZ(-70), the angles are exactly like the previous step, just negative, but the cube didn't come back to the beginning, it stopped at a random position. What is this problem and how to solve it?

 

Regards.

 

Rotation is not commutative. To get back where you started you need to apply the inverse rotations in the reverse order.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.