3d movement question

Started by
0 comments, last by stanislavk 22 years, 8 months ago
I am a little bit confused about movement in 3d space. Lets say I have an object at position (x,y,z) and I have a movement vector V and lets say I want to think of movement in terms of meters/sec and my vector''s magnitude is in meters/sec. How would I use my positions and my movement vectors, and how would I set up the viewing space(OpenGL) so that my objects move with the specified speeds. I guess what im saying is how would I scale meters into pixels just say that one pixel is one meter? I am wondering how this is done in professional games.
Advertisement
You don''t scale to pixels, the rendering pipeline will eventually do that for you.

If you have a velocity vector V, then the movement for that object for a frame is this:

r1 = r0 + V*t

wher r1 is the new position vector, and r0 is the current position vector, and t is the elapsed time. Make sure the units are all compatible and it''s easy. When you render the object, you use r as it''s translation.

And you change the direction of V (as well as the camera) whenever they turn.

Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement