|
|
On Sat, 16 Nov 2002 00:23:50 -0500, Kaveh quoth:
> I find that I can use the following code:
>
> #declare a = 1;
This creates a variable named "a" that stores the value "1" as a
double-precision floating-point number.
> #sphere {a,a pigment{color rgb a}}
This uses "a" as a color, so it gets promoted to the 5 component vector
<1,1,1,0,0> temporarily. It's still stored as a float.
> Furthermore, the following code:
>
> #declare a = 1;
> #sphere {a.x,a pigment{color rgb a}}
>
> gives the same result, i.e. a.x gives the x component, which is 1, which
> is then re-interpreted as the vector <1,1,1>
a.x is a vector expression, so "a" gets promoted to the 3 component
vector <1,1,1>. It's still a float. See section 6.1.4.4 "Operator
promotion" of the manual for more information.
--
Mark
Post a reply to this message
|
|