>And I'm trying to change the
>diffuse color to red via
>automation in HTML. I would
>have thought it should look
>like this:
>
> CortonaX.Engine.Nodes
>('stainless_mat').Fields
>("diffuseColor")="1 0 0";
>
>But it doesn't work.
>How do you change the color of
>a material node via automation?
>
Yes. All component values (vectors,
colors, positions) in VRML Automation
presented as SafeArrays. You can use
VBScript's Array() function or functions
for SafeArrays from JavaScript.
And you can change this values by
components.
Examples:
c = CortonaX.Engine.Nodes
("stainless_mat").Fields("diffuseColor");
1) c.Red = 1;
2) c.Value = Array(1, 0, 0)
3) b = CortonaX.Engine.CreateField
("SFColor")
b.Red = 1;
b.Green = 0.5;
b.Blue = 0.1;
c.Assign(b);
---------------------
parker
|
|