Change object color with moving object

I’m trying to make a moving (animated) object control, or change, the color of another object. The moving object is shorter than the stationary one, so only a short section will have a color change. I don’t know how (or if) I can get the location information of the moving object to the still one. Any ideas?

I guess you could set up driven keys on the stationary object’s Material IPOs, but then you can only drive with one dimension. For a simple motion, it would probably be easier just to keyframe the RGB. Is your setup very complicated?

It’s complex…the moving object is a hollow cylinder, the stationary object is a helix (a spring). So basically a section of the spring (that is a long as the cylinder) will have a color change.

You can set up a texture to control your helix, then parent your cyclinder to the helix so that they are linked. In the texture map to buttons, select object and type in the name of the cylinder object. I used a blend texture for testing and teaching myself this trick just now, and it works. You might have to adjust your axis/texture space…but it can be done.

here’s a sample blend and avi jpeg zipped up (218 kb zipped.)

Are you confusing parenting and mapping? If I parent the cylinder to the helix, it will move. I will try this since I don’t understand when you say “adjust the axis/texture space.”

no confusion…the mapping wasn’t working at first so I tried parenting and it worked (I must have changed something else in the interim…)parenting is not required for this example.

could you fake it with a colored lamp that moved with your animated object but was set up to only illuminate the stationary object.?
a test this has a different look than the file above but its interesting.

I think it would be difficult for the lamp to light the entire helix. The lamp could only be used to color the helix. It couldn’t change the alpha or the emmisivity, etc.

Actually, the object color mapping from dschnell is very nice. I played with the concept a bit and got exactly what I wanted…sharply defined regions. I used two “empties” parented to the moving object (so that they would move with it) and had the helix mapped to the empties controlling their color (with oppositely directed blends)…made really nice, sharply defined regions!