Jump to content
  • Advertisement
Sign in to follow this  
DeadlyDan

D3DXVec3Project and 'mirrored' like effect

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

Hi guys, i'm using D3DXVec3Project to translate world to screen coordinates for placing text at places in the 3d world. It all works fine except for one problem. When my camera faces away from the position vector i'm giving D3DXVec3Project, it weirdly seems to show the inverse effect to what D3DXVec3Project should do if i was turned back around. I've done some research on this, and from what i understand; i have to check to see if the target coordinates are already visible on the screen. I understand that maybe Dot Products should be used? Any help is greatly appreciated thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hi
You can use the dot product between the cameras direction vector (the direction the camera is facing) and the vector from the camera position to the position in 3D the text is placed on.
If the dot porduct is negative, the camera is facing away from the text position and the text should not be rendered.

Share this post


Link to post
Share on other sites
Hi, Thanks for the reply, there are a few things i'm not sure on..


How can i calculate the direction vector of the camera based on a YAW PITCH ROLL angle vector?

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!