|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|