Members - Reputation: 122
Posted 20 October 2001 - 04:30 PM
Members - Reputation: 142
Posted 21 October 2001 - 01:08 PM
You can use gluLookAt to achieve the same effects.
Also, if you want the player to move foward relative to his rotation, you need to use some simple trig. In case you didn''t already know, that''s the following:
x += sin(angle) * speed;
y += cos(angle) * speed;
(you may need to switch the sine and cosine depending on how your coordinates are set up)
Also, remember that glRotate takes angles in degree measure, while sine and cosine take angles in radian measure, so you''ll need to convert between the two. Remember the following:
1 degree = PI/180 radians
A trick to compute PI quickly, easily, and painlessly, is the following:
PI = atan(1) * 4
That should be all you need to know, unless you want to use gluLookAt, in which case I can''t help you since I''ve never even looked at the prototype for that function. I''ve just overheard what it''s supposed to do!