Jump to content
  • Advertisement
Sign in to follow this  
quang

how to determine which object in view port which is not

This topic is 4306 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 wonder is there any function to determine which object in viewport in DX, please help....

Share this post


Link to post
Share on other sites
Advertisement
If you have few objects in your scene, you can turn off shading, and assign each object a different color. Then render to a off-screen buffer (texture, etc). Look at the pixel under your mouse, and then map that color to an object.

Share this post


Link to post
Share on other sites
There aren't any features of Direct3D that directly aid this sort of algorithm. The D3DX maths functions can simplify things a lot - D3DXVec3Project() can be used to determine if a point in 3D space is visible within the viewport for example. The D3DX plane functions can also be useful for standard frustum culling.

I'm moving this over to GP&T - they might be able to recommend some useful links or guidance as culling is a more general graphics algorithm and theres relatively little that is specific to Direct3D.

hth
Jack

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!