using gluLookAt(...) to do first person shooter viewing

Started by
2 comments, last by Anavrin 21 years, 5 months ago
Hi, I just registered, and since the search option for the forums is currently disabled, I wasn''t able to find out if this topic has already been discussed (I''m sure it has). Anyway, I''m trying to use gluLookAt to create first person shooter viewing, but I''m having a lot of trouble figuring out what each parameter should be. Essentially, I would like the key mapping to be like this: w - move forward one step s - move backward one step a - strafe left one step d - strafe right one step z - rotate in place counterclockwise x - rotate in place clockwise I realize you can do this using modeling transformations, but in order to do it with gluLookAt, each parameter needs to be specified with certain trig functions. I can''t, for the life of me, figure them out. So if anyone could please help me by letting me know which trig functions apply and basically how to write the code for this, I''d really appreciate it. Thanks!
Advertisement
If your asking how to do the math to move around using glulookat then go to www.gametutorial.com there is a link on the gamedev''s home page and look in opengl tutorials the tutorials there will help you move in any direction and has timed based movment(so if two people are playing together the faster comp does kill the slower) and 3rd person camer trig. They have all the source you need you could copy and past and that works but its copywrited and you woun''t learn anything
Here you can find fast strafing tutorial : http://members.lycos.co.uk/kamilt/
If you ever go 3rd person mode i recomend quaternions for smooth rotation.

This topic is closed to new replies.

Advertisement