I have a curve line with 9 points on it, and each point has an instance of a UV sphere created on it.
Now, i want to have the size of each UV instance depend on the distance from another object in my scene (call it the “location” object).
This is quite easy to achieve using the “distance” function in the vector math node.
Problem is, i’m getting the opposite result of what i want. As it is now, my instances get bigger, the further away they are.
What i actually want is to have an instance that is in the exact same location as “location” object to have a scale of 1, and as they get further away, they should get smaller.
But due to my lack of maths knowledge, i can’t quite work out the right way to do this?
Any ideas?
Here’s my Blend file as it is if anyone wants to have a crack at it!:
Normalise yr vectors first then remap 0-1 to 1-0 add another vector math set to scale. I also notice you have yr object info set to original not relative, you need to set relative if you want this to work when you move (animate) the object, otherwise it will just use its original location.
So if i understand right, i’d imagine that when performing a vector math normalize on a vector, at least one of the output vectors should always be 1 (ignoring any rounding errors)?
Because it takes the biggest vector(s), sets it (them) to 1 and scales the rest accordingly.
Thanks guys, i’m showing my lack of education here, i left school at 15 with zero qualifications, paying the price now!
What i don’t understand is: if i want to compare the distance between two xyz locations, then how can i use the normalization function, because say location A is 1000 meters from the world origin, and location B is only 1 cm from the origin, then after normalization the distance answer makes no sense, because both vectors have been scaled to a maximum possible distance in any direction of 1 meter?!
Unless there’s some kind of Einstein-ian “spooky action at a distance” between the two vector math distance nodes!
… using a Empty as the “source”; a clamped map range with the minimum and maximum swapped should do the trick, the maximum should be set to 0 and then the minimum will determine the “range” of the effect.
Sorry, another question: how does one change how one parameter maps on to another? I mean change the curve.
If you look it the 3 pictures attached, you can see there’s a hard step in the size of the instances, with the smaller ones all staying roughly the same size, but i’m using the node setup that you suggested including the mapping node.
Is it possible to use the color ramp in geo nodes to change how one value maps to another? Is see the color ramp as an available node, but i can’t make it do anything (i’m in Eevee).
Here’s my blend file in case anyone fancies taking a look: size.blend (1.2 MB)
Ah, perfect, that’s exactly what i was looking for!
Grazie mille!
EDIT: the actual solution to my problem wasn’t the Float Curve, it was increasing the “from max” parameter in the mapping node, that moves the point from where the size starts increasing to the earlier points of the curve!