Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!uunet!cbmvax!chrisg From: chrisg@cbmvax.commodore.com (Chris Green) Newsgroups: comp.graphics Subject: Re: Triangle/Box intersections Message-ID: <21439@cbmvax.commodore.com> Date: 9 May 91 13:03:15 GMT References: <1991May9.144308.8054@cc.curtin.edu.au> Reply-To: chrisg@cbmvax.commodore.com (Chris Green) Organization: Commodore, West Chester, PA Lines: 26 In article <1991May9.144308.8054@cc.curtin.edu.au> tkessells01@cc.curtin.edu.au writes: > >What is needed is a fast triangle/box test. I don't need to know the >intersections, only whether they hit each other. > How about coding the vertex points of the triangle with respect to the box? Generate a 6 bit bit vector for each point. If ANDing all three of these together produces a non-zero result, then there is no intersection. If ORing them all together produces zero, then the thriangle is contained within the box. Otherwise, you'll have to do more tests (the bit vectors can be helpful here as well). The bits are generated by code like if (vertex.x