Results 1 to 2 of 2

Thread: rotating around an arbitary axis

  1. #1
    Guest

    rotating around an arbitary axis

    I have an object that I want to rotate first 30 degree around the X axis. I want to then rotate it around the Y axis. But i want to rotate it around the Y axis that is vertical to the camera, not the real Y axis (which rotated when i rotated around the X axis the first time). How do I rotate around the Y axis that I want ?

    Thanks

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: rotating around an arbitary axis

    Would look something like this:

    glPushMatrix();
    glRotatef( 30,1, 0,0); X-rotation
    glRotatef( y_angle , 0, 1, 0); Y-rotation
    glTranslatef( 0, y_axis_offset, 0); Offset Y axis
    draw_object();
    glPopMatrix();

    Originally posted by line:
    I have an object that I want to rotate first 30 degree around the X axis. I want to then rotate it around the Y axis. But i want to rotate it around the Y axis that is vertical to the camera, not the real Y axis (which rotated when i rotated around the X axis the first time). How do I rotate around the Y axis that I want ?

    Thanks


    [This message has been edited by nexusone (edited 06-24-2003).]

Similar Threads

  1. Rotating around a point and Rotating across own axis
    By Mighty in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-10-2004, 10:15 PM
  2. rotating and object without rotating its axis
    By scam in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 12-17-2003, 08:30 AM
  3. Rotating around z-axis
    By glcrazy in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-13-2003, 01:51 AM
  4. rotating at the right axis
    By tbjerman in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-23-2001, 12:12 AM
  5. Rotating the axis?
    By Loopy in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-15-2001, 07:00 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