POV-Ray : Newsgroups : povray.newusers : What ARE isosurfaces? : Re: What ARE isosurfaces? Server Time
5 Nov 2024 11:18:37 EST (-0500)
  Re: What ARE isosurfaces?  
From: Chris Huff
Date: 31 Jul 2001 11:18:24
Message: <chrishuff-2A35A7.10160631072001@netplex.aussie.org>
In article <3b6671b7$1@news.povray.org>,
 "Tom Melly" <tom### [at] tomandlucouk> wrote:

> A sphere is still pretty straight forward: sqr(x) + sqr(y) + sqr(z) - 1, i.e.
> "create a surface where the square of x plus the square of y plus the square 
> of z minus 1 = 0".

Actually, you may want to use "sqrt(sqr(x) + sqr(y) + sqr(z)) - Radius". 
This one is easier to describe as well: sqrt(sqr(x) + sqr(y) + sqr(z)) 
equals the distance from the origin, so the surface of this function is 
created by all the points where the distance from the origin minus a 
radius value equals 0...in other words, all points where the distance 
from the origin equals the radius.
Your function might be a little faster, since it doesn't have a sqrt() 
call...but it also returns the square of the distance instead of the 
distance. Because the square of 1 is 1, it still works for a sphere of 
radius 1, but you will have to square the radius to use other radii, and 
it won't give the expected results if you alter the surface with other 
functions ("displacement mapping").
Note that this function starts out with a value of -Radius at the 
origin, increases to 0 at the surface of the sphere, and continues to 
increase beyond that. If you want it to start out positive and drop 
(like the spherical pattern), switch the radius and distance portions 
around:
function {Radius - sqrt(sqr(x) + sqr(y) + sqr(z))}
Note: To really mimic the spherical pattern, you would have to prevent 
it from going negative by putting it in a call to max().


Basically, POV takes a mathematical function that takes xyz coordinates 
and returns a smoothly changing float value. It then steps its way along 
each ray passing through the container object for the isosurface, 
searching for points where the function is equal (or very close to) the 
threshold value, resulting in a surface.

I tend to visualize the functions as density fields, or groups of 
density fields that interact. After working with them a while, you will 
learn that some functions create specific "shapes" and be able to mix 
them together. You don't need to know any trigonometry or calculus, 
simple algebra is enough, but it is very helpful to know the graphs of 
the trig functions, because these are usually used to change the shapes 
of isosurfaces.

-- 
Christopher James Huff - chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.