Jump to content
  • Advertisement
Sign in to follow this  
John Stuart

How to know if the object is behind a wall/tree?

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

Advertisement
Quote:
Does raycasting suited on this?
Sure :)

The details of course will depend on various factors, such as whether the simulation is 2-d or 3-d, what spatial partitioning scheme (if any) is being used, etc.

(I assume that when you say 'behind a wall/tree', you mean relative to a specific viewing position.)

Share this post


Link to post
Share on other sites
Well, I tried using raycast but my problem is that the ray should cast only a straight line perpendicular to the camera (plane) because if it did cast a ray that is not perpendicular to the camera, it hits some objects that should not.

Is there any formula on how to get? I'm using 3d by the way.

Share this post


Link to post
Share on other sites
either cast a ray from the eye position to the center of the object or do occlusion queries.

http://www.gamedev.net/reference/programming/features/occlusionculling/

This is direct x 9 but maybe it'll still give you an idea, I've seen similar technique in opengl too (GPU gems book 1 (availible online on nvidias' website))

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!