Jump to content
  • Advertisement
Sign in to follow this  
DeadlyDan

D3DXVec3Project and 'mirrored' like effect

This topic is 3981 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!