Am I normalizing my cube properly?

So I’m working on a script that creates a cube, which can be made with varying resolution, and the normalizes the points of said cube. Although the code does sorta seem to work, when I normalize the points, the cube just turns into one quarter of half a sphere.
Here’s the normalizing function:

Vector3.new(_sphereSize/2,_sphereSize/2,_sphereSize/2)*(p/math.sqrt(p.X*p.X+p.Y*p.Y+p.Z*p.Z))

(p = point)
And here’s what the result of that is:

I have no clue what I could be doing wrong, the code is run on each point when it’s being created. Any help is appreciated!

im not sure what the problem is but cant you just do

p.Unit

instead of

Turns out I just needed to set the points around the origin, (0,0,0):

If you want a more universal solution you can also just normalize like this:

(point-centerofcube).Unit + centerofcube
1 Like