PDA

View Full Version : Nodal proximity reaction?: driving morphs by proximity to null, plus other questions



jeric_synergy
12-23-2013, 08:26 PM
In a sidetrack on another thread, I whipped up this LWS that was supposed to demo how to make a morph react to a null. Any SPOT closer than 1 meter to the null should have the endomorph applied in a gradated manner.

Unfortunately, it only works at a very very basic level, in that moving the morphing object makes it fail.

118880

If you move the "Tire" object, it reacts to the null's location as if it ("Tire") were still in the original position. I suppose this is a World Spot issue, but rewiring the network to address that (see jpeg). As you can see, this network compares the WORLDSPOT to the location of the null. But, that's apparently not correct yet.

118881
What am I missing here?

Also, what would one do if one wanted the morph to be triggered by a larger area, instead of just a point (i.e. a null) ??? Like a wall or a ground mesh?

Thanks.

JohnMarchant
12-23-2013, 09:49 PM
Nice indeed jeric

jeric_synergy
12-23-2013, 10:21 PM
Huh? It doesn't really work, although I can't figure out why.

One can even DISCONNECT (!!) the SpotInfo/WorldSpot from the Distance Node, and it still works just the same. --That just freeks me out.

I'm wondering if the Distance Node isn't doing what I expect....

EDIT: FIXED

And as usual, the culprit was NODE DISPLACEMENT ORDER. The proper setting is "Before World Displacement", which makes no sense to me, but hey, just happy I could make it work.


Here's a working version:
118883

samscudder
01-16-2014, 05:26 AM
You can also use the color channel of a gradient instead of the alpha to drive a morph map, where black (0 0 0) is 0% and white (255 255 255) is 100%. This also lets you visually see how the value is reacting, because the preview ball will turn shades of grey according to the distance (black indicating 0% and white indicating 100%)

I guess you know how to adjust the position of the keys to "scale and clamp" the output.

jeric_synergy
01-16-2014, 07:22 PM
You can also use the color channel of a gradient instead of the alpha to drive a morph map, where black (0 0 0) is 0% and white (255 255 255) is 100%. This also lets you visually see how the value is reacting, because the preview ball will turn shades of grey according to the distance (black indicating 0% and white indicating 100%)

I guess you know how to adjust the position of the keys to "scale and clamp" the output.
Can you illustrate this with a sample scene?

samscudder
01-18-2014, 12:07 PM
Let's take your scene for example... Check out this node diagram:

119400

Note that I changed to use the color instead of the alpha... I've then set the gradient so that when I want 100% morph, it's white, and when I want 0% morph it's black:

119401

Also note that the input to the gradient is the distance in meters. If the distance from the edge of the tyre to the null is greater than 1, the color output will be black (100%). If the distance is 0, it will be white (check out the keys in the gradient). At 0.5m, the gradient output will be 50%.

Let's say for arguments sake that you want the morph to be 0% at 2m and higher... You can set the key position for the 0% (black) key to 2, and show the gradient starting and ending at 2.0:

119402

The preview ball will give you and idea of how the output values are (click on the update button at the top of the node editor)... like this:

119404

If the ball was all black, it would mean the morph would be at 0% for all spots.

XswampyX
01-18-2014, 03:49 PM
Woohaaa. Don't use the colour output..... It's gamma corrected!

119408

While it might be handy to set your mesh colour in the surface properties to see the effect, it's a mistake to use it for anything else.

Load the scene, move it through 120 frames, you will see they don't match.
The first ball is the null, the second ball tracks it with the alpha channel, the third uses the colour.
Then change the colour space to linear and it changes again.

Not good.

samscudder
01-18-2014, 04:10 PM
I stand corrected! :-) Looks like you can also use alpha values > 100% and < 0%

pinkmouse
01-18-2014, 05:19 PM
Woohaaa. Don't use the colour output..... It's gamma corrected!

Indeed. And it's a real pain when using gradients to drive vectors in nodal motion. I did put in a FB feature request to have it switchable.