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:20:43 EDT (-0400)
  Re: cones.cpp: A typo and a question.  
From: Le Forgeron
Date: 7 Oct 2002 09:00:04
Message: <3DA1855B.1030203@free.fr>
Massimo Valentini wrote:


> 
> This is a snippet from cones.cpp (lines ~ 220-235). In the second 'if'
> I think the second test should be .. && (t2 < Max_Distance). And the
> same typo is at line 291 in the same file.
> 


I seems to agree with you, at least on the t1 vs t2 issue.


> The question concerns the divisions t1 / len  and  t2 /len. I think
> that you should test for the validity of the intersection after the
> division because otherwise you could discard some objects based on
> a 'transformed' distance rather the real one.
> 


I do not see why there is a limitation at Max_Distance,
I would simply remove that part of the test (It looks like an old 
optimisation: if it is enough away, remove it... it's bad, IMHO).


[...]

> An other one could be to avoid the normalization of the
> direction of the ray, it appears to me useless.

It is NOT useless. When CSG operation/object (union & merge, at least) 
will ask its component, it will orders the intersections by depth order 
before answering to the upper level. Thus, putting back the depth from 
object space to global space is mandatory (otherwise, strange things 
will happens).

Same goes when more than a single cone/cylinder get intersected by the 
ray, the engine need to order them correctly, in the global space!


Post a reply to this message

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