Sign in to follow this  

3D crosshair problems

This topic is 4400 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

I'm having trouble drawing a crosshair in a directx hook for Halo. It's a set of thirdperson perspective reticles (2 circles) that are a certain amount of units ahead of the player. Basically it acts as an accurate bullet-tracer. But, it goes off the screen when I look directly up or down. I used a method of Field of View ratios with Euler Angles. I have the camera's look vectors, the camera position, and the player's position. I've looked around for a solution, but I've become so lost in all the matrix maths. Could anyone give me an alternate solution for this?

Share this post


Link to post
Share on other sites
Does everything dissapear, or just the crosshairs? It is possible that your up vector is pointing straight up, so when you look straight up/down, DX gets confused and doesn't render anything. Try to restrict the camera so it cannot look quite straight up/down (just a degree or two less).

Share this post


Link to post
Share on other sites
Click here for the math code. I tried using the forum's source tags, but it cut some of it off for some reason.

When I look up or down, it starts going offscreen to the left. Nothing disappears. The horizontal angle displacement goes to 90, which causes it to go offscreen. There's already some variables that I found in the Halo engine that let me restrict mouse movement, but I don't really want to resort to that.

Is there anyway I can convert world coordinates to screen coordinates? I guess that's really what I'm trying to do. I've never done anything with camera matrices, I learned everything I know about camera vectors from hacking halo. Again, I tried reading about matrices, but it's a lot of information for something as simple as converting world coordinates to screen coordinates. I just hope someone can point me in the right direction.

Thank you.

EDIT:
I just found a good tutorial on toymaker. I'll check that out first, it seems to be what I'm looking for.

[Edited by - bitterbanana on November 28, 2005 1:27:08 PM]

Share this post


Link to post
Share on other sites

This topic is 4400 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