|
|
Timothy Cook wrote:
<snip>
> So how DO I turn a sphere into a cube with an isosurface?
> I was playing with the spherical heightfield idea, and
> decided to start with a cube. Simple enough, no? No! T_T
<clip>
Here's the way I do it:
#declare sphere_radius = 1;
#declare sphere_influence = .5;
#declare box_size = 1;
#declare box_influence = .5;
function{
(
sqrt(x*x+y*y+z*z)-sphere_radius
)*sphere_influence
+(
max(
abs(x)
,abs(y)
,abs(z)
)-box_size
)*box_influence
}
-Sam
Post a reply to this message
|
|