3d game movement

3d game movement

Post by bob » Thu, 21 Mar 2002 12:08:58



Pretty simple question here. What is the best/easiest way to move your
camera like in other 3d games.
for example: gluLookAt? or use the model_view somehow?
I would like the mouse to look in a certain direction, and arrow keys to
move. pretty much like Rouge Spear/ halfLife/quake
 
 
 

3d game movement

Post by Timo K Suorant » Sat, 23 Mar 2002 03:47:52



> Pretty simple question here. What is the best/easiest way to move your
> camera like in other 3d games.

Depends on how you want to move the camera. There are several options:
Orbiting, world axis oriented, local (camera) coordinate system oriented
etc. In todays games 'first person shooters' are quite common. First
person means local coordinate system oriented.

Quote:> for example: gluLookAt? or use the model_view somehow?

gluLookAt() is good and simple for some cases but not all. A general
all-purpose solution is to have transformation matrix which is
maintained by the application, and sent to OpenGl through glLoadMatrix()
or glMultMatrix().

Quote:> I would like the mouse to look in a certain direction, and arrow keys to
> move. pretty much like Rouge Spear/ halfLife/quake

In such case it is useful to have separate attitude and position for
camera. These can be maintained in general 4x4 matrix, or in quaternion
for attitude and vector for position. Then you can do things like:

        attitude.rotateZ( roll_delta    );
        attitude.rotateY( heading_delta );
        attitude.rotateX( pitch_delta   );
        position += attitude.getViewAxis () * foward_speed;
        position += attitude.getRightAxis() * strafe_left_right_speed;
        position += attitude.getUpAxis   () * move_up_down_speed;

Then you must maintain attitude quaternion and position vector for each
camera, and make quaternion to (rotation) matrix and vector to
(translation) matrix conversions and combine these to get the matrix
which you can use as camera matrix. Finally you must combine the camera
matrix with each objects matrix when drawing the scene.



 
 
 

1. 3D Game in VB with Character Movement/Scripts?

Hi All,

I'm currently writing my own 3D game engine in Visual Basic 6 (mainly as a
learning exercise), so the speed isn't great, but I don't care at this
stage.
My game engine can render 200-500 flat-shaded polygons with depth sorting,
back-face cull and lighting at between 8 fps and 50fps depending on scene
complexity.  (Rendering a simple cube is somewhere around 300 fps)

Anyway, I'm starting to think about complex movement of characters in my 3D
game, and wondering the best way to program this.

I would like a human character (of simple design, but with functional
elbows, knees, head movement, etc.)  to walk around, and maybe fire his
weapon at me.

Should I program "hierarchical transformations" into my game engine, and
just transform this one 3D model using scripts, or pre-create 30-50 3D model
files outside of my game, then import them as different time-slices of human
movement.  Hopefully, you see what I mean.

Thoughts anyone?

- Peter

2. stereograms

3. GAMES GAMES GAMES GAMES GAMES GAMES GAMES GAMES GAMES

4. need key for character animation

5. animation 3D character movement with imported 3D files

6. HP DeskJet Halftone Algorithm

7. numeric movement and pivot movement?

8. ||||| TRADE |||||

9. Capturing Mouse Movement Before Pointer Movement

10. GAMES GAMES GAMES GAMES

11. Can 3D Game Studio make isometric games?

12. Attention 3D Game Programmers: Virtual Reality Game needed for Arcade

13. 3d movement