Jump to content
  • Advertisement
Sign in to follow this  

3D Rotation

This topic is 4978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, does anyone have a link or a document that explains 3D rotation around arbitrary point using a given matrix? I would like to be able to this type of rotation without quaternions if possible. regards, dxp

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Maybe you can if you do something like this:
Say the point is position some were in space by a matrix, or just a position.

Pw = Pl * M

Pw is the point in work space.
Pl is the point is local space.
M is the matrix your are using to take the point in the work

For example Pl could by a hard point in a model, M could be the model world model matrix.

Then if you want to rotate of in general Transform anything locally to that particulate point Say a Camera, a gun, etc
Say the Rotation Matrix is R

Then these are the steps:
-bring the point to the origin by multiplying by the Inverse Matrix
-Apply the Rotation matrix by multiplying by the Rotation Matrix
-Put everything back to where it was by multiplying by the Transform matrix again

in symbols is this
R1 = inv(T) * R * T

R1 is the Rotation matrix you can apply to your object.
The above operation is very common and it is call a similar Transformation.
You can do the In Ogl by just pushing matrices on the stack and it works quite well.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!