CLOCK and CAMERA - Part 1 |
||
|
Example 1 This tutorial is about working with the camera. The camera can be treated like any other object and may be moved or rotated around an axis. If you've read the GETTING TO KNOW THE CLOCK you'll know how to deal with the clock and INI files so I won't go over it again. Except to reiterate that in these examples the clock runs from 0 to 1 and cyclic animation may be set to on or off as needed. Now we'll just dive right in and give you an example with a simple move left to right along the x axis.
camera { location <-5.0, 2.0, -8.0>
translate clock*x*10
}
light_source { 0*x color rgb 1
translate <-30, 30, -30>
}
plane { y, -1 pigment {checker color rgb 1
color rgb <0.5,0.5,0.5>
scale 1.0}
}
sphere { -4.0*x, 1 pigment {color rgb <1,0,0>} }
sphere { 0.0, 1 pigment {color rgb <0,1,0>} }
sphere { 4.0*x, 1 pigment {color rgb <0,0,1>} }
When rendered as a 10 frame animation you get what you see in the GIF. This is one of the simplest motions you can do with the camera. We've only given it a location and a translate clock*x*10 directive. All other camera values are default. Because we didn't tell the camera where to look and we were back along the z axis our view defaults to looking at z*0 and remains at a right angle to it along the x and y axis. You could just as easily move along a different axis or have a translate with multiple clocks such as translate clock*x*10 translate clock*y*-1.5. Example 2 This next example shows how to view a fixed point while doing the same translate motion as in the previous exammple.
camera { location <-5.0, 2.0, -8.0>
translate clock*x*10
look_at <0.0, 0.0, 0.0>
}
light_source { 0*x color rgb 1
translate <-30, 30, -30>
}
plane { y, -1 pigment {checker color rgb 1
color rgb <0.5,0.5,0.5>
scale 1.0}
}
sphere { -4.0*x, 1 pigment {color rgb <1,0,0>} }
sphere { 0.0, 1 pigment {color rgb <0,1,0>} }
sphere { 4.0*x, 1 pigment {color rgb <0,0,1>} }
What we've done here is added a look_at <0.0, 0.0, 0.0> directive to keep our gaze fixed at POV-Ray's center of the universe. Now no matter where the camera is moved to it will always look at the same place. Notice how the middle sphere stays centered. You can choose any coordinates to look at that you'd like, it doesn't have to be xyz*0. Example 3 The final example on this page shows how to change where you're looking at while keeping the same translate motion as before.
camera { location <-5.0, 2.0, -8.0>
translate clock*x*10
look_at <2.0-(clock*4), 0.0, 0.0>
}
light_source { 0*x color rgb 1 translate <-30, 30, -30> }
plane { y, -1 pigment {checker color rgb 1
color rgb <0.5,0.5,0.5>
scale 1.0}
}
sphere { -4.0*x, 1 pigment {color rgb <1,0,0>} }
sphere { 0.0, 1 pigment {color rgb <0,1,0>} }
sphere { 4.0*x, 1 pigment {color rgb <0,0,1>} }
What we've done here is changed the look_at directive to read look_at <2.0-(clock*4), 0.0, 0.0>. We start by looking 2 units to the right and end looking 2 units to the left. So we give look_at an initial x value of 2 and subtract clock*4 to end up with a final value of -2. Notice that the middle sphere now moves a bit from left to right while the outer spheres move partially off frame (okay I could've made a more dramatic example). You could of course change the directive to read look_at <-2.0+(clock*4), 0.0, 0.0> by giving a negative value to x and a positive one to the clock*4 value. Or keep all the values positive/negative. As always the best thing to do is experiment. And here's a zip of the POV and INI files for this tutorial: pov_an2a.zip In Part 2 of the Clock and Camera Tutorial we'll look at using rotation. Happy Animating! - Benjammin |
||
|
Copyright Ben Teschendorff 2004 |
||
|
01551 |
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
||
|
|
||
|
|
||