POV3ISO examples
Isosurface of External Data

The 3D data "3dhead" is available from ftp.povray.org.
// POV3ISO sample file. By R.Suzuki (Apr. 1997)
#include "colors.inc"
#include "textures.inc"
#declare HEAD = function{ "data_3D_1", <-0.001>
// parameters for "library":
// p0: Nx, p1: Ny, p2: Nz
// p3: case 0: text case 1: 1 byte binary
// case 2: 2 byte binary int case 3: 4 byte binary int
// case 4: 4 byte binary float
library "i_dat3d","3dhead", <256,256,109,2>
}
#declare ISOCOL= pigment{ function {HEAD} color_map{
[0.0, 0.2 color red 1.6 green 1.2 blue 1.0 color red 1.6 green 1.6 blue 0.8]
[0.2, 0.4 color red 1.6 green 1.6 blue 0.8 color red 0.6 green 1.6 blue 1.6]
[0.4, 0.5 color red 0.6 green 1.6 blue 1.6 color red 0.6 green 0.6 blue 0.7]
[0.5, 0.7 color red 0.6 green 0.6 blue 0.7 color red 1.1 green 0.6 blue 1.5]
[0.7, 0.9 color red 1.1 green 0.8 blue 1.5 color red 1.6 green 1.0 blue 1.0]
[0.9, 1.002 color red 1.6 green 1.0 blue 1.0 color red 1.6 green 1.2 blue 1.0] }
frequency 1.0 }
camera {
location <425, 215, -465>
direction <0, 0, 2.5>
look_at <0,0,0>
}
light_source {<110, 180, -140> color White}
light_source {<120, 10, 220> color White}
light_source {<180, 120, -120> color White}
background {color DarkSlateGray}
isosurface
{
function {HEAD}
bounded_by{ box{<0, 0, 0>, <255,255,162>} }
threshold -0.50
accuracy 0.01
pigment {ISOCOL} rotate <-10,0,0> translate <-3.3,0,0> finish {phong 0.6} no_shadow
finish {phong 0.6}
translate <-128, -140, -94>
scale <1,1,1.2>
rotate <180, -90, 0>
no_shadow
}
#include "colors.inc"
#include "textures.inc"
camera { location <25, 15, -65> direction <0, 0, 2.0>
look_at <0,0.5,0> }
light_source {<10, 80, -40> color White}
light_source {<-20, 10, -120> color White}
light_source {<80, 20, -20> color White}
background {color DarkSlateGray}
isosurface {
function {"odd_sphere", <1.0, 5., 0.5>, library "i_dat3d","test1.dat", <7,7,7,0> }
bounded_by{ box <-14, -14, -14> <14, 14, 14> }
eval
accuracy 0.01
pigment {Red_Marble scale 0.7}
finish {phong 0.6}
rotate x*-10
}
Example
of "function" pattern type.
#include "colors.inc"
#declare GRID1=
function {min(min(abs(cos(z)), abs(cos(y))),abs(cos(x)))}
camera {
location <65, 25, 35>
direction <0, 0, 6.0>
look_at <0,0,0> }
light_source {<40, 180, 10> color White*0.8}
light_source {<-20, 40, 120> color White}
light_source {<80, 20, 80> color White*0.8}
background {color <0.2, 0.2, 0.33>}
isosurface {
function {"func_5", <16, 0.01, 6.0, 0.02, 1.2>, library "i_nfunc"}
bounded_by{ box {<-5, -5, -5>, <5, 5, 5>}}
threshold -2.8
max_gradient 3.7
pigment {
function GRID1
color_map {[0.0, 0.05 color <.2, .2, .2> color < 1, 1, 1>]
[0.05, 1 color <1, 1, 1> color <1, 0.5, 0>]}
frequency 0.2
scale 0.25
}
normal {
function GRID1
slope_map { [0 <0,-1>] [0.1 <-1,-1>] [0.1 <-1, 1>] [1 <0, 1>] }
scale 0.25
}
finish {ambient 0.3}
finish {phong 0.8}
}
Example
of UV mapping to POV's bezier patches.
camera { location <24, 30, -45> direction <0, 0, 4.5> look_at <0,1,0>}
light_source {<150, 400, -120> color <1,1,1>}
light_source {<350, 200, -120> color <1,1,1>}
background {color red 0.35 green 0.28 blue 0.12}
bicubic_patch { type 1
flatness 0.01
u_steps 4
v_steps 4
<0, 0, 2>, <1, 0, 0>, <2, 0, 0>, <3, 0,-2>,
<0, 1 0>, <1, 1, 0>, <2, 1, 0>, <3, 1, 0>,
<0, 2, 0>, <1, 2, 0>, <2, -2, 0>, <3, 2, 0>,
<0, 3, 2>, <1, 3, 0>, <2, 3, 0>, <3, 3, -3>
pigment {
image_map {
gif "..\povscn\level3\Ionic5\congo4.gif"
map_type 8
}
}
translate <-1.5,-1,-1>
rotate <90,170,0>
scale 4 }
Rusty mesh: Example of combination of 3D functions.
camera { location<15,40,-35> direction<0,0,5.5> look_at<0,0,0>}
light_source {<-50, 40, -20> color <1,1,1>}
light_source {< 0, 50, -50> color <1,1,1>}
background {color <0.65,0.72,0.72>}
#declare MESH1 = function {"mesh1", <1, 1, 1, 0.17, 1>}
#declare RUSTY_MESH =
function{ MESH1(x,y-z*z*0.07+0.4,z) +
noise3d(x*3,y*3,z*3)*0.2 +
noise3d(x*12,y*12,z*12)*0.05-0.125}
isosurface {
function{ RUSTY_MESH }
bounded_by{ box {<-3.7, -0.8, -3.7>, <3.7, 0.8, 3.7>}}
eval
threshold 0.18
method 2
pigment {colour <0.65,0.3,0.1>}
finish {ambient 0.3}
scale 1.25
}
Another example of 3D functions.
camera {location <15,20,-35> direction <0,0,5.5> look_at <0,0,0>}
light_source {<-50, 40, -20> color <1,1,1>}
light_source {< 0, 40, -50> color <1,1,1>}
background {color <0.65,0.72,0.72>}
#declare F0 = 5
#declare COS1 = function{ (cos(x*F0)+cos(y*F0*0.5)+cos(z*F0))*0.15}
#declare GAUSSIAN = function{ exp((-x*x-y*y-z*z)*0.15)}
#declare GRID2 = function {(cos(y*F0)*cos(y*F0)+
cos(sqrt(x*x+z*z)*F0)*cos(sqrt(x*x+z*z)*F0))}
isosurface {
function{ COS1(x,y,z)*GAUSSIAN(x,y,z) }
bounded_by{ sphere{<0,0,0>, 3.2} }
eval
threshold -0.1
method 2
pigment { function GRID2
color_map {[0.0, 0.05 color <.1, .1, .4> color < 1, 0.8, 0.6>]
[0.05, 1 color <1, 0.8, 0.6> color <0.0, 0.0, 1.>]}
frequency 0.2
scale 0.5
}
normal { function GRID2
slope_map { [0 <0, -1>] [0.1 <-1, -1>] [0.1 <-1,1>] [1 <0,1>] }
scale 0.5
}
finish {ambient 0.3 phong 0.8}
scale 1.4
}