[comp.graphics] 3D Hiding and Data Help Needed!!

davidw@csuf3b.CSUFresno.EDU (David Warness) (07/04/90)

I have just finished writing a program that once given end points, it will 
draw lines in 3D space.  Here's my real problem.  I don't know of a fast way 
to determine when walls are hidden or not.  Also, what kind of data structure 
should I use to hold thousands of points that will be in the world.  I am 
interested in having a 3D environment like that in the game COLONY.  Could 
someone please help???!!!

davidw@csufres.csufresno.edu

Also if anyone has any "C" code pertaining to this it would be greatly
   appreciated.

rick@hanauma.stanford.edu (Richard Ottolini) (07/04/90)

In article <1990Jul3.232543.119@csuf3b.CSUFresno.EDU> davidw@csuf3b.UUCP (David Warness) writes:
>I have just finished writing a program that once given end points, it will 
>draw lines in 3D space.  Here's my real problem.  I don't know of a fast way 
>to determine when walls are hidden or not.  

A cheap, but fallible method is called "backface culling".
If the points have been triangulated, compute the normal of the triangles
(vector cross product of two lines connecting the three points),
then erase all faces with negative normals.  This assumes the object is
essentially convex, which is likely in many situations.