PDA

View Full Version : "Walking" with gluLookAt()



TidalWave
04-19-2006, 11:22 PM
I am building a 3D engine for a project and am trying to make it possible to walk through my 3D world as follows:

Up and Down arrow: Walk forward / backword
Left and Right arrow look to the left / right

When you press the forward arrow key i want to beable to walk in my line of sight.

I currently am using gluLookAt() to simply move forward and backwords (only in a staight line) I am having trouble implementing the rotation (changing of where im looking) correctly, does anyone have example sorce code or the algorithim for determining a new "look at point" ?

lodder
04-20-2006, 07:28 AM
Nehe has several documents:

Camera class and tutorial (http://nehe.gamedev.net/data/articles/article.asp?article=08)

Loading and moving through a 3D world (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=10)