CLOCK and CAMERA - Part 3 |
||
|
Example 7 A basic zoom lens effect.
camera { location z*-8
angle 120-(clock*100)
}
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 place ourselves at location z*-8 and use the default viewpoint. This time we've given an angle 120-(clock*100) directive to create our action. As a refresher remember the bigger the number for angle the wider the view, opposite of the way we're used to interpreting the lens value with a real camera. So what's happening is the initial angle is a fairly wide 120 and over the course of the animation it zooms to a much tighter angle of 20 (by the time the clock reaches 1 you've subtracted 100 from the initial angle value). Example 8 This example adds a simple translate.
camera { location z*-8
angle 120-(clock*100)
translate clock*z*-22
}
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>} }
As well as the angle 120-(clock*100) directive from the previous example we've added translate clock*z*-22 to move us back while we're zooming in. Not bad but for the first couple of frames the spheres don't seem to be getting bigger and almost appear to be sliding a bit. And then there's a big rush towards the end, alright if that's the effect you want. Example 9 The final example on this page shows a different way to work the wide to zoom lens with translate idea.
camera { location z*-8
translate clock*z*-22
direction z*(1+(clock*22/8))
}
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 instead of using an angle directive we're using direction z*(1+(clock*22/8)). If we used direction z*1 we get the basic default viewing angle. Because we're doing clock driven things extra math goes into the equation to create the effect of the spheres remaining the same size while the foreground and background are zoomed into frame. So in order to start with a sane viewing angle we always give the directive a value greater than 0 , in our case we used 1 for the default angle and to keep things simple. The animation is driven by adding the result of (clock*22/8) to 1. And as you probably can see, the ratio 22/8 has the same numbers as translate divided by the start location. An equal percentage of translate and direction are applied with the net result being whatever's in the middle appears to stay put. Plugging other numbers into the clock driven direction directive will change the relationship between the objects relative size in frame at start/end. As always I encourage you to experiment. And I'll have to confess that my "math solution" is a stab in the dark guess, hopefully it'll stand up under scrutiny. And here's a zip of the POV and INI files for this tutorial: pov_an2c.zip In the part 4 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 |
||
|
00873 |
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
||
|
|
||
|
|
||