How to map a plane onto a Octahedron without polar distortions?

41 Views Asked by At

https://www.math3d.org/ZfulehTVK this is a link to where all my visualizations are.

While researching seamless procedural texturing I noticed people creating a 4d hypersphere to loop noise back on itself, but my laptop was unable to render this quickly, so i decided to try and make 3d noise work.

the first thing I realized is i need to convert the 2d plane into a 3d surface which loops upon itself. So i used the parametric form of a torus, with the u and v coordinates corresponding to the angle of the torus, however because the U and V coordinates are positions and not angles, this leads to distortion in the noise.

So then i realized instead of a torus, i could use an Octahedron, because the absolute value of the slope of all of its sides are constant.

I also thought because I'm translating the coordinates into points, and not dividing, i should avoid pole points but I'm still seeing asymptotes in the final output.

$$f(u) = ||x-1/4|-1/2|-1/4$$

$$g(u) = |x-1/2|-1/4$$

$$h(v) = 1/2-|x-1/2|$$

$$j(v) = v/2 - 1/4$$

and the actual parametric equation is

$$(2 * g(u) * h(v), 2 * f(u) * h(v), j(v))$$

there is no dividing of v or u, so I don't understand why it is creating asymptotes. All of these are linear functions, and the change should be constant but it isn't. The actual mapping is creating a square tilted 45 degrees, so its points are on an axis, and then scaling it down and away from the origin. If i look at the Translation between the plane and the Octahedron it doesn't visually seem like a lot of distortion is happening. Is what I'm doing fundamentally impossible? A lot of the variables are there just to keep the surface area the same between the plane and the Octahedron, but i didn't actually measure what it should be so it is probably incorrect.

The other parametric equation was $$(f(u), g(u)+f(v),g(v))$$ Which did not have the same asymptotic distortions, but randomly shifted directions, and did not maintain constant rate of change. The shape it made was also very interesting and is included in my link.

I really feel like I'm close to a solution, but fundamentally missing something.