Results 1 to 6 of 6

Thread: Rotation around arbitrary axis

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Sweden
    Posts
    15

    Rotation around arbitrary axis

    For a rotation around an arbitrary axis (x,y,z), how can I calculate the corresponding rotations around the unit vectors (1,0,0) (0,1,0) and (0,0,1)?
    / LC

  2. #2
    Member Contributor
    Join Date
    Feb 2000
    Location
    Breda, Netherlands
    Posts
    57

    Re: Rotation around arbitrary axis

    My guess is that you first glTransform to x,y,z and then glRotate(x_angle, 1, 0, 0), glRotate(y_angle, 0, 1, 0) and guess the z

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Sweden
    Posts
    15

    Re: Rotation around arbitrary axis

    That didn't help much

    The thing is, I know the number of radians to rotate around the (x,y,z) axis, and want to know the corresponding number of radians to rotate around the unit axes.
    / LC

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    Re: Rotation around arbitrary axis

    yep. opengl specifies rotations about an arbitary axis as quaternions. at least... i think this is right. i'm sure i'll be told if i'm wrong.

    theres a paper in siggraph '86? or newer than that? about using quaternions in animation. basically, tho', the story is you CAN convert a quaternion to euler angles, although it would probably involve converting it to a rotation matrix and then extracting the euler angles out of that.

    i can probably go and find it, if you'd like the formulae, and can't find it on the web. it's around here, someplace.

    cheers,
    John

  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Rotation around arbitrary axis

    if you need to have a matrix that rotates about any axis, i'd suggest to use opengl as a matrix library and create the matrix with glRotate()

    instead, if you need a "arbitrary to euler" matrix conversion utility function, take a look here:
    http://www.flipcode.com/documents/matrfaq.html

    Dolo/\/\ightY
    Dolo/\/\ightY

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Sweden
    Posts
    15

    Re: Rotation around arbitrary axis

    Thanks, that page was exactly what I was looking for!
    / LC

Similar Threads

  1. Rotations about arbitrary axis
    By errfet in forum OpenGL: General
    Replies: 2
    Last Post: 10-17-2011, 04:22 AM
  2. glRotatef and rotation around arbitrary axis
    By sizeof in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 10-24-2010, 09:57 AM
  3. Rotation about arbitrary axis (loss of precision?)
    By dogdemir in forum OpenGL: General
    Replies: 6
    Last Post: 02-26-2009, 07:29 PM
  4. Rotation about an arbitrary axis
    By WillieD in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-06-2005, 05:00 PM
  5. Replies: 1
    Last Post: 06-09-2005, 12:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean