sessionbeer Posted October 25, 2016 Share Posted October 25, 2016 (edited) Hello, I'm trying to replicate the same deformation as seen in the gif below. After some research I believe it's got something to do with Spherical Coordinates? I implemented the formula from this site which is: radius = sqrt(x^2 + y^2 + z^2) polar = arccos(z/radius) azimuthal = atan2(y, x) x = radius * sin(polar) * cos(azimuthal) y = radius * sin(polar) * sin(azimuthal) z = radius * cos(polar) But this results in some pinching of the cube at both poles, so maybe this isn't right, or I haven't done it correctly? Has any one got any experience with something like this? Any help would be really appreciated. Thank you sphere_deform.hip Edited October 25, 2016 by sessionbeer Quote Link to comment Share on other sites More sharing options...
galagast Posted October 25, 2016 Share Posted October 25, 2016 Hi, here's my quick take on it. Didn't use Spherical Coordinates though.. also apologies as I was just eye-balling some of the values >_< H15.5.607 Indie sphere_wrap.hiplc Quote Link to comment Share on other sites More sharing options...
mestela Posted October 25, 2016 Share Posted October 25, 2016 Feels similar to the mobius transformation stuff here: Quote Link to comment Share on other sites More sharing options...
sessionbeer Posted October 26, 2016 Author Share Posted October 26, 2016 Thanks @galagast and @mestela, Unfortunately I don't think either of those routes are right for this deformation, and after some more research I think I may have titled this post wrong. I'm not sure what the formula is called but I think this is getting pretty close to it: float len = length(@P); float a = (fit(len, 0, 2, 0, $PI*0.5)); float r = chf("radius"); f@x = r * cos(a); f@y = r * sin(a); @P.x *= @y; @P.y *= @y; @P.z = @x*2; I'm basically wrapping a disc shape around a sphere but using the centre point as the front of the sphere, and the sides of the disc as the back of the sphere. This looks like its close but I cant get the points to push out into a proper spherical shape? Can any one spot my silly mistake here and why I can't get the points out into the sphere shape? Any help would be amazing as I'm so confused why its not working? Thank you sphere_wrapping_disc.hip Quote Link to comment Share on other sites More sharing options...
galagast Posted October 26, 2016 Share Posted October 26, 2016 (edited) It may not be in-line with the formula you're using.. if you try adding this to the last line of the code, is it what you were after?: @P = normalize(@P) * r*2; @mestela: Those are gold! thank for the link! Edited October 26, 2016 by galagast Quote Link to comment Share on other sites More sharing options...
sessionbeer Posted October 26, 2016 Author Share Posted October 26, 2016 @galagast thanks for the quick reply! I just tried that line of code and although it visually looks correct, it seems to only work in that one situation for example if you placed a box or grid as the input geo, like in the gif above, it breaks the formula. It feels so close though! 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.