POV-Ray : Newsgroups : povray.programming : Request for Comment: AstroPov : Re: Request for Comment: AstroPov Server Time
28 Jul 2024 16:25:52 EDT (-0400)
  Re: Request for Comment: AstroPov  
From: Peter J  Holzer
Date: 30 Apr 2000 14:01:16
Message: <slrn8gosfk.peg.hjp-usenet@teal.h.hjp.at>
On Fri, 28 Apr 2000 14:28:32 -0700, Chris Jeppesen wrote:
>I like to do astronomical (space probes in the solar system) raytracing.
>Unfortunaltely, the current version of Povray can't handle extremely large
>differences in numbers which are generated by this scenario.
>
>I wish there were a program that can simultaneously handle:
>
>1) Large and small. A sphere as large as the sun (10^10m) and one 1mm across
>2) Near and Far. Simultaneously showing an object 1mm away from the camera
>and one 10^12m away.
>3) Small angles. Ideally, can see a 1mm object from 10^12 meters away.
>
>The biggest difference in magnitude I am asking for is 10^15. Since double
>precision numbers have 16 digits of precision, there should be no problem,

You might want to read the thread about "(X <= D) is not equal ((X<D) |
(X=D))" (starting with news:39017a7a@news.povray.org) in povray.general.

There are two problems with achieving this precision:

1) Povray uses an arbitrary EPSILON in checking for equality in a number
    of places. I suspect that its use in at least some places is
    unnecessary and makes the inherent numerical problems of floating
    point arithmetic worse instead of better. However, I haven't looked
    at the code in detail yet, and it has been 10 years that I took that
    "Numerical Data Processing" course, so I might be wrong.

2) In any case, being able to distinguish two numbers isn't enough for
   Povray.  They also have to stay distinct during computation. 

   For example, if you have a sphere at <0, 0, 0> with a radius of 1,
   and a point at <1, 0, 1E-10> it is clear to you that it is
   outside of the sphere. However, if you compute the distance from the
   center, it will will come out as 1.0, because the exact result
   (1+1E-20) is not representable in a double. I am quite sure I could
   also come up with an example where the point lies inside or outside
   the sphere depending on whether you compute the distance by


>but I have tried tweaking the various constants which affect this sort of
>thing to no avail. Tweaking constants is the current limit of my skills in
>Povray source.

If your compiler supports a "long double" type which is distinct from
double, you could try to change the definitions of DBL_FORMAT_STRING and
DBL in frame.h. You may also have to tweak some constants.

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

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