Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

openGL character paths

Options
  • 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 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