Simple Isosurfaces

© Mike Williams 2001,2002,2003,2004

Up | Previous: Isobar Analogy | Next: Syntax Subtleties | Alphabetical Index

It's possible to build most, if not all, of the basic POV shapes with isosurfaces. In practice, you'd probably not want to bother with an isosurface if there's an equivalent basic shape available, but understanding these simple shapes gives us insight into how to develop more complex surfaces.

The syntax used for the isosurfaces used on this page is like


isosurface {
  function { x*2 + y*2 + z*2 - R*R }
        accuracy 0.001
        max_gradient 4
        contained_by{sphere{0,1.2}}
        pigment {rgb .9}
        finish {phong 0.5 phong_size 10}
}

sphere {0,1.2 pigment {rgbt <1,0,0,0.9>}}

Sphere

function { x*x + y*y + z*z - R*R }

Maths: Take a look at what happens on the x, y, and z planes. On the x plane, x=0, the equation reduces to y*y + z*z - R*R = 0 the two dimensional equation of a circle radius R. Similarly the intersection with the y and z planes are also circles. This probably doesn't come as much of a surprise, but if you get a feel for how the 2D equations come together to make the 3D equation you can sometimes get a feel for how to build other 3D surfaces.

Cylinder

function { y*y + z*z - R*R }

Maths: The cross section of this object on any x plane is clearly always the circle y*y + z*z - R*R = 0.

Plane

function { y }

Maths: Well, functions don't come much simpler than that. The isosurface exists wherever y takes the value zero.

This is the y plane. The x plane and z plane are simply function {x} and function {z}.

The plane through the point <0,1,0> is given mathematically by y = 1 so the function (with threshold zero) is therefore function { y - 1 }.

Box

function { max((y*y-1),(x*x-1),(z*z-1)) }

Maths: What I've done here is to take the double-plane function { y*y - 1} and intersect it with similar x and z double planes. max() performs intersections of isosurfaces.

function { y*y - 1} is mathematically y^2 -1 = 0 which has the two planar solutions y = +1 and y = -1, so the function describes the two planes.

Paraboloid

function { x*x + y +z*z - 1 }

Maths: Observe that the intersection with the y plane is a circle x^2 + z^2 - 1 = 0 and the intersections with the x and z planes are parabolas y = x^2 + 1.

Hyperbolic Paraboloid

function { x*x + y - z*z }

Maths: Observe that the intersection with the y plane is a hyperbola x^2 - z^2 = 0 and the intersections with the x and z planes are parabolas y = -x^2.

Octahedron

function { abs(x)+abs(y)+abs(z) - 1 }

Download a zip file containing the POV source files for all the images that appear on this page.
Download

Up | Prevoius: Isobar Analogy | Next: Syntax Subtleties | Alphabetical Index