Sign in to follow this  
cfoks

Jump function in Directx

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this