|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Recipe
------
* Take one Menger Sponge (Level according to taste).
* Chop off, diagonally, the eight corners.
* Inflate the sides until spherical.
* Polish until slightly reflective.
* Place on a micro-normal-blurred reflective surface.
* Replicate about 500 times.
* Add an area light for soft shadows.
* Turn on radiosity and focal blur.
* Render for 30 days or until done.
Post a reply to this message
Attachments:
Download 'spheresponge.jpg' (699 KB)
Preview of image 'spheresponge.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jonathan Hunt wrote:
> Recipe
> ------
> * Take one Menger Sponge (Level according to taste).
> * Chop off, diagonally, the eight corners.
> * Inflate the sides until spherical.
> * Polish until slightly reflective.
> * Place on a micro-normal-blurred reflective surface.
> * Replicate about 500 times.
> * Add an area light for soft shadows.
> * Turn on radiosity and focal blur.
> * Render for 30 days or until done.
>
> ------------------------------------------------------------------------
>
Dude, you really came back to pov with a revenge, huh?! o_O
That's friggin terrific!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jonathan Hunt <jon### [at] xlcuscom> wrote:
> Recipe
> ------
> * Take one Menger Sponge (Level according to taste).
> * Chop off, diagonally, the eight corners.
> * Inflate the sides until spherical.
> * Polish until slightly reflective.
> * Place on a micro-normal-blurred reflective surface.
> * Replicate about 500 times.
> * Add an area light for soft shadows.
> * Turn on radiosity and focal blur.
> * Render for 30 days or until done.
A math masterpiece!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That is very cool, well done!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks for the nice comments. Here's some information for those
interested in the structure of the object.
I started with my non-recursive Menger Sponger isosurface function...
function
{
max
(
#declare Level = 4;
#declare Size = 0.5;
#while (Level > 0)
#declare Size = Size / 3;
min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3))
#declare Level = Level - 1;
#if (Level > 0) , #end
#end
)
}
Contained and chopped the corners off with further "max" constraints to
form a cuboctahedron...
#declare Sponge = function
{
max
(
#declare Level = 4;
#declare Size = 0.5;
#while (Level > 0)
#declare Size = Size / 3;
min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3)),
#declare Level = Level - 1;
#end
x-1, -x,
y-1, -y,
z-1, -z,
-x+y-z-0.5,
+x+y-z-1.5,
-x-y-z+0.5,
+x-y-z-0.5,
-x+y+z-1.5,
+x+y+z-2.5,
-x-y+z-0.5,
+x-y+z-1.5
)
}
Then made a mapping that transformed any coordinate within a sphere to a
coordinate within the cuboctahedron such that any point on the surface
of the sphere would also fall on the surface of the cuboctahedron...
#declare SphereTransX = function { x * sqrt(x*x+y*y+z*z) /
max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
#declare SphereTransY = function { y * sqrt(x*x+y*y+z*z) /
max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
#declare SphereTransZ = function { z * sqrt(x*x+y*y+z*z) /
max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
From there I could simply define my Sphere Sponge as...
#declare SphereSponge = isosurface
{
function
{
Sponge
(
SphereTransX(x-0.5,y-0.5,z-0.5)+0.5,
SphereTransY(x-0.5,y-0.5,z-0.5)+0.5,
SphereTransZ(x-0.5,y-0.5,z-0.5)+0.5
)
}
contained_by { sphere { 0.5, 0.5 } }
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jonathan Hunt wrote:
> Thanks for the nice comments. Here's some information for those
> interested in the structure of the object.
>
> I started with my non-recursive Menger Sponger isosurface function...
>
> function
> {
> max
> (
> #declare Level = 4;
> #declare Size = 0.5;
> #while (Level > 0)
> #declare Size = Size / 3;
> min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
> min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
> min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3))
> #declare Level = Level - 1;
> #if (Level > 0) , #end
> #end
> )
> }
>
>
>
> Contained and chopped the corners off with further "max" constraints to
> form a cuboctahedron...
>
> #declare Sponge = function
> {
> max
> (
> #declare Level = 4;
> #declare Size = 0.5;
> #while (Level > 0)
> #declare Size = Size / 3;
> min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
> min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
> min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3)),
> #declare Level = Level - 1;
> #end
> x-1, -x,
> y-1, -y,
> z-1, -z,
>
> -x+y-z-0.5,
> +x+y-z-1.5,
> -x-y-z+0.5,
> +x-y-z-0.5,
> -x+y+z-1.5,
> +x+y+z-2.5,
> -x-y+z-0.5,
> +x-y+z-1.5
> )
> }
>
>
> Then made a mapping that transformed any coordinate within a sphere to a
> coordinate within the cuboctahedron such that any point on the surface
> of the sphere would also fall on the surface of the cuboctahedron...
>
> #declare SphereTransX = function { x * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
> #declare SphereTransY = function { y * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
> #declare SphereTransZ = function { z * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
>
>
> From there I could simply define my Sphere Sponge as...
>
> #declare SphereSponge = isosurface
> {
> function
> {
> Sponge
> (
> SphereTransX(x-0.5,y-0.5,z-0.5)+0.5,
> SphereTransY(x-0.5,y-0.5,z-0.5)+0.5,
> SphereTransZ(x-0.5,y-0.5,z-0.5)+0.5
> )
> }
> contained_by { sphere { 0.5, 0.5 } }
> }
Gosh! And somehow I was under the impression it could be some insane
CSG under the hoods... :P
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Jonathan Hunt" <jon### [at] xlcuscom> wrote in message
news:49064f8c@news.povray.org...
> Thanks for the nice comments. Here's some information for those
> interested in the structure of the object.
>
> I started with my non-recursive Menger Sponger isosurface function...
>
> function
> {
> max
> (
> #declare Level = 4;
> #declare Size = 0.5;
> #while (Level > 0)
> #declare Size = Size / 3;
> min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
> min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
> min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3))
> #declare Level = Level - 1;
> #if (Level > 0) , #end
> #end
> )
> }
>
>
>
> Contained and chopped the corners off with further "max" constraints to
> form a cuboctahedron...
>
> #declare Sponge = function
> {
> max
> (
> #declare Level = 4;
> #declare Size = 0.5;
> #while (Level > 0)
> #declare Size = Size / 3;
> min(Size-abs(mod(x,Size*6)-Size*3),Size-abs(mod(y,Size*6)-Size*3)),
> min(Size-abs(mod(y,Size*6)-Size*3),Size-abs(mod(z,Size*6)-Size*3)),
> min(Size-abs(mod(z,Size*6)-Size*3),Size-abs(mod(x,Size*6)-Size*3)),
> #declare Level = Level - 1;
> #end
> x-1, -x,
> y-1, -y,
> z-1, -z,
>
> -x+y-z-0.5,
> +x+y-z-1.5,
> -x-y-z+0.5,
> +x-y-z-0.5,
> -x+y+z-1.5,
> +x+y+z-2.5,
> -x-y+z-0.5,
> +x-y+z-1.5
> )
> }
>
>
> Then made a mapping that transformed any coordinate within a sphere to a
> coordinate within the cuboctahedron such that any point on the surface of
> the sphere would also fall on the surface of the cuboctahedron...
>
> #declare SphereTransX = function { x * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
> #declare SphereTransY = function { y * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
> #declare SphereTransZ = function { z * sqrt(x*x+y*y+z*z) /
> max(abs(x),abs(y),abs(z),(abs(x)+abs(y)+abs(z))/2) }
>
>
> From there I could simply define my Sphere Sponge as...
>
> #declare SphereSponge = isosurface
> {
> function
> {
> Sponge
> (
> SphereTransX(x-0.5,y-0.5,z-0.5)+0.5,
> SphereTransY(x-0.5,y-0.5,z-0.5)+0.5,
> SphereTransZ(x-0.5,y-0.5,z-0.5)+0.5
> )
> }
> contained_by { sphere { 0.5, 0.5 } }
> }
Great, thanks for that, I'm going to have a play with that later tonight!
Cheers Dre
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
nemesis wrote:
> Gosh! And somehow I was under the impression it could be some insane
> CSG under the hoods... :P
Hehe :-) The really nice thing about defining it as an Isosurface is
that you can make it as complicated as you want (i.e. render the sponge
at any level you want) without taking up tons and tons of memory.
The real limit then becomes how many pixels you have on the screen to
visualize the beast! :-)
--
Jonathan Hunt
jon### [at] xlcuscom
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Dre wrote:
> Great, thanks for that, I'm going to have a play with that
> later tonight!
I almost forgot...
If you can compile your own version of POV-Ray, you may be interested in
this trick to speed up rendering *A LOT*
Load up isosurf.cpp, scroll down to the bottom, and replace the
Evaluate_Fuction code with the code shown below. This is basically a
pure C code version of my Sphere Sponge isosurface function, and as you
can imagine, can be evaluated much faster than the parsed SDL version.
DBL Evaluate_Function(FUNCTION funct, VECTOR fnvec)
{
DBL result = -1.0;
DBL x = fnvec[X]-0.5;
DBL y = fnvec[Y]-0.5;
DBL z = fnvec[Z]-0.5;
DBL max = fabs(x);
if (fabs(y) > max) { max = fabs(y); }
if (fabs(z) > max) { max = fabs(z); }
if ((fabs(x)+fabs(y)+fabs(z))/2 > max) { max =
(fabs(x)+fabs(y)+fabs(z))/2; }
DBL sphereScale = sqrt(x*x+y*y+z*z) / max;
x *= sphereScale;
y *= sphereScale;
z *= sphereScale;
x += 0.5;
y += 0.5;
z += 0.5;
DBL size = 0.5;
for (int level = 4; level > 0; --level)
{
size /= 3.0;
DBL a = size - fabs(fmod(x,size*6.0)-size*3.0);
DBL b = size - fabs(fmod(y,size*6.0)-size*3.0);
DBL c = size - fabs(fmod(z,size*6.0)-size*3.0);
if (a < b)
{
if (a > result) { result = a; }
}
else
{
if (b > result) { result = b; }
}
if (b < c)
{
if (b > result) { result = b; }
}
else
{
if (c > result) { result = c; }
}
if (c < a)
{
if (c > result) { result = c; }
}
else
{
if (a > result) { result = a; }
}
}
if (x-1 > result) { result = x-1; }
if (y-1 > result) { result = y-1; }
if (z-1 > result) { result = z-1; }
if (-x > result) { result = -x; }
if (-y > result) { result = -y; }
if (-z > result) { result = -z; }
if (-x+y-z-0.5 > result) { result = -x+y-z-0.5; }
if (+x+y-z-1.5 > result) { result = +x+y-z-1.5; }
if (-x-y-z+0.5 > result) { result = -x-y-z+0.5; }
if (+x-y-z-0.5 > result) { result = +x-y-z-0.5; }
if (-x+y+z-1.5 > result) { result = -x+y+z-1.5; }
if (+x+y+z-2.5 > result) { result = +x+y+z-2.5; }
if (-x-y+z-0.5 > result) { result = -x-y+z-0.5; }
if (+x-y+z-1.5 > result) { result = +x-y+z-1.5; }
return result;
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|