Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

openGL character paths

  • 13-01-2004 12:58PM
    #1
    Closed Accounts Posts: 59 ✭✭


    Hi all

    I have a dinosaur character in an open GL scene - and I want to give him a trajectory or path to run around in , it doesn't matter if it is a circle or a line or whatever.
    Anyway I have translated him from the origin and want him to rotate around the y axis so I have used
    void Dino()
    {
    glPushMatrix();
    glTranslatef( 2.5, 0.0, 0.0);
    glRotatef(theta, 0.0, 1.0, 0.0);
    drawDino();
    glPopMatrix();
    }
    I am incrementing theta in mt idle function;
    void idle(void)
    {
    theta+= 0.375;
    if(theta >=360.0)
    {
    theta -= 360.0;
    }

    glutPostRedisplay();
    }
    but he is only rotating once and then stopping.
    Any idea where I am going wrong?
    Or better still does anyone know where I can get a tutorial to show me how to do this??
    I've tried NeHe but I can't find a suitable tutorial.
    Ta,
    Fi**


Comments

  • Registered Users, Registered Users 2 Posts: 1,481 ✭✭✭satchmo


    Hmm that seems fine to me, it must be something in the rest of your code? I know it's a silly question, but have you initialised theta to 0?
    Nate Robins has some great tutors that'll give you an idea of how the transformation calls affect the scene.


Advertisement