by Daniel Skarda and Tomas Bily (Tuh0r Team)
Examples of noise3d(x,y,z) fuction

This patch is an unofficial version of POV-Ray and it is not supported by POV-Ray Team. It enxtends POV-Ray 2.2 with implicit functions F(x,y,z)=0 and parametric surfaces x(u,v),y(u,v),z(u,v).
parimp-0.92.tar.gz includes modified POV-Ray files and Makefile for Linux/GCC.
For solving intersection between ray and surface we use interval arithmetic. It requires continuity for find correct solution of equality and continuity for correct shading. Normals (partial derivates) are computed by numeric methods.
Sphere
implicit {
function sqr(x) + sqr(y) + sqr(z) - 1
< -1.5, -1.5, -1.5>, <1.5, 1.5, 1.5>
accuracy 0.001
.
.
.
}

Blob
Classical blob (Jim Blinn) - no polynomial aproximation!
#declare delta= 1.1
#declare BLOB= function exp(1-sqr(x)-sqr(y+delta)-sqr(z))
+ exp(1-sqr(x)-sqr(y-delta)-sqr(z)) - 1
implicit {
function BLOB
< -2,-2,-2>, < 2,2,2>
accuracy 0.01
.
.
.
}
#declare Ro=0.4
#declare Ri=1.8
#declare P=Ri*Ri+Ro*Ro
#declare M=Ri*Ri-Ro*Ro
#declare MM=M*M
/*
#declare TORUS=
function x^4+2*sqr(x)*(sqr(y)+sqr(z)-P)+y^4+2*sqr(y)*(sqr(z)+M)+
z^4-2*sqr(z)*P+MM
*/
implicit
{
function exp(-(x^4+2*sqr(x)*(sqr(y)+sqr(z)-P)+y^4+2*sqr(y)*(sqr(z)+M)+
z^4-2*sqr(z)*P+MM)) +
exp(-(x^4+2*sqr(x)*(sqr(z)+sqr(y)-P)+z^4+2*sqr(z)*(sqr(y)+M)+
y^4-2*sqr(y)*P+MM)) +
exp(-(y^4+2*sqr(y)*(sqr(x)+sqr(z)-P)+x^4+2*sqr(x)*(sqr(z)+M)+
z^4-2*sqr(z)*P+MM)) - .7
<-Ro-2*Ri,-Ro-2*Ri,-Ro-2*Ri>, <Ro+2*Ri,Ro+2*Ri,Ro+2*Ri>
accuracy .01
pigment { color rgb <0,1,1> }
}
#declare HEART= function cub(2*sqr(x)+sqr(y)+sqr(z)-1) -
(0.1*sqr(x)+sqr(y))*cub(z)
.
.
.
#declare KLEINE=function (sqr(x)+sqr(y)+sqr(z)+2*y-1)*(sqr(sqr(x)+sqr(y)+sqr(z)
-2*y-1)-8*sqr(z))+16*x*z*(sqr(x)+sqr(y)+sqr(z)-2*y-1)
function_xy {
function cos(10*(sqrt(sqr(x)+sqr(y))))
<-2,-2,-2>,<2,2,2>
accuracy 0.01
.
.
.
}
#declare SPHERE = implicit {
function sqr(x)+sqr(y)+sqr(z)-1
accuracy 0.01
all_intersections
<-1.5,-1.5,-1.5>, <1.5,1.5,1.5>
pigment { color rgb <1,1,0> }
}
#declare BOX =
box {
<-0.75,-0.75, -0.75>, <0.75,0.75,0.75>
pigemnt { color rgb <1,1,1> }
}
difference {
object {BOX}
object {SPHERE}
pigment { color rgb <1,1,1> }
finish { ambient 0.7 }
}
Plane
Just another plane.
parametric {
function u,0,v
<-1,-1>, <1,1> /* range of u and v */
<-1.5,-1.5,-1.5>,<1.5,1.5,1.5>
accuracy 0.01
.
.
.
There appears strange bug with this cone - can you notice it?
7/1/96 - this bug is fixed.
#declare PI=3.14159265358979323
parametric {
function sin(v), u, cos(v)
<-1,-PI>, <1,PI>
.
.
.
map_type 8
This is another parametetric surface ...
#declare PI=3.14159265358979323
parametric {
function v*cos(4*u), u, v*sin(4*u)
<-PI/2,-1>, <PI/2, 1>
pigment {
image_map {
tga "bv17.tga"
map_type 8
}
}
finsih { ambient 0.7 }
}