/* The creates a camera + lens Render modes 0 - orthographic, look at dome 1 - fisheye, look away from dome The following must be declared in the main scene file The up vector MUST be perpendicular to the view direction eg: #declare MODE = 0; #declare VP = <1,0,0>; /* Camera position */ #declare VD = <1,0,0>; /* View direction vector */ #declare VU = <0,0,1>; /* Up vector */ */ /* Create unit vectors */ #declare UVD = vnormalize(VD); #declare UVU = vnormalize(VU); #declare UVR = vnormalize(vcross(VU,VD)); #declare SCALEFACTOR = 0.1; #switch (MODE) #case (0) /* Pure black object */ #declare blocker = texture { pigment { color rgb <0,0,0> } finish { ambient 0 diffuse 0 reflection 0 } } /* Perfectly reflecting lens */ #declare mirror = texture { pigment { color rgb <1,1,1> } finish { ambient 0 diffuse 0 reflection 1 } } mesh { /* Back blocking sheet */ triangle { <0,-1,-1>, <0,-1,1>, <0,1,1> texture { blocker } } triangle { <0,1,1>, <0,1,-1>, <0,-1,-1> texture { blocker } } /* Lens */ #include "lens.inc" /* Transform to camera coordinate system */ scale translate <-0.41,0,0> matrix } camera { orthographic location VP up SCALEFACTOR*2*y right -SCALEFACTOR*2*x sky VU look_at VP - UVD } #break; #case (1) camera { fisheye location VP up y right x angle 180 sky VU look_at VP + UVD } #break; #end