/* Include file for creating stereo panoramics. Creates the camera definition. Conforms to assuptions made in my stereo capable panoramic viewer. The following variables must be declared CENTER - the position of the camera if one wasn't doing panoramics FOCAL - the zero parallax distance of the stereo camera EYE - the eye being rendered, 0 for center, 1 for left, 2 for right VANGLE - the vertical angle in degrees, eg : 90, 120, <180 */ #declare METHOD = 1; /* 0 for parallel, 1 for toein */ #declare THETA1 = radians(clock); #declare THETA2 = radians(clock+180); #declare EYESEP = FOCAL / 25; /* Safe stereo */ /* Calculate the position of the eye on the rim of the rotating ring In the center for non stereo */ #if (EYE = 1) /* Left */ #declare VP = CENTER + <0.5*EYESEP*cos(THETA2),0,0.5*EYESEP*sin(-THETA2)>; #else #if (EYE = 2) /* Right */ #declare VP = CENTER + <0.5*EYESEP*cos(THETA1),0,0.5*EYESEP*sin(-THETA1)>; #else /* Center */ #declare VP = CENTER; #declare EYESEP = 0; #end #end /* Direction vector rotates clockwise Order of strips in final image is left to right Assumes that y is the up vector */ #declare DIR = ; #if (METHOD = 1) /* Toe in */ #declare VD = vnormalize(CENTER + FOCAL * DIR - VP); #else /* Parallel */ #declare VD = DIR; #end camera { perspective location VP up y right x/VANGLE /* Must match width and height ratio */ angle 1 sky <0,1,0> look_at VP + VD }