Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Red Planet

D3DXVec3Project() does like mirror

This topic is 5279 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! I have a porblem with D3DXVec3Project(). I have successfully transformed a 3D vector to 2D Screen , but if the vector is in the back i got valid transformed x,y coords too. For example: Camera----->| x(object) // vOut(300,300,1) it''s good x(object) Camera----->| // vOut(300,300,1) same coords! If i check the x,y coords to fit my screen H/W, for example 0..800 && 0..600, the first is as i want, but the second figure is giving bad coords, because i don''t want to display (f.e. lensflare) things what is behind camera. Anyone know anything to resolve the problem? Thanx tigger (red_planet@freemail.hu)

Share this post


Link to post
Share on other sites
Advertisement
Thanx!

Do you think the vOject.z and vCamera.z value? It''s not works because camera can anywhere in object space. And the D3DXVec3Project() vOut.z value always 1.

I think i could check Z buffer, but i don''t know how and maybe it''s wrong idea

Share this post


Link to post
Share on other sites
Not sure if this is a good way, but you could create a plane using the camera location and direction, and check if the point''s behind the plane.

Share this post


Link to post
Share on other sites
Hi all!

It works!
I do it wrong, because de .z value changed a little, like 0.0000xy and i checked just the 0.x range.

Very thanx for all replies!


Share this post


Link to post
Share on other sites

  • 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!