I’m trying to distribute arbitrary number of points within a sphere defined in general case via spherical coordinates:
- x = r x sin(phi) x cos(theta)
- y = r x sin(phi) x sin(theta)
- z = r x cos(phi)
I’m using geometry nodes for this and I’m setting limits 0 ≤ theta ≤ 360, and 0 ≤ phi ≤ 180. I’m using random value node to randomize the position of points within the sphere. However, instead of the spherical cloud I’m getting a 3D coiled array of points (see screenshot). This implies to me that random values are not so random. The min and max I set for the random value node look more like range limits to me than actual random values. Also, I noticed that if I play with the seed attributes, in some cases I am getting a cloud of points that does look like a sphere.
Can someone please tell me what am I missing here? Here are the screenshots of my setup and the result. I am unable to upload the blend file here so I’m linking it below.
Thank you.
File: https://file.io/dWUwGY2FNtEe
Hi THX-1138,
you have to use a different Seed for r, phi and theta!
As you have already noticed, the Min and Max inputs are just the range limits. If you don’t change the seed, you simply get the same random value but scaled by a different amount.
1 Like
Welcome
Also remember that GN has a bunch of vector functions so you can express what you’re doing in a more natural fashion:
(also note the different seeds like suggested by Zebr4)
Good luck.
2 Likes
Thank you both, I do appreciate it. I will need some time to wrap my head around why things work the way they do. To me personally, setting the seed parameter manually kinda defeats the purpose of having a “random” value node, as in, two different random nodes should not be coupled in any way, but oh well that’s how the things work. Thanks a lot, again, and especially for showing me the alternative way to do this!
2 Likes
“Random” values are deterministic based on seed (nothing to do with “coupling”) - this is a good thing… otherwise you can’t be sure that your setup will look the same on someone else’s machine.
2 Likes
Yeah, I didn’t mean to sound awkward. I fully understand now that is how the thing works and I just need to wrap my head around it. From my personal point of view, if something is declared “random” it should indeed look different if run on two different machines. But those are just semantics at this point I guess.