POV-Ray : Newsgroups : povray.general : Light Cones : Re: Light Cones Server Time
6 Aug 2024 16:56:56 EDT (-0400)
  Re: Light Cones  
From: Warp
Date: 30 Mar 2002 08:32:56
Message: <3ca5be88@news.povray.org>
Timothy R. Cook <tim### [at] scifi-fantasycom> wrote:
> Er, if you can test if a point is inside or outside the object, you
> can test if it's exactly on the surface (i.e. point is neither
> inside nor outside the object, or both, it must be coinciding)

  Nope. I'm not talking about theory here, but about how it is implemented
in the POV-Ray source code.
  Functions which tell whether a point is inside a specific primitive or
not (these are necessary for CSG) return just two values: Either the point
is inside or it isn't.

  And as someone else already said, also floating point accuracy doesn't
allow telling whether a point is exactly on a surface, even if we have
a simple surface where this test would be trivial (eg. a sphere).
  For example, suppose that we have a sphere of radius 10 and we want to
test whether the point <10,0,0> is exactly on its surface. We would make
a test like: (sqrt(10^2+0^2+0^2) == 10)
  However, the test (sqrt(100) == 10) will most probably return false due
to floating point inaccuracies (you can test it if you want if you know C
and have a compiler).
  Equality is usually done with an epsilon value (ie.
abs(sqrt(100)-10) < epsilon), but this doesn't tell you whether the
point is exactly on the surface, outside it, or inside it. Using this
kind of test can tell you if the point is extremely close to the surface
but it won't tell you that if it isn't, if it is inside or outside it.


-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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