Sign in to follow this  

Rotation about an Arbitrary Axis

This topic is 3460 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

I am a newcomer here in the forum, but start with a question that is taking my sleep ... I am making an application to rotate structures. I realized that the best way was to make arbitrary rotation of axes. I studied a bit of linear algebra, Matrix Operations , quaternions ... and other things related. Until I found a code called Arcball, easy to find at google. Well, could implement the code without difficulty, because he considers the object as a ball and the movement of the mouse is calm rotate the object. After testing one realized, however ... He based that the object is centered in the origin of the axes, as if applying a translation can not rotate more correctly the structure ... Someone has some advice to help me? Thank you for your attention

Share this post


Link to post
Share on other sites
Here is a rotation formula.
http://mathworld.wolfram.com/RotationFormula.html

And your problem might be solved by moving the object into 0,0,0 then move it back after rotation.

Share this post


Link to post
Share on other sites
apply the translation

GlTranslatef (axis_x, axis_y, axis_z)

after the rotation:

glMultMatrixf (Matrix);

Matrix is provided by arcball
But as the arcball uses as a reference when the center axis of the matrix do the translation changes ... the right would cause the arcball compute matrix modified by the new rotation ... to make a translation is given a change of use viewport, but for more than an object that's not true ... I wonder if you have any way to use the arcball or I will have to develop a new code with the formula of the rotation?
Thank you for your attention

Share this post


Link to post
Share on other sites

This topic is 3460 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.

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

Sign in to follow this