POV-Ray : Newsgroups : povray.general : CH2RGB somehow causes infinite loop : Re: CH2RGB somehow causes infinite loop Server Time
29 Jul 2024 08:19:07 EDT (-0400)
  Re: CH2RGB somehow causes infinite loop  
From: Le Forgeron
Date: 21 May 2012 02:59:32
Message: <4fb9e7d4$1@news.povray.org>
Le 21/05/2012 04:22, Cousin Ricky a écrit :

> Without the CH2RGB call, the loop completes normally.  I cannot figure out
> what's going wrong.  (A similar, but more complicated scene ran fine with
> CHSL2RGB.)
> 
> The scene files were run with POV-Ray 3.6.1 and 3.7RC5 respectively, under
> openSUSE Linux 12.1.
> 
> 


CH2RGB starts like:
#macro CH2RGB (H)
   #local H = mod(H, 360);
   #local H = (H < 0 ? H+360 : H);
   #switch (H)

Guess that the H used both as a local and an argument of the macro was
not a so smart idea: it ends up modifiying the original argument.

It should have been something like

#macro CH2RGB (H_not_modified)
   #local H = mod(H_not_modified, 360);
   #local H = (H < 0 ? H+360 : H);
   #switch (H)

Just my 0.02€, tax not included.


-- 
Software is like dirt - it costs time and money to change it and move it
around.

Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.


Post a reply to this message

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