// Oliver Knill, written around 2002 for Math 21a camera { location <0,3,-4> look_at <0,0.8,-1> up <0,1,0> right <(16/9)*1,0,0>} light_source { <2, 4, -3> color rgb<1,1,1>} light_source { <20, 14, -10> color rgb<1,1,1>} background{rgb<1,1,1>} #macro r(c) pigment{ rgb c } finish { phong 1.0 ambient 0.5 diffuse 0.5 } #end #declare phinumber=23; #declare thetanumber=31; #declare ai=1.0*180/phinumber; #declare aj=360/thetanumber; #declare schale = difference{ sphere { <0,0,0>, 2 texture { pigment {image_map {png "earth.png" map_type 1 interpolate 2} } finish {ambient 0.3 diffuse 1} } } sphere { <0,0,0>, 1.95 texture { r(<0,1,0>)} } rotate -y*180 } #macro wedge(theta1,theta2) #local A = theta2-theta1; #local B = theta1; #if(A < 180) difference { plane {-x, 0} plane {-x, 0 rotate y*A} rotate y*B } #else #if(A = 180) plane {-x, 0 rotate y*A} #else intersection { plane {x, 0} plane {-x, 0 rotate y*A} inverse rotate y*B } #end #end #end #macro phisegment(phi1,phi2) #if (phi1<90 & phi2<90) difference { cone { <0,0,0>,0 <0,3,0>, 3*tan(phi2*pi/180) } cone { <0,0,0>,0 <0,4,0>, 4*tan(phi1*pi/180) } } #end #if (phi1>90 & phi2>90) difference { cone { <0,0,0>,0 <0,3,0>, 3*tan((180-phi1)*pi/180) } cone { <0,0,0>,0 <0,4,0>, 4*tan((180-phi2)*pi/180) } rotate x*180 } #end #if (phi1<90 & phi2>90) difference { cone { <0,0,0>,0 <0,3,0>, 3*tan(phi1*pi/180) inverse } cone { <0,0,0>,0 <0,4,0>, 4*tan((180-phi2)*pi/180) rotate x*180 } } #end #end #declare world = union{ #declare i=1; #while (i)} } object{ phisegment(pphi1,pphi2) texture { r(<1,0.5,0>)} } } #declare j=j+1; #end #declare i=i+1; #end } #object {world rotate y*360*clock}