Results 1 to 3 of 3

Thread: matrix rotations

  1. #1
    Junior Member Newbie
    Join Date
    May 2005

    matrix rotations

    Hello all...
    How would I go about using a matrix rotation in openGL?
    For example, the rotation around the x axis:
    [1 0 0 0
    0 cosA -sinA 0
    0 sinA cosA 0
    0 0 0 1]

    Thank you...

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2005
    San Francisco, CA

    Re: matrix rotations

    Check out the glRotate function call in the OpenGL Redbook


  3. #3
    Senior Member Frequent Contributor ehsan2004's Avatar
    Join Date
    Jun 2004

    Re: matrix rotations

    This matrix help you to understand the meaning of the rotation around an axis. OpenGL multiplies such matrices to the current modelview matrix--You don't need to do this.
    To rotate around the x axis, use from the following function:
    glRotatef( angle, 1,0,0 );
    and to rotate around the y axis:
    glRotatef( angle, 0,1,0 );
    and finally to rotate around the z axis:
    glRotatef( angle, 0,0,1 );
    to rotate around the vector (nx,ny,nz )use from the following function call:
    glRotatef( angle, nx,ny,nz );


Similar Threads

  1. Matrix Rotations
    By bcthund in forum OpenGL: General
    Replies: 5
    Last Post: 02-01-2011, 12:12 PM
  2. Replies: 1
    Last Post: 06-09-2005, 12:39 PM
  3. Matrix trans & rotations
    By Bobo.Bobo in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-23-2004, 11:07 AM
  4. Rotations from matrix?
    By Micke in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-29-2001, 02:11 AM
  5. Matrix Math and 3D rotations
    By JamesD in forum OpenGL: Advanced Coding
    Replies: 13
    Last Post: 04-11-2001, 03:33 AM

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