# Object Visibility

This topic is 2075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all,

This is probably the oldest question in the book, so forgive me-- it seems the google keywords I'm trying to look it up with have become polluted, and I keep getting answers to unrelated questions.

I'm trying to determine if a 3D object is visible so that I don't push it into the draw pipe if it's not.  For my purposes, it's sufficient to do this by the bounding cube of the object-- the objects are mostly square and have a tight bounding cube computed.

Given a premultiplied view/world/perspective matrix and viewport, what's the fastest and best way to determine if a cube is visible or not?  I've tried the following:

1. If closest point on the cube to camera is visible, draw (works in about 99% of cases)

2. Any closest point on any side of the cube to camera is visible, draw (again, about 99%)

3. If any line of the cube is visible, draw (seems to work even worse, though I thought this was going to be solution)

Fiddling with it, it occurred to me there's probably a very simple way of doing it that I'm missing by trying these kludgy solutions.  Can anyone enlighten me?

##### Share on other sites

Hello

This is called frustum culling (you'll find a lot of articles via these keywords) : you compute the frustum that represents the visible area of your world according to your point of view (camera), and then you check collisions/penetrations between it and the bounding volumes of your entities.

Then, in order to accelerate the process (and do not check individually all the bounding volumes), space partitioning is needed, like octrees

Edited by Tournicoti

##### Share on other sites

Ah thank you... I was googling "view volume" and "intersection," heh...

• 12
• 18
• 29
• 11
• 24