Science Forums: Global and local 3D rotation - Science Forums

Jump to content

Welcome to ScienceForums.Net!

Welcome to ScienceForums.Net! We welcome science discussion at all levels — from beginners to researchers, covering topics from biology to computer science, and much more. Registration is fast and free, and allows you to post on the forums, so register now and join the discussions!
  
After you've registered, come in and introduce yourself, or visit the forum index. If you need any help  registering, posting, or if you just have some questions about our site, please feel free to contact us at staff at scienceforums dot net.

  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Create a ScienceForums.Net Blog!
Guest Message © 2012 DevFuse
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Global and local 3D rotation how to exchange between global and local coordinates Rate Topic: -----

#1 whynotme 


Lepton
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.



Posted Image

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

This post has been edited by whynotme: 28 January 2012 - 03:34 PM

0

#2 User is online  Xittenn 


Atom
. . . . edited out, DrRocket's answer(s) is/are much more comprehensible . . . . .

This post has been edited by Xittenn: 29 January 2012 - 12:27 AM

"He is their god! He leads them like a thing made by some other deity than Nature that shapes man better. And they follow him against us brats with no less confidence than boys pursuing summer butterflies, or butchers killing flies." - Cominius; Shakespears Coriolanus
0

#3 DrRocket 


Primate

View Postwhynotme, on 28 January 2012 - 03:24 PM, said:

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.



Posted Image

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.

whynotme said:

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

Thanks


Same idea as above but in reverse order.

You can know the name of a bird in all the languages of the world, but when you're finished, you'll know absolutely nothing whatever about the bird... -- Richard P. Feynman
0

#4 whynotme 


Lepton
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.

This post has been edited by whynotme: 30 January 2012 - 04:34 PM

0

#5 DrRocket 


Primate

View Postwhynotme, on 30 January 2012 - 04:31 PM, said:

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.

You can know the name of a bird in all the languages of the world, but when you're finished, you'll know absolutely nothing whatever about the bird... -- Richard P. Feynman
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users