Path: chuka.playstation.co.uk!news From: Craig Graham Newsgroups: scee.yaroze.programming.3d_graphics Subject: Poly Intersections Date: Tue, 29 Dec 1998 23:34:55 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 40 Message-ID: <3689671E.AA01BBAB@hinge.mistral.co.uk> NNTP-Posting-Host: d1-s56-88-telehouse.mistral.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Anyone got a quick(ish) way of doing polygon intersection calculation? I'm adding constructive geometry to RsdANIM, and althought I've put together some code that does the job, my code to calculate the ray/plane intersection point is dismally slow. Checking that the point on the plane lies within a the poly is a much quicker, but actually getting the intersection between one poly edge and the plane of a 2nd poly is a lot slower than I'd like. For those who've no idea what I'm on about, in order to subdivide a poly where it crosses another poly I have to work out where the two poly's intersect by projecting the edges of one poly to the point where they meet the plane that the 2nd poly lies in. Then I check to see if the point lies within the 2nd poly. If it does, then the first poly must be subdivided at that point. All clear? No, anyway, upshot is it'll allow the following new features in RsdANIM: 1) a smooth join of two objects (like the "Boolean-Union" operation in 3DS Max), 2) undisplayed faces removed from the model. 3) Directional and point source embedded lighting with proper shadow casting (currently there's only point source support, and it doesn't cast shadows). Anyone got a nice quick way of doing the ray plane intersect? (an O(1) algorithm would be good) Laters, Craig.