POV-Ray : Newsgroups : povray.general : Color usage and crash Server Time
22 Dec 2024 22:03:57 EST (-0500)
  Color usage and crash (Message 1 to 5 of 5)  
From: kurtz le pirate
Subject: Color usage and crash
Date: 2 Sep 2019 11:25:03
Message: <5d6d344f$1@news.povray.org>
Hi,

Inside a loop, i compute a color with this basic code :
	#declare thisHSL = rgb <360*i/N, 1, 0.40>;
	#declare thisRGB = CHSL2RGB(thisHSL);


Always in the same loop, if i use the color like that :
         pigment {rgb thisRGB }

POVRay say : Parse warning : Suspicious expression after rgb.
And after progress in loop, crash !!!
	
On the other hand, if i use the color like that :	
	pigment {rgb <thisRGB.red, thisRGB.green, thisRGB.blue> }

all is OK !

Where is a problem ?


I use POV-Ray 3.8.0-alpha10013324.unofficial on Mac.


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: Color usage and crash
Date: 2 Sep 2019 11:40:00
Message: <web.5d6d373388fd6f8d4eec112d0@news.povray.org>
I've had to struggle with this many times before.

> Always in the same loop, if i use the color like that :
>          pigment {rgb thisRGB }

Try

pigment {color rgb thisRGB }

or

#local Color = thisRGB;
pigment {Color}


Also, provide the details of "crash" - what happens?   Is there an output?
Error message?


Post a reply to this message

From: Thomas de Groot
Subject: Re: Color usage and crash
Date: 3 Sep 2019 03:22:57
Message: <5d6e14d1$1@news.povray.org>
Op 02/09/2019 om 17:25 schreef kurtz le pirate:
> Hi,
> 
> Inside a loop, i compute a color with this basic code :
>      #declare thisHSL = rgb <360*i/N, 1, 0.40>;
>      #declare thisRGB = CHSL2RGB(thisHSL);
> 
> 
> Always in the same loop, if i use the color like that :
>          pigment {rgb thisRGB }
> 
> POVRay say : Parse warning : Suspicious expression after rgb.

The 'suspicious' expression is that 'rgb' is used twice.
either write:

#declare thisHSL = <rgb*i/N, 1, 0.40>;

without the 'rgb'; or, later in the loop:

pigment {thisRGB}


> And after progress in loop, crash !!!

See Bald Eagle's comment concerning the crash.

> 
> On the other hand, if i use the color like that :
>      pigment {rgb <thisRGB.red, thisRGB.green, thisRGB.blue> }
> 
> all is OK !
> 
> Where is a problem ?
> 
> 
> I use POV-Ray 3.8.0-alpha10013324.unofficial on Mac.
> 
> 


-- 
Thomas


Post a reply to this message

From: Alain
Subject: Re: Color usage and crash
Date: 6 Sep 2019 12:48:30
Message: <5d728dde$1@news.povray.org>
Le 19-09-02 à 11:25, kurtz le pirate a écrit :
> Hi,
> 
> Inside a loop, i compute a color with this basic code :
>      #declare thisHSL = rgb <360*i/N, 1, 0.40>;
>      #declare thisRGB = CHSL2RGB(thisHSL);
> 
> 
> Always in the same loop, if i use the color like that :
>          pigment {rgb thisRGB }
> 
> POVRay say : Parse warning : Suspicious expression after rgb.
> And after progress in loop, crash !!!
> 
> On the other hand, if i use the color like that :
>      pigment {rgb <thisRGB.red, thisRGB.green, thisRGB.blue> }
> 
> all is OK !
> 
> Where is a problem ?
> 
> 
> I use POV-Ray 3.8.0-alpha10013324.unofficial on Mac.
> 
> 
CHSL2RGB() return the result as rgbft<Red, Green, Blue, Filter, Transmit>

thisHSL<R,G,B> get promoted to thisHSL<R,G,B,0,0>

The message come from assigning a 5D vector to a 3D destination : There 
is a mismatch.

So, use : pigment {rgbft thisRGB }


Post a reply to this message

From: kurtz le pirate
Subject: Re: Color usage and crash
Date: 7 Sep 2019 10:33:43
Message: <5d73bfc7$1@news.povray.org>
Thanks to all for your help.

Now, i use :

   #local thisHSL = rgb <360*i/N, 1, 0.40>;
   #local thisRGB = CHSL2RGB(thisHSL);

and
   pigment { color rgb <thisRGB,0,0> }

... and all is OK :)



-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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