POV-Ray : Newsgroups : povray.binaries.programming : CSG algorithms : Re: CSG algorithms Server Time
18 Apr 2024 04:35:05 EDT (-0400)
  Re: CSG algorithms  
From: Peter Popov
Date: 29 Jan 2002 18:14:04
Message: <2iae5u0vkt2eva8jqvno1lpdjjcv2qljv5@4ax.com>
On Tue, 29 Jan 2002 16:04:39 -0600, "majucatur" <maj### [at] yahoocom>
wrote:

>I have a little problem, Someone knows how the CSG works?, mathematically, I
>am interested in the algorithm that determine what object is product of the
>CSG construction and how can I develop a CSG raytracing system. I was
>"reading" the POV sourde files, but with all that modules i got confused.

Simple. Get all ray-shape intersections from all objects in the CSG,
depth-sort them, then get the first one that is contained inside all
objects of the CSG except the one it belongs to. That's your
intersection point with the CSG. The normal at this point is the
normal of the object the intersection belongs to, flipped if
necessary.

For this to work, all objects should have an Inside(Point) method, an
All_Intersections(Ray) method and a Normal_At(Point) method, or the
equivalent functionality in the language you're coding in.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.