POV-Ray : Newsgroups : povray.general : Torus/Camera Angle Bug??? Server Time
29 Oct 2024 23:54:19 EDT (-0400)
  Torus/Camera Angle Bug??? (Message 1 to 4 of 4)  
From: Eric Freeman
Subject: Torus/Camera Angle Bug???
Date: 21 May 2000 11:58:59
Message: <392807c3@news.povray.org>
Hey all,

Here's the code which causes the problem with the torus.  It seems that if
the camera is too far from a torus, the torus falls apart.  This problem
appears in official POV (3.1g.watcom.win32, Pentium 133, Windoz 98).

++++++++++++++++++++++++++++++

//       Version: POV 3.1 official
//   Description: possible bug when viewing a torus from a distance
//        Author: Eric L. Freeman
//        E-Mail: eri### [at] datasynccom
//      HomePage: www.datasync.com/~ericfree

file://#version unofficial MegaPov 0.5;

#declare CamNum = 1;  // 1 = close-up camera, no problem
                      // 2 = distant camera, torus problem

global_settings {max_trace_level 167}
#declare ThingPig = rgb <0,0,1>;
background {rgb <0.556,0.419,0.137>}
light_source {
  <100,200,-300> rgb <1,1,1>
}
camera {
  #switch (CamNum)
  #case (1)
    location <0,0,-100>
    look_at <0,0,0>
    angle 10
  #break
  #case (2)
    location <0,0,-10000>
    look_at <0,0,0>
    angle 0.1
  #break
  #end
}
cylinder {
  <-0.8,0,0>,
  <0.8,0,0>
  2
  pigment {ThingPig}
  rotate y*-45
}
sphere {
  <-5,0,0>, 2
  pigment {ThingPig}
}
torus {
  1.3, 0.7
  sturm
  pigment {ThingPig}
  rotate z*90
  rotate y*-45
  translate <5,0,0>
}

++++++++++++++++++++++++++++++

Eric
--------------------
http://www.datasync.com/~ericfree
--------------------
"I don't like it, and I'm sorry I ever had anything to do with it."
- Erwin Schrodinger talking about Quantum Mechanics.


Post a reply to this message

From: Warp
Subject: Re: Torus/Camera Angle Bug???
Date: 22 May 2000 03:57:42
Message: <3928e876@news.povray.org>
Eric Freeman <eri### [at] datasynccom> wrote:
: It seems that if
: the camera is too far from a torus, the torus falls apart.

  You should know that floating point numbers are not infinitely accurate.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Alexander Enzmann
Subject: Re: Torus/Camera Angle Bug???
Date: 22 May 2000 15:27:19
Message: <39298B43.F480FB23@mitre.org>
Eric Freeman wrote:
> 
> Hey all,
> 
> Here's the code which causes the problem with the torus.
> ...
> camera {
> ...
>     location <0,0,-10000>
> ...
> torus {
>   1.3, 0.7
> ...


Size of distance from eye to torus ~ 10000.  After substitution into
fourth order equation, yields values ~1.0e16.  Solve for values of order
~0.01 (for a 1.3 rad torus filling 100 pixels).  Requires more than 18
digits of precision.

Double precision on standard Intel chips is ~15 decimal digits.

Result: lots of speckles in torus.

Fix: Intersect ray with bounding box of torus before solving quartic. 
Move start point of ray to point of intersection.  Speckles go away.

Workaround for current POV-Ray?  Don't know, perhaps intersect torus
with a box that is a little bigger than it to force ray origin to be
closer.

Xander


Post a reply to this message

From: Ron Parker
Subject: Re: Torus/Camera Angle Bug???
Date: 23 May 2000 22:10:52
Message: <slrn8imf7o.359.ron.parker@linux.parkerr.fwi.com>
On Mon, 22 May 2000 15:32:19 -0400, Alexander Enzmann wrote:
>Workaround for current POV-Ray?  Don't know, perhaps intersect torus
>with a box that is a little bigger than it to force ray origin to be
>closer.

I'd put it inside a 100% transparent box that's a little bigger, which
will cause POV to cast a new (transmitted) ray from the intersection 
point with the box.  I'm guessing that the CSG intersection solution 
won't work, but I haven't tried either.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
These are my opinions.  I do NOT speak for the POV-Team.


Post a reply to this message

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