Jump function in Directx

Started by
0 comments, last by jollyjeffers 17 years, 11 months ago
Can anyone help me for jumping the camera like in real FPS games for example quake3.I wrote something but I could not see anything because everything being very fast.if you have a sample source code It will be very helpfull.Thanks for your care.
Advertisement
Cross-post of sorts...

There is no "jump" function built into DirectX/Direct3D... You have to calculate the new 3D position using the methods that people explained in your other thread.

Typically people will use the D3DXMATRIXLookAtLH() function to compute the view matrix. It is here that you want to make your changes if you want the view/camera to change accordingly.

I'd imagine that adding the "up" vector multiplied by the jump amount (how high your person is currently jumping) to both the "look at" and "eye" positions.

If your "up" vector is always <0,1,0> (common) you could simplify it by just adding the jump amount to the 'y' coordinate, but my aforementioned method should be a bit more robust if you later change stuff around [smile]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement