/*
Copyright (c) 2005 by Thomas J. Greenbaum. Some Rights Reserved.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
http://creativecommons.org/licenses/by-nc-sa/3.0/
Spheriphor_Study04.pov
Spheriphor Generator, version November 18, 2005
For creation of a visual metaphor for representing complex data clusters
Based on original Snowflake Generator work, this time with spherical shells
The Fibonacci Series is used as a sample data set
Command line options to redirect file output
Test resolution setting:
+FC24, +Lc:\spheriphor, +Ospheriphor017 Width=640, Height=480, +A
High resolution setting:
+FC24, +Lc:\spheriphor, +Ospheriphor030 Width=3072, Height=2304, +A
Zazzle resolution setting:
+FC24, +Lc:\spheriphor, +Ospheriphor033 Width=6400, Height=4800, +A
NOTES: +FC24 = Compressed Targa-24 format (RLE, run length encoded) 24bit color depth
*/
#include "stdinc.inc"
//Increase max_trace_level to calculate multiple layers of transparent objects
global_settings
{
max_trace_level 20
}
//Solid color for quick render set to 0, transparent takes long set to 0.7
#declare trans_no = 0.75 ;
#declare SkyBlueTrans = color rgbf <0.196078, 0.600000, 0.800000, trans_no> ;
#declare BrightGoldTrans = color rgbf <0.950000, 0.950000, 0.050000, trans_no> ;
#declare SpringGreenTrans = color rgbf <0.000000, 1.000000, 0.498039, trans_no> ;
#declare RedTrans = color rgbf <1.000000, 0.000000, 0.000000, trans_no> ;
#declare NavyBlueTrans = color rgbf <0.137255, 0.137255, 0.556863, trans_no> ;
#declare Grid_finish = finish {
ambient 0.200
diffuse 0.400
specular 1.000
roughness 0.001
//reflection {.7}
}
#declare Rfinish = finish {
ambient 0.700
diffuse 0.400
specular 1.000
roughness 0.001
//reflection {.7}
}
//Primitives
#declare HemiSphere =
difference {
sphere { <0,0,0>,1}
sphere { <0,0,0>,0.99}
box { <-2,0,-2>,<2,2,2> }
}
#declare HalfPipe =
difference {
cylinder { <0,0,0>,<1,0,0>,1 }
cylinder { <-0.5,0,0>,<1.5,0,0>,0.99 }
box { <-2,0,-2>,<2,2,2> }
}
//Metrics
#declare s1_rad = 1 ;
#declare s1_val = array[9] {1,2,3,5,8,13,21,34,55} ;
#declare s1_cnt = 9 ;
#declare s1_ang = 360/s1_cnt ;
#declare s1_tra = s1_rad/sind(s1_ang/2) ;
#declare s0_rad = s1_rad+s1_tra ;
#declare i = 0 ;
#declare Sum = 0 ;
#while (i < s1_cnt )
#declare Sum = Sum + s1_val[i] ;
#declare i = i + 1;
#end
#declare s2_val = array[9][8]
{ //Column 1 2 3 4 5 6 7 8
{0.018518519,0.018518519,0.037037037,0.055555556,0.092592593,0.148148148,0.240740741,0.388888889}, //Row 1
{0.037037037,0.037037037,0.074074074,0.111111111,0.185185185,0.296296296,0.481481481,0.777777778}, //Row 2
{0.055555556,0.055555556,0.111111111,0.166666667,0.277777778,0.444444444,0.722222222,1.166666667}, //Row 3
{0.092592593,0.092592593,0.185185185,0.277777778,0.462962963,0.740740741,1.203703704,1.944444444}, //Row 4
{0.148148148,0.148148148,0.296296296,0.444444444,0.740740741,1.185185185,1.925925926,3.111111111}, //Row 5
{0.240740741,0.240740741,0.481481481,0.722222222,1.203703704,1.925925926,3.129629630,5.055555556}, //Row 6
{0.388888889,0.388888889,0.777777778,1.166666667,1.944444444,3.111111111,5.055555556,8.166666667}, //Row 7
{0.629629630,0.629629630,1.259259259,1.888888889,3.148148148,5.037037037,8.185185185,13.22222222}, //Row 8
{1.018518519,1.018518519,2.037037037,3.055555556,5.092592593,8.148148148,13.24074074,21.38888889} //Row 9
} ;
#declare s2_cnt = 6 ;
#declare s2_ang = 360/s2_cnt ;
// L E V E L 0 0
//begin Spheriphor Level 0O
#declare j = 0 ;
#declare Spheriphor_00 =
union {
#while (j < s1_cnt)
//Multiple hemispheres arrayed radially internally to center hemisphere
object {
HemiSphere scale s1_rad
translate
rotate <0,j*s1_ang,0>
texture {
pigment { color SkyBlue }
}
finish { Rfinish }
no_shadow
}
//Hemispheres at the end of each radial halfpipe arm
object {
HemiSphere scale s1_rad
translate
rotate <0,j*s1_ang,0>
texture {
pigment { color Red }
}
finish { Rfinish }
no_shadow
}
//Radial halfpipe arms
object {
HalfPipe scale
translate
rotate <0,j*s1_ang,0>
texture {
pigment { color SkyBlue }
}
finish { Rfinish }
no_shadow
}
#declare j = j + 1 ;
#end
//Hemisphere at center of spheriphor
object { HemiSphere
scale s0_rad
texture {
pigment { color BrightGold }
}
finish { Rfinish }
no_shadow
}
} //end Spheriphor Level 00
//begin Grid Level 00
#declare Grid_00 =
union {
//Concentric hemispheres for gridline
#declare k = 1 ;
#declare Grid_cnt = 14 ;
#while (k < Grid_cnt)
#declare blue_no = (1/Grid_cnt)*(k) ;
#declare GreenTrans = color rgbf <0, 1, blue_no, trans_no> ;
object { HemiSphere
scale s0_rad+(k*5)
translate <0,-400,0>
texture {
pigment { color GreenTrans }
}
finish { Grid_finish }
no_shadow
}
#declare k = k + 1 ;
#end
} //end Grid Level 00
// L E V E L 0 1
//begin Spheriphor Level 01
#declare j = 0 ;
#declare Spheriphor_01 =
union {
#while (j < s1_cnt)
object {
Spheriphor_00 scale s2_val[j][7]/30
translate
rotate <0,j*s1_ang,0>
}
#declare j = j + 1 ;
#end
} //end Spheriphor Level 01
//begin Grid Level 01
#declare j = 0 ;
#declare Grid_01 =
union {
#while (j < s1_cnt)
object {
Grid_00 scale s2_val[j][7]/30
translate
rotate <0,j*s1_ang,0>
}
#declare j = j + 1 ;
#end
} //end Grid Level 01
// L E V E L 0 2
//begin Spheriphor Level 02
#declare j = 0 ;
#declare Spheriphor_02 =
union {
#while (j < s1_cnt)
object {
Spheriphor_01 scale s2_val[j][7]/30
translate
rotate <0,j*s1_ang,0>
}
#declare j = j + 1 ;
#end
} //end Spheriphor Level 02
//begin Grid Level 02
#declare j = 0 ;
#declare Grid_02 =
union {
#while (j < s1_cnt)
object {
Grid_01 scale s2_val[j][7]/30
translate
rotate <0,j*s1_ang,0>
}
#declare j = j + 1 ;
#end
} //end Grid Level 02
//Composite Levels 00, 01 and 02
#declare Spheriphor_Comp =
union {
object {
Spheriphor_00
}
object {
Grid_00
}
object {
Spheriphor_01
translate <0,s0_rad*1.1,0>
}
object {
Grid_01
}
object {
Spheriphor_02
translate <0,s0_rad*2.2,0>
}
object {
Grid_02
}
}
//Translate the final composite to be centered approximately on the origin
object {
Spheriphor_Comp
rotate <0,s1_ang,0>
translate <-30,0,0>
}
// B A C K G R O U N D
plane {
y,-600
texture {
pigment { color Yellow }
finish {
ambient 0.700
diffuse 0.600
specular 1.000
roughness 0.1
}
}
}
// L I G H T S
#declare Light_dist = 200 ;
light_source { <100,Light_dist,20>
color Gray70
spotlight
radius 35 falloff 40
fade_distance 180
point_at <-100,-Light_dist,-20>}
light_source { <-60,Light_dist,-60>
color Gray50
spotlight
radius 35 falloff 40
fade_distance 180
point_at <60,-Light_dist,60>}
light_source { <-80,Light_dist,80>
color White
spotlight
radius 35 falloff 40
fade_distance 180
point_at <80,-Light_dist,-80>}
// C A M E R A S
#declare Cam01 =
camera {
spherical
location <0,150,0>
look_at <0,0,0>
angle 60 60
up z
}
#declare Cam02 =
camera {
spherical
location <0,30,0>
look_at <0,0,0>
}
#declare Cam03 =
camera {
orthographic
location <0,150,0>
look_at <0,0,0>
right 1.33*x
angle 70
}
camera { Cam03 }
|