Sign in to follow this  

fps shooting problem

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm currently writing a FPS from scratch and I'm having some problems with shooting from the camera's point of view. Right now I shoot a sphere from the camera's location and I set the sphere's member variable matrix (a matrix class I wrote) to the same yaw and pitch as the camera. The results that I get are in the same direction but when I move the camera around to look in diffrent directions, it seems as though the sphere is being generated a couple of world units away. It looks as though sometimes someone else standing next to me is firing, but when I face another direction it seems as thought I'm doing the shooting? Anyone have a simular problem? thanks in advance, JDev

Share this post


Link to post
Share on other sites
How big are your world units? It sounds like a problem with order of operations or perhaps where you're doing your translation. Can't say much more than that without more info though.

Share this post


Link to post
Share on other sites
The game level (aka world units) are a 100x100 grid (gl quad flat ground) and it appears to be about 1-2 units away. If you could imagine a circle with me on one side and on the other side a rotating point where the sphere's are being generated. When I look around (no translation), it appears as if the sphere is moving in around that circle that I'm also standing on. Basically it looks right when I'm facing one way and when I move around it goes from looking like I'm shooting left handed, to behind me, to looking like I'm right handed, to shooting straight forward. I don't know of an easier way to explain it, I wish I could figure it out. The pitch and the yaw are always correct, because when I shoot it's always the right direction, however it is almost never starting from the place that I want it to. My code just has it start at whereever the camera happens to be (in first person viewing mode).
If anybody can help me that would be great!
thanks,
JDev

Share this post


Link to post
Share on other sites
I'd certainly like to be able to help! But I'm at a bit of a loss. It sounds like something specific to how you're representing your camera/player, how you're getting your translation info, etc. Maybe someone else can tell you what's wrong. If not though I'd recommend trying one more time with some more info. What API are you using? Are you getting your camera info from the API matrix? Can you post the code where you create and position the projectile? And so on.

Share this post


Link to post
Share on other sites

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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