#### Archived

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

# "3d Game Engine Design" book-> terrain

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

## Recommended Posts

Hi. I have some problems underestanding the algorithm used by this book to determine the visibility of a terrain block(its Box) in a Frustum volume. I mean the TestIntersectFrustum() function. Please give me any comments on this. If you do not have this book, nevermind. I just want to know the algorithms to determine of a 3D box is inside or outside a ciewing frustum. Thanks a lot.

##### Share on other sites
I have never read the book, but I'll explain the algorithm I use anyway. I assign a bit code to each point on the bounding box according to where it lies in relation to each plane in the frustrum.

e.g:

Near 000001
Far 000010
Left 000100
Right 001000
Top 010000
Bottom 100000

.. ie if it lies on the 'wrong' side of both the Near and Left planes, a point has a bitcode of 000101. A point which lies inside the frustum has a code of 000000.

After calculating the bitcode for each point, I AND it with all the previously calculated points. If, at any time, the result is 0, then the bounding box is visible, if not, then it is invisible.

This algorithm works with any concave object in any concave frustum.

Determining which side of a frustrum plane is a simple dot product operation.

[edited by - Sandman on April 19, 2002 12:15:54 PM]

##### Share on other sites
goto magic-software.com and email Dave Eberly if you are having trouble understanding the algorithm. He should be nice enough to explain it to you - afterall you did go to the trouble of buying his book.

When I queried an algorithm for frustum culling in the bsp section he clarified (and corrected) a few things in it for me.

good luck
Toby

Gobsmacked - by Toby Murray

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 13
• 40
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632963
• Total Posts
3009533
• ### Who's Online (See full list)

There are no registered users currently online

×