Message-ID: <336D5303.7BBD@compuserve.com> Date: Sun, 04 May 1997 20:24:51 -0700 From: Henry <101517 DOT 100 AT compuserve DOT com> MIME-Version: 1.0 Subject: Re: BSPs and Allegro (kinda off topic?) References: <3368F5B6 DOT 4766 AT cam DOT org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Newsgroups: comp.os.msdos.djgpp Lines: 30 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Tudor wrote: > > Sorry if this message is off topic here, but I don't know where else to > ask. > I'm kinda a newbie to 3d and programming in general. I'm in the process > of developing a BSP tree constructer and drawer. > But I don't know how to implement the clipping. > Bsicaly it goes like this: > I give the BSP constructer a list of faces. It will then make a BSP tree > choosing the planes from the faces I gave him.To make it easier for me > I chose to make it triangulate the resulted faces (initially the faces > have an arbitrary number of vertices). It recurses for the resulting > faces, creating a BSP tree. Now that I have the tree, what do I do?? > I thought of applying the camera matrix to the faces when I traverse the > tree then reject what's not in my sight. Bu when and how do I clip the > faces? Do I do the perspective projection and then clip in 2D or do I > clip all the faces to the viewing frustrum (what's this anyways ?!) > or the viewing cone(pyramid, whatever it is) then do the persp_project > and draw? > Any advice would be appreciated (anything to get me out of the woods). What I think you do is traverse the BSP tree. At each node, test to see if the camera is in front of or behind your line or polygon at that node. Then traverse the _other_ side of the tree, clip your polygon to the view cone, and then project it into view, and then screen space. Sorry if that's a bit confusing. Henry