🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
FPS movement probs
Greets -
I''m working on a camera that will mimic the style of the ''Descent'' series by Interplay.
(360o rotation and movement) To this point, I can move along a single Y plane, but can''t seem to figure out the equation for variable Pitch. I am already storing pitch in cam->Pitch for rotation.
cam->LocX -= sin((cam->Yaw + dangle) * (M_PI180)) * dsize;
cam->LocZ -= cos((cam->Yaw + dangle) * (M_PI180)) * dsize;
I know I can''t just add Y in there with a sin() on the pitch, because that will throw my other values off kilter. Can anyone point me in the right direction and/or give me a good url for other geom stuffs.
Thanks,
sixb0nes
www.xpression.org
Someone just asked me this the other day. Here's the formula.
YPos -= (float)sin(Xrotation*piover180) * speed;
That's for forward. Just change - to + for backwards.
Hope that helps!
~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
Edited by - BlackScar on August 11, 2000 1:53:19 AM
YPos -= (float)sin(Xrotation*piover180) * speed;
That's for forward. Just change - to + for backwards.
Hope that helps!
~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
Edited by - BlackScar on August 11, 2000 1:53:19 AM
Hey,
Adding that line of code will not work as the xz values will
be screwy afterwards (see my first post) .. somehow they need to reflect the change in the Y.
Anyone?
sixb0nes
www.xpression.org
Edited by - sixb0nes on August 11, 2000 10:10:49 AM
Adding that line of code will not work as the xz values will
be screwy afterwards (see my first post) .. somehow they need to reflect the change in the Y.
Anyone?
sixb0nes
www.xpression.org
Edited by - sixb0nes on August 11, 2000 10:10:49 AM
have a look at defender, world builder at
http://members.xoom.com/myBollux. the first is with source code
http://members.xoom.com/myBollux. the first is with source code
uNF!
I'd prefer a link with some trig eqns, or perhaps just a reply on how to do it .. I know it can't be that difficult
Thanks,
sixb0nes
www.xpression.org
Edited by - sixb0nes on August 13, 2000 10:01:10 AM
I'd prefer a link with some trig eqns, or perhaps just a reply on how to do it .. I know it can't be that difficult
Thanks,
sixb0nes
www.xpression.org
Edited by - sixb0nes on August 13, 2000 10:01:10 AM
cam->LocX -= sin((cam->Yaw + dangle) * (M_PI180)) * cos((cam->Pitch + dangle) * (M_PI180)) * dsize;
cam->LocZ -= cos((cam->Yaw + dangle) * (M_PI180)) * cos((cam->Pitch + dangle) * (M_PI180)) * dsize;
cam->LocY -= sin((cam->Pitch + dangle) * (M_PI180)) * dsize;
(I don''t know what dangle is)
GA
cam->LocZ -= cos((cam->Yaw + dangle) * (M_PI180)) * cos((cam->Pitch + dangle) * (M_PI180)) * dsize;
cam->LocY -= sin((cam->Pitch + dangle) * (M_PI180)) * dsize;
(I don''t know what dangle is)
GA
i''m assuming dangle would be delta-angle.. that is, the change in the angle (the equations would make sense that way, at least)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement