Jump to content
  • Advertisement
Sign in to follow this  

The game character is seen or not?

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

How do I know whether a point(or a game character) in 3d is seen by the player? I tried to do the inverse of :
        // Compute the vector of the pick ray in screen space
        D3DXVECTOR3 v;
        v.x =  ( ( ( 2.0f * ptCursor.x ) / SCREEN_WIDTH  ) - 1 ) / matProj._11;
        v.y = -( ( ( 2.0f * ptCursor.y ) / SCREEN_HEIGHT ) - 1 ) / matProj._22;
        v.z =  1.0f;

but the result is the 5 digit coordinate.

Share this post


Link to post
Share on other sites
Advertisement
Hi there TheQuixotiC,
How are you doing?
I think what you are referring to is the method called frustum culling. It's where you extract the view frustum from the View/Projection matrix. The view frustum looks like a pyramid with it's point sliced off.

You then use an algorithm against the view frustum and the object to see if the player can "see" the object.

For a kick start I have found you a link to a tutorial on view frustum culling.

View Frustum Culling

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!