Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 03-12-2013 , 07:53 PM
Registered User
Join Date: Jun 2013
Posts: 2

intensity of the light based on its distance from mesh

hi,
i need help with controlling the intensity of the light based on its distance from mesh

a character is moving close to wall that contains great deal of LED light, and these lights need to activated as the character gets close and later on slowly get dimmed and then turn off as the character goes further
the character is getting illuminated only by these lights

does anyone have a suggestion? much thanks


current solution i made but i'm not really happy with it
i am using locator parented to a part of rigged character, and a distance between is being calculated between that locator and a locator placed near the light. Later i clamp the value and i plug it in a B/W ramp which controls the light. --- the problem is that using this solution light in controlled only by closeness of one point and i need to be controled my the entire mass of the body (arms and legs separately).

any help, tip, you would be a lifesaver


Last edited by jovstrel; 03-12-2013 at 07:59 PM.
# 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 ||::
# 3 08-12-2013 , 06:03 AM
Registered User
Join Date: Jun 2013
Posts: 2
wow, thank you so much for the explanation
ill start testing it immediately

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads