POV-Ray : Newsgroups : povray.programming : cones.cpp: A typo and a question. : Re: cones.cpp: A typo and a question. Server Time
28 Jul 2024 06:10:45 EDT (-0400)
  Re: cones.cpp: A typo and a question.  
From: Massimo Valentini
Date: 8 Oct 2002 13:00:15
Message: <3da30f1f@news.povray.org>
"Le Forgeron" ha scritto 
: Massimo Valentini wrote:
: 
: > This condition is different whether you scale the direction 
: > or not. May be there could be a way to avoid the square root (e.g.
: > expressing this condition if (a > EPSILON*len^2)) but it'd require
: > some work analyzing the code for both cones and cylinders. 
: > 
: 
: 
: The (a > EPSILON) is used to avoid numerical error (division by 0 and 
: alike, division by very small value gives a great inaccuracy)
: 

This is what I thought at first. But this condition has a geometrical 
meaning too. In fact 'a' is the square of the sin of the angle formed 
by the ray and the cylindrical axis, when calculated with ||D|| (length
of D, the norm) == 1, while when D isn't normalized it is the sin of the 
same angle multiplied by the square of len . 

Obviously, if the ray is (close to be) parallel to the axis, the solution 
is either impossible or indeterminate, the ray does not intersect the 
cylindrical surface or it lies entirely on it.

Given the fact that I'm not aware of the range of variability of len 
after transformation, it appears now a little more complex to evaluate
whether the removal of the normalization has an impact only on some 
border case (tiny cylinders in kilometers wide panoramas) or it's 
influencing some real and well looking scene.

I was thinking to suggest a simple fix to a border case strangeness 
with no impact on the great majority of the scenes, but now it appears 
that a little more testing is necessary for evaluating both the 
performance and the rendering impact. 

Massimo


Post a reply to this message

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