#### Archived

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

# Line of Sight

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

## Recommended Posts

Assume this very basic diagram represents one of the 3d levels in a game like the original Wolfenstein from a top-down view. The x's and y's represent the walls and the numbers represent where the player is standing.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
y                2                   x
y           x                        x
y           x                        x
y           x                        x
y    3      x                        x
y           x                        x
y           x                        x
y           x  1                     x
yyyyyyyyyyyyxxxxxxxxxxxxxxxxxxxxxxxxxx

If the player is standing at position 1, there isn't any reason to draw any of the y walls. At position 3, many of the x walls do not need to be drawn. At position 2, most of the walls would need to be drawn. Of course, it changes depending on which direction the player is facing. Using Direct3d, how do you determine which walls (or trees, objects, etc.) within a level are within the players line of sight? Would you draw all of the x's and y's and let Direct3d determine which ones are visible based on the z-buffer? Seems inefficient. [edited by - creed1 on November 11, 2003 11:52:45 AM]

##### Share on other sites
Hey,
I''m pretty sure thats accomplished by a BSP, however, your example is far over simplified because you''re not include a significant number of objects in your example nor any complex architectural geometry. Once your levels begin to get more complex, the benefits of a BSP usually decrease and it becomes mor advantageous to use something like an Octree or ABT to do rougher culling and let the video card deal with a few extra polygons and save your CPU time for other things like physics.

tj963

##### Share on other sites
creed1 you just discovered what all this talking about culling is about.

Try seraching some stuff about Octree and fustrum (or is it frustrum?) culling.

[edited by - Coincoin on November 11, 2003 6:50:47 PM]

1. 1
Rutin
28
2. 2
3. 3
4. 4
5. 5

• 13
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009410
• ### Who's Online (See full list)

There are no registered users currently online

×