Archived

This topic is now archived and is closed to further replies.

Anavrin

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

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites