View Single Post
# 2 05-12-2013 , 07:37 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
Sounds like a simple setup, you just need these nodes:

distanceBetween
setRange
and a reverse node to invert the shrinking distance gap into an increasing intensity.

In this case, I suppose you can create a dummy primitive around the character and set it not to render.

Connections:

objA.rotatePivotTranslate->distanceBetween.point1
objA.worldMatrix[0]->distanceBetween.inMatrix1
objB.rotatePivotTranslate->distanceBetween.point2
objB.worldMatrix[0]->distanceBetween.inMatrix2
distanceBetween.distance->setRange.value
setRange.outValue->reverse.input
reverse.outputX->light.intensity

The setRange will need a value for the "old max", basically, it's the distance at which the light starts fading in/out and it also needs a max value to output(I used a value of 1.000), in the case of using lights with decay, you may need a multiply and clamp node slipped into the network as well.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::