//Brian Vincent //Hyperboloid //Files with predefined colors and textures #include "colors.inc" #include "glass.inc" #include "golds.inc" #include "metals.inc" #include "stones.inc" #include "woods.inc" //Place the camera camera { sky <0,0,1> //Don't change this direction <-1,0,0> //Don't change this right <-4/3,0,0> //Don't change this location <15,15,5> //Camera location look_at <0,0,0> //Where camera is pointing angle 25 //Angle of the view } //Ambient light to "brighten up" darker pictures global_settings { ambient_light White } global_settings { max_trace_level 10 } //Place a light light_source { <10,0,0> color White*2 } light_source { <0,0,10> color White } light_source { <0,10,0> color White*2 } plane{<0,0,-1>,7 texture {T_Silver_3A}} //Set a background color background { color White } //Create the array to collect the projected points #declare b = 128; #declare q = array[b]; #declare p = array[b]; #declare s = array[b]; #declare o = array[b]; #declare r=.01; #declare d = 2; #declare a = 1.5; #declare i=0; #declare j=0; #while(i; #declare p[i]= < a*(cos(j)+sin(j)), a*(sin(j)-cos(j)),-d>; #declare s[i]= < a*(cos(j)+sin(j)), a*(sin(j)-cos(j)), d>; #declare o[i]= < a*(cos(j)-sin(j)), a*(sin(j)+cos(j)),-d>; cylinder { q[i], p[i], r texture {T_Copper_1A}} cylinder { s[i], o[i], r texture {T_Gold_1A}} #declare j=j+(2*pi)/b; #declare i=i+1; #end // flat circular FINITE (no CSG) shape, center hole cutout is optional disc { <0, 0, d> // center position z, // normal vector sqrt(2*(a*a)), a-0.001 texture {T_Silver_1A} } disc { <0, 0, -d> // center position z, // normal vector sqrt(2*(a*a)), a-0.001 texture {T_Silver_1A} }