# Geometry nodes: point density based on distance?

Hi folks,

Please take a look at the pic below (blend file here:
distance.blend (105.1 KB)

In the project, you can see i’m altering the density of points on a line depending on a float curve.

My question is: how can i change the node set-up so that the density depends on the distance to a particular point, say for example from the world origin?

So, the closer to the world origin, the more dense the points are.

I just can’t get my head around it!

Moved to #support:modeling, added #geometry-nodes tag.

This setup might help

distance.blend (110.9 KB)

3 Likes

Thanks for taking the time man, that works really good!

Sorry, one question, what is the purpose of the switch after the object info node on the left?

It’s just for showcase to use empty or world origin 0.0.0 position

Ah, i get it, i never used a switch before, cheers!

Sorry, one other question:

If i disable the mapping node and set my object info node set to “relative”, than the first index point will locate itself to the square of the distance between the empty and the object origin.

My question is, how did you know to use that combination of those 3 math nodes (with subtract, multiply & add) to achieve that result?!

If you wanna scale object from its center (or where is empty located) first you have to translate it so the center its at world origin 0.0.0 pos, scale it, and then translate it back to its original position

Damn, i don’t understand!

Any chance you could explain it in a bit more details, because i don’t get your explanation!

You said: “If you wanna scale object from its center”
But i don’t want to scale it from its center (do i?), i want to scale it from the empty!
When you say “object”, do you mean the whole object, or each point?

Sorry, i never learnt much math at school, i guess now i’m paying the price!

(or where is empty located) (!!!)

The bit in the brackets is important.

Higgsas is explaining how any scale operation works → because scaling is always relative to (0,0,0), to scale about some arbitrary point, you need to (1.) do an inverse translation (i.e. subtraction) to the point you want to scale stuff from, (2.) scale it (note the inverse translation puts things at (0,0,0), which is why you need to do the previous step), (3.) translate it back (i.e. addition).

That’s fine… You don’t need to understand it to build an intuition - just experiment.

Good luck.

1 Like

Great, many thanks!

I made a demo project to better help me understand it, perhaps it’s helpful to other noobs to get their heads around it, blend file here:
numbers and arrows DEMO.blend (161.9 KB)