|
|
v3.5 question.
The docs say that eval_pigment() evaluates the color of a pigment. Am
I wrong in treating this as a vector? If not, what am I doing here
that annoys vlength() or sqrt(vdot(,)) in 3.5? It worked fine in
MegaPov 0.7.
I'm using WinPOV-Ray 3.5b12, Win98SE, Celeron 500 and 160MB.
Alf
--8<---------8<---------
#include "functions.inc" // Remove this line in MegaPov
#declare Map9 = pigment{ image_map{ png "test"} }
#declare Pig9 = eval_pigment( pigment{ Map9 }, <0.5, 0.5, 0>);
//#declare Pig9 = <0.5, 0.6, 0.7>; // This line is OK
// Next line is OK and also using Pig9.green
#debug concat( "\n .y = ", str( Pig9.y, 0, 3),"\n" )
// Next is OK in MegaPov 0.7 but not in Pov 3.5
#debug concat( " vlength = ",str( vlength( Pig9 ), 0, 3),"\n" )
sphere{0,0 pigment{ rgb 0 } } // Kills "no objects ..."
/*
Pov 3.5 Error message, cursor stops on "9":
#debug concat( " vlength = ",str( vlength( Pig9 ) <----ERROR
Parse Error: Vector expected but color expression found.
*/
Post a reply to this message
|
|
|
|
On Mon, 11 Mar 2002 23:42:13 -0000, "Alf Peake" <alf### [at] peake42freeservecouk>
wrote:
> The docs say that eval_pigment() evaluates the color of a pigment. Am
> I wrong in treating this as a vector?
Yes. Look into documentation to compare number of components inside vector and
inside color.
But You can convert rgb color value to xyz vector with simple macro:
#macro RGB2XYZ(Color)
<Color.red,Color.green,Color.blue>
#end
ABX
Post a reply to this message
|
|
|
|
Wasn't it Alf Peake who wrote:
>v3.5 question.
>
>The docs say that eval_pigment() evaluates the color of a pigment. Am
>I wrong in treating this as a vector? If not, what am I doing here
>that annoys vlength() or sqrt(vdot(,)) in 3.5? It worked fine in
>MegaPov 0.7.
In 3.5, colours are 5d vectors (red, blue, green, filter, transmit), but
vlength only works with 3d vectors.
You can either convert your colour to a 3d vector
vlength(<Pig9.x,Pig9.y,Pig9.z>)
or use VLength5D from "math.inc"
VLength5D(Pig9)
If filter and transmit both happen to be zero, the two methods give the
same value.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|