POV-Ray : Newsgroups : povray.programming : Torus problems, "biggest/smallest ratio" and magic constants Server Time
28 Jul 2024 10:17:53 EDT (-0400)
  Torus problems, "biggest/smallest ratio" and magic constants (Message 1 to 2 of 2)  
From: Bjorn Jonsson
Subject: Torus problems, "biggest/smallest ratio" and magic constants
Date: 4 May 2001 16:54:29
Message: <MPG.155d2855110b4f9698968b@news.povray.org>
(this may be a slightly unusual subject here - I hope it's not off-topic)

A few days ago I posted a message on povray.general about problems I had 
getting a torus to render properly - the rendering of it (see 
http://www.mmedia.is/~bjj/torus.jpg for instance) looks noisy.

A reply from Micha Riser <mri### [at] gmxnet> pointed out that scaling 
everything down by a factor of 0.01 gets rid of the "noise", e.g.:

#include "colors.inc"

camera  {
   location <-5000,-25000,-40000>
   look_at <300,-1300,-1500>
   angle 1
   scale 0.01  // Omitting this...
}

union {
   light_source {
      <-5000,-16000,-30000>
      color White
   }
   torus  {
      66,33 sturm
      rotate x*90
      translate <-66,116,0>
      rotate z*90 rotate y*180 translate <175.5,-970,-1027>
      pigment {White}
   }
   scale 0.01  // ... and this results in a 'noisy' torus ??
}

I then started experimenting with the scale in my original POV file which 
contains many more primitives than this and found that when using "scale 
0.1" some noise appears but not as much as when not using scale. But 
what's really weird is that if I make scale considerably *bigger* than 1 
(e.g. 1000) some primitives (including the torus, a parabolic 'antenna' 
and more) disappear and also the rendering time increases by a factor of 
more than 10 !??

In povray.general Micha Riser, <mri### [at] gmxnet wrote:
>There are some magic constants in the pov source code which control 
>that; so I could reduce an other such misbehavior (showing up with very 
>small numbers and blobs) by changing one of the constants. Therefore it 
>seems to me that some of these contants are chosen quite arbitrarly. 

So I started messing with the POV source and managed to make a custom 
version of POV. I experimented by changing some magic constants in 
torus.c (e.g. ROOT_TOLERANCE from 1.0e-4 1.0e-10) but this did not affect 
the torus.

Is anyone here familiar with problems like this ? In particular, it looks 
very odd to me that two identical scenes, except for their scale, can 
result in two very different rendering results. After all, the relative 
size of objects has not changed (a simple example: the biggest sphere is 
still 1000 times bigger than the smallest one). So it looks like there 
may be *some* magic constant I should change, an 'epsilon value' or 
something, however, there are lots of these constants, both in the .c and 
.h files. In particular I'm wondering if it might be useful to be able to 
change these values depending on the scale of the model. A difference of 
1.0e-10 between two numbers may be the smallest difference that is 
significant if you have a model where the primitives are of a size on the 
order of 10 but if you multiply the model's size by 1.0e10 then 1.0e-10 
is no longer significant, something like 1.0 would make more sense as an 
'epsilon value'.

Does anyone know which constants I should experiment with changing and in 
which source files ?

-- 
Bjorn Jonsson / bjj### [at] zzzmmediais
Address changed to avoid junk email. Remove yyy and
zzz to reply.


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: Torus problems, "biggest/smallest ratio" and magic constants
Date: 7 May 2001 04:33:16
Message: <3af65dcc@news.povray.org>
Bjorn Jonsson wrote in message ...
> (this may be a slightly unusual subject here - I hope it's not off-topic)

I hope also

> A few days ago I posted a message on povray.general about problems I had
> getting a torus to render properly - the rendering of it (see
> http://www.mmedia.is/~bjj/torus.jpg for instance) looks noisy.
> [ ... cut ... ]
> Is anyone here familiar with problems like this ?

Few weeks ago I posted similiar message to povray news server
You can find it in povray.general
Subject: is this bug or floating point error (noise on torus)
Date: 09-03-2001


yes, me

> Does anyone know which constants I should experiment with changing and in
> which source files ?


I'm also interested with answer

ABX


Post a reply to this message

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