I need to create program where i moving with WASD keys and look at mouse (this working perfectly, im using for his lookat) and i need to create Robot on scene which can be controled from keyboard, like moving forward and backward and turning right or left. I think i need glRotatef and glTranslatef to do this but i don't know how.
For now i have to global variables: robotMove, robotAngle and when i press 'i' roboteMove ++, when 'k' roboteMove --, when 'j' robotAngle++, and when 'L' robotAngle--.
Code for moving robot is:
Code :glPushMatrix(); glRotatef(deltaKatRobot, 0, 1, 0); glTranslatef(0, 0, deltaRuchRobot); DrawRobot(); glPopMatrix();
This not working corectly, when my robot is in (0,0,0) point he turning corectly but when i move forward or backward he moving at circle. How to solve that?