POV-Ray : Newsgroups : povray.general : Floating point precision : Floating point precision Server Time
2 Aug 2024 02:21:55 EDT (-0400)
  Floating point precision  
From: Tim Nikias
Date: 3 Feb 2005 13:09:03
Message: <420268bf$1@news.povray.org>
I've got a question in regard to the floating point precision. I've got a
saved amount positions and mesh2 objects, and I place these mesh2-objects
onto the positions. The length of these mesh2-objects was originally deriven
by the position itself. So I *do* unterstand that floating point precision
could lead to results in which the length of the mesh2-object differs
slightly. As I'm picking between set lengths, this difference can be quite
obvious when comparing two images, but doesn't matter that much as it won't
be used in animations (at least it's not designed for it, and this precision
problem actually makes it impossible, at least if I want to combine both
steps, generation and placement).

Anyways, what's interesting though is that the mesh2-objects get colored
according to a function which derives a color from the bozo-pattern using
the position. The colors are slightly different too! So either the objects
don't get placed at the exact same location, or at least the function comes
up with a slightly different result, even though the same pattern and
position is used.

So, my question is, can this be due to different calculations applied in
either scene? Where the first render generates all the data, the second does
less work and just includes the objects that have been written to disk.
Placing and selection is done with the same routines, which make use of lots
of dividing and such, so the precision could add up in such areas, but then
again, both use the same selection routines, they're not different.

It's slightly confusing as I don't see a reason for this to happen. It's
like POV-Ray is switching back and forth between a very low-value switch of
rounding up or done or such.

The scene (and macros) itself are far too big to post here, but I was
wondering if anyone could give some insight. Is it possible for a
calculation to differ slighty when other calculations have come before? The
technical side in me says "No, not possible" and I'm thinking that maybe the
calculations I'm doing add the precision problems to a degree where it gets
noticable when some parts are left out. I'll investigate, but any replies
appreciated!

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

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