PDA

View Full Version : Movement



12-08-2001, 12:31 PM
Sorry if I'm redoing an old topic here, but
I couldn't find the answer to my problem. I
have the feeling it's a very easy question
I am asking, so here goes. I've been experi-
menting with gluLookAt to create movement
through a 3d world. I couldn't come up with
a way to create movement where I can move
forward in whatever way that I am facing.
(Like most fps use today and flight sims.)
I've been thinking about using combinations
of glTranslate*() and glRotate*() but I
have a feeling that there is a much easier
answer to my question. Thanks in advance.

dorbie
12-09-2001, 06:44 AM
How about viewpoint += speed * normalize(target - viewpoint)

normalize being a function which normalizes a vector.

Lookat is horrendous for motion model though. Throw it away and go with your own viewing transformations, especially with a first person motion model.

Look at:
http://www.dorbie.com/aqua.html

I describe one way of making a simple motion model, you'll need a matrix math library though.