Thread: OpenGL rotation

  1. #16
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    To be honest I'm kind of confused right now and something I said earlier might not be correct.

    EDIT:
    I didn't really say anything that was incorrect on the last page, but I might've been a bit ambiguous. I am sorry to say that this is probably all very confusing. Just in general, if you want an object to look like it is rotating around itself, always call glTranslate first, and then call glRotate. However, technically speaking, what it does is it rotates the object first, and then translates it out to the world position, but dont' worry about those details until you get used to doing basic first.

    glTranslate(pos.x,pos.y,pos.z);

    glRotate(angle,axis.x,axis.y,axis.z);

    that will always have the effect of an object rotating around itself
    Last edited by Darkness; 01-31-2005 at 08:15 AM.
    See you in 13

  2. #17
    Hi ay_okay's Avatar
    Join Date
    Dec 2004
    Location
    Here
    Posts
    69
    Thanks darkness, I figured it out
    Code:
    float temp;
    temp = theta * (3.14 / 180);
    side = side + (inc * cos(temp));
    up = up + (inc * sin(temp));
    glTranslate(side, up, 0.0f);
    You've been a lot of help

  3. #18
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    Very nice work. If you can continue to work problems out on your own you *will* be successful with this stuff!

    I was honestly afriad I had confused you (because admittidely some of the stuff I was saying was ambiguous and confusing).

    Keep up the good work.
    See you in 13

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL hue rotation
    By Blink in forum Game Programming
    Replies: 4
    Last Post: 08-14-2007, 03:42 PM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM