The POV-Ray Cyclopedia

Bruce MacKay (bmackay@hevanet.com) posted a question about the sky vector for camera definitions. Here is a simple demonstration of the sky vector.

play ground Step 1
Creating the scene
Here is the scene we are going to work with. The red cylinder lies along the x axis. The purple cylinder lies along the z axis and the checkers are 1 unit in size. We also see a yello sphere, a cyan torus, and a white cone. We need something to look at. We are going to look at teh yellow sphere through a camera with and without altering the sky vector.
Step 2
Adding the camera
Now we add the camera at <4,2,-1> and it points in the positive z direction.This camera has a green cylinder running through the location parallel to y axis, a red cylinder running through the location parallel to the x axis, and the blue cylinder runs through the location parallel to the z axis. The orange cylinder define the camera's location a bit more clearly.
Step 3
Panning the camera
Now we rotate the camera along the y axis until it aims at the target location. By adding a thin line we can see where the look_at vector is aiming, and we've added a line going straight up from the target. Now the camera has panned, and is line with the target.
Step 4
Tilting the camera
Now the camera is rotated around it's x axis until is tilts at the right able to be in alignment with the target.
Step 5
Using the camera
Here is the view from the camera itself. The horizon is level in the background.
Step 6
Setting up the sky
Now we adjust for the sky vector. for this example the sky vector is <-0.25,1,0>. The cyan cylinder coming out of the yellow sphere is parall with the sky vector. THe camera is back in it's original position with out any effect, so it points harmlessly into the +z.
Step 7
Rolling the camera
Now roll the camera along the z axis until it is parallel with the sky vector. The Green cylinder on the camera is it's local y axis, and is now parallel.
Step 8
Rolling the camera take two
Since Step 7 doesn't show this clearly, here is a view with an orthogonal camera. Note that the camera's local x axis is no longer parallel to the real x axis.
Step 9
Panning the camera
Now the camera rolls around it's own y axis, which is parallel with the sky vector, until it is in alignment with the target.
Step 10
Tilting the camera
Now the camera rolls along it's own x axis, which is perpindicular to the sky vector, until it is is aimed directly at the target.
Step 11
Using the new camera
The final view... notice that cylinder coming form the yellow sphere appears to be straight up and down while the horizon is slanted.
Send feedback, or head back to the Cyclopedia.

Thanks for watching.