View Full Version : Nodes: Y Distance to Pivot

11-19-2008, 11:45 AM
The Gradient Node does not have a Y Distance to Pivot input like the layer system has. Why? How do you "frabricate" such an input that works?

My attempt does not. I have an [Item Info:> Pivot] (of desired object) connected to a [Distance:<To] node and a [Spot Info:>Object Spot] connected to the [Distance:<From]. Thus to my logical brain it reads "Get the distance (in meters) btwn the currently sampled spot on the surface of the object and the selected object's pivot point."

The [Distance:>Result] goes to a [Gradient:<Input] and the color keys (grayscale values) of the Gradient are set the same as the layer-based gradient (ranging from 0m to 5m). The [Gradient:>Color] is piped into the [Surface root node:<Transparency].

This of course overrides the layer transparency and the result is that the surface does not render anywhere near the original... it's entirely opaque.



11-19-2008, 03:52 PM
See if this video helps:

11-19-2008, 05:59 PM
The distance node computes the distance between two point in 3D space, if you want only the Y distance between those two points you'll need to zero out the other two axis.

This can be done by putting each vector (the object's position and the surface's spot) through their own Vector Multiply node. Then multiply each vector by 1.0 for the axis you want and by 0.0 for the unwanted axis. The output of each Multiply node then goes into the Distance node.

Attached is a .nodes file with the Multiply nodes setup to constrain the Distance node to only calculating along the Y. Be sure to pick the right object for the Item Info node.

I've also just started work on a Constrained Distance node, which will let the user select which axis to use in the distance calculation.

11-19-2008, 10:00 PM
Development went faster than expected. Here's the link to Distance Along:

11-20-2008, 03:45 AM
I was playing with something similar yesterday... Maybe I've misunderstood, but doesn't the 'Y Coordinate' in the input dropdown on the gradient node do what you want?


11-20-2008, 07:56 AM
For easy access to the 'old' layer input parameters you could use a Scalar Layer Node. Make a gradient and choose the input parameters there. ("Y-distance to object" is the same as Y-distance to it's pivot.)

11-20-2008, 02:01 PM
Thanks for the great info, guys!

I was using a scalar layer node to re-create the layer-based textures in conjunction with Denis P's DP_Kit and DP_ImageFilter nodes in build 1492. Seems that they don't work there and so I installed 1505 and bingo they did and in fact discovered that Y Dist. to Object operates the same as Y Dist to Pivot. Now I'm just having major crashing for all sorts of different operations in the ImageFilter Node Editor and banging into the really nasty wall of "HV Sprites don't render behind transparent surfaces" bug.