PDA

View Full Version : wire or script - linking colour to z-position


madmac3d
08-12-2003, 11:06 AM
Sorry, but I'm a bit of a scripting noob....

I want to know what would be the best way to link the colour of an object to its z-position....

I have tried to wire the parameter, but I need to convert the z-position from a 'float' to an integer (I think).... and I don't know how....

The alternative is to write a script that reads the z-position frame by frame, and then assigns a colour key frame by frame for the material...

Any Ideas / suggestions appreciated!

Thanks....

EricChadwick
08-12-2003, 03:17 PM
How about a Falloff map instead? Or perhaps Fog? I'm probably being too simplistic here...

Marsel Khadiyev
08-12-2003, 03:48 PM
Hmm, I'd use wiring as its the simplest and fastest solution. Have you tried using "my_param as int" ?

mef
08-12-2003, 05:44 PM
You could wire it, but you wouldn't get the level of control that you could get from scripting or using expressions.

MEF

madmac3d
08-12-2003, 10:18 PM
Well... I've managed to work out how to write an expression to control the colour of the object :-

box-z_position --> box-material-diffuse-color

using the line :-

(color (z-position/100) (z-position/100) (z-position/100))

as the "Expression for Diffuse_color"
....

That's my first successful bit of wiring using an expression!.... whoopee! :scream:

Cheers

CGTalk Moderation
01-15-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.