konstantin magnus Posted November 7, 2021 Share Posted November 7, 2021 Sphere HDA with more regular quads: Left: Normalized box with dense corner regions. Right: More regular quad mesh (see code below). // Turns unit size box into sphere // Source: http://mathproofs.blogspot.com/2005/07/mapping-cube-to-sphere.html vector pos = v@P * 2.0; float x2 = pos.x * pos.x; float y2 = pos.y * pos.y; float z2 = pos.z * pos.z; float x = pos.x * sqrt(1.0 - (y2 + z2) / 2.0 + (y2 * z2) / 3.0); float y = pos.y * sqrt(1.0 - (z2 + x2) / 2.0 + (z2 * x2) / 3.0); float z = pos.z * sqrt(1.0 - (x2 + y2) / 2.0 + (x2 * y2) / 3.0); pos = set(x, y, z); v@P = pos; konstantin.quad_sphere.1.0.hdalc 4 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.