CLOCK and CAMERA - Part 2 |
||
|
Example 4 The section deals with rotating the camera. Here we are orbiting a central point. This is much like the third animation in the first tutorial except that now the camera replaces the orbiting object.
camera { location <0.0, 2.0, -8.0>
rotate clock*y*360
}
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>} }
We've made a change to the location <0.0, 2.0, -8.0> directive by making x zero only to simplify things. This way we'll start our orbit with a head on view of the spheres. The big change since the last example is the removal of the translate directive which has been replaced by a rotate clock*y*360 directive. And again because we didn't give a look_at location our view defaults to right angles to our orbit point. Its pretty straight forward what's happening here. You can do this to any axis you choose. And of course there's no reason you have to make a complete orbit with this kind of motion. Just adjust the amount of degrees of rotation. You could also add a look_at or translate directive either clock driven or not to change your default viewpoint and/or orbit location. For instance using ...
{ location 0 rotate y*-22.5 rotate clock*y*45 translate z*-8}
... would first locate us at the center where we initially rotate our view -22.5 degress on the y axis and then add the rotate clock directive. After that we move the camera back so we can do the pan shot. I haven't provided an example because I assume you'll see what's happening here and/or try it yourself, plus we've got lots more to cover. Example 5 This example shows how to do a combined rotation. The idea here is to travel an arc from front to rear and ending up in the correct orientation.
camera { location <0.0, 0.0, -8.0>
rotate clock*z*180
rotate clock*x*180
}
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>} }
Again in order to keep things simple we've only given one location vector of location <0.0, 0.0, -8.0> to put us back along the z axis. You'll see there are two rotate directives with a clock this time. Because we're rotating in an overhead arc along the x axis with the rotate clock*x*180 directive our view would be upside down if we didn't first add a rotate clock*z*180 directive. So why use two directives instead of rotate <clock*180, 0 ,clock*180>. It has to do with the precendence POV-Ray gives to things. By using the second form you are applying rotation along the x axis first and the z axis second which is not the order you want things to happen in. Try it the wrong way around just to see what the results are. You don't end up where you expect! Example 6 The final example on this page is more complex and shows clock rotation on all three axis with a translate clock thrown in for good measure. There's a fair bit to look at first but if you're thinking precendence it'll make sense.
camera { location 0 rotate x*22.5
rotate clock*x*-22.5
translate z*-8.0
rotate clock*z*-180
rotate clock*x*180
translate y*8
translate clock*y*-7
}
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>} }
Here we start high and swoop down in an arc to almost ground level. There's a lot of directives this time. First off we locate the camera right at the center by giving a location 0 directive. The reason for this is we want to control where the camera looks by rotation rather than a look_at directive. Because this animation starts 8 units up and POV-Ray looks at right angles along the z axis the spheres won't be in frame at the start. So we point the camera down with a rotate x*22.5 directive in anticipation. And because we finish at almost ground level and want the camera looking dead ahead we give it our first clock directive of rotate clock*x*-22.5. Notice that the clock rotation is applied negative to the original rotation. Now we can move the camera to where we want it on the z axis with a translate z*-8.0 directive. At this point we apply the same two rotation directives as in the previous example, rotate clock*z*-180 and rotate clock*x*180, except this time I made the z axis rotation go in the opposite direction just to be different. And finally we come to the reason for the x axis rotation way back at location 0. A translate y*8 directive lifts us up (reason for original x rotation), and the last translate clock*y*-7 brings us down (reason for first clock driven x rotation). And there's no particular reason that we only came down seven units instead of eight. Just showing that things don't have to even out every time. Here's a zip of the POV and INI files for this tutorial: pov_an2b.zip In the part 3 of the Clock and Camera Tutorial we'll look at other ways to apply the clock to the camera beside location and orientation. Happy Animating! - Benjammin |
||
|
Copyright Ben Teschendorff 2004 |
||
|
00965 |
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
||
|
|
||
|
|
||