2
$\begingroup$

I am following a tutorial where a cube is transformed into a sphere and I want to understand why this happens. I understand that ...

  • each vertex can be described as a vector
  • the position node gives me the x,y,z coordinates of the cube's vertices
  • the length node gives me the length of each vector
  • the divide node divedes 1 by the vectors length
  • the coordinates of every vertex is scaled by the factor 1/vector length
  • when multiplying a vector by a floa, each element of the vector is multiplied by the factor

but why does this operation lead to a sphere when applied to all of the cubes vertices? is there an INTUITIVE way to understand that? Or is this just a formula to be remembered?

$\endgroup$
1
  • 2
    $\begingroup$ A sphere is the unique 3D object for which every vertex is at exactly the same (Euclidean) distance from a fixed point (its center). For a cube centered at (0,0,0), multiplying every vertex by 1/vector_length forces every vertex to have magnitude 1.0 -- i.e., this is now a "unit sphere" (every vertex is exactly distance 1 from (0,0,0)). Multiplying it by some additional factor then changes this from a unit sphere into a sphere with a smaller or larger radius, depending on chosen factor. All calculations involved are continuous, so this transformation looks 'smooth'. $\endgroup$ Feb 2, 2023 at 17:07

1 Answer 1

6
$\begingroup$

You don't have to remember the formula, because thankfully there is a node in Geometry Nodes that does this calculation automatically: it is the Vector Math node when you set it to Normalize. This converts every vector to a vector with a length of 1. And the intuitive way to understand why this leads to a sphere is this mathematical definition:

A sphere is the set of points that are all at the same distance $r$ from a given point in three-dimensional space.

So setting all vertices in a distance $r=1$ from the center complies the conditions to form a sphere. Well, of course not perfectly since depending on the resolution it will not have an absolutely smooth surface, but that's always the case with polygonal meshes - they are only an approximation.

It doesn't matter if the original shape is a cube or Suzanne - the resulting meshes might look different and there might be overlapping faces, but the general shape is a sphere. By the way, of course this only works if the shape you want to make spherical is positioned around the center, if all vertices are located in one direction, you only get a partial sphere.

Cube:

cube to sphere

Suzanne:

monkey to sphere

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .