POV-Ray : Newsgroups : povray.general : Possible bug: negative sphere radius : Re: Possible bug: negative sphere radius Server Time
5 Aug 2024 12:19:45 EDT (-0400)
  Re: Possible bug: negative sphere radius  
From: Mike Williams
Date: 21 Sep 2002 16:36:12
Message: <QPw$+BAJcNj9EwHH@econym.demon.co.uk>
Wasn't it Slime who wrote:

>Andrew Coppin wrote:
>>
>>Hash: SHA1
>>
>>Apologies if I totally fluff this up - never used a news server
>>before!
>>
>>Take a look at this POVRay scene file:
>>
>>sphere {<5, 5, 5>, -7}
>>
>>Shouldn't that generate an error message? (It doesn't on POVRay 3.5
>>for Windows.)
>
>If it creates a sphere of radius 7, then it's doing what it's supposed to.
>
>It's plugging in the -7 into the equation for a sphere and solving for
>interesections. No mathematical problems occur because of this.
>
>There are a lot of places where you can enter numbers that don't make sense
>(like negative colors for light sources or transparency greater than 1) that
>allow you to create interesting effects.
>
>I think as long as it doesn't cause any calculation issues (like
>vnormalize(0,0,0) did), there's no reason to restrict it.

But "sphere {<5,5,5>,-7}" does have some really weird properties. 
It's "inside" is on the inside (for CSG purposes), but it's
"interior_texture" is on the outside. Usually objects have their
interior_texture and CSG inside on the same side.

It also disappears when bounding is active. The bounding box looks like
it's in the right place when viewed with +UD, but the bounding box is
actually inside out (min_extent is <12,12,12> and max_extent is
<-2,-2,-2>) and the bounding box statistics always show zero successes.

In this particular case, if Andrew doesn't like these effects, then he
has only himself to blame for choosing to use a negative radius, but if
someone wrote "sphere {<5,5,5>, Complicated_Expression}" they may not
immediately realize that the weird effects are due to the complicated
expression evaluating to a negative result, and would probably
appreciate a warning message.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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