CLOCK MODIFIER INCLUDE FILE for Persistence of Vision 3.x |
Created by Chris Colefax, 24 June 1997
Updated 7 August 1998: updated for POV-Ray 3.1
USING THE CLOCK MODIFICATION PREVIEW
COPYRIGHT AND LEGAL INFORMATION
INSTALLATION |
C:\Program Files\POV-Ray for Windows\Include
On UNIX and similar systems, where filenames are case-sensitive, you may have to rename the include files so the capitals and lowercase are as shown above. This will enable you to render the sample files without modification.
QUICK START |
#declare clock_type = "Wave"
#include "ClockMod.inc"
In addition there are a variety of other options than can be used to modify and combine different clock types. To use any of these just add the following line to your scene file, before including ClockMod.inc:
#declare
[variable-name] =
[value]
substituting the desired variable name and value where appropriate.
The Clock Modifier include file will then create a new variable, mclock
,
that can be used to scale, rotate, and translate objects, as well as
alter their pigments and other attributes, eg:
object {MyObject
#declare clock_type = "Bounce"
translate y * mclock * 10}
Note that ClockMod.inc should never be included at the start of a scene (like colors.inc or textures.inc). It should only be included after declaring the desired clock type and options. To use the Clock Modifier more than once in a scene, you should declare the first set of options and include ClockMod.inc. Then declare the next set of options and include ClockMod.inc again.
CLOCK TYPES |
#declare clock_type = "O"
rather than #declare clock_type = "Oscillation"
. You can preview all of
the available clock types by rendering the Preview.pov scene.
CLOCK MODIFICATION OPTIONS |
#declare clock_start = 0
#declare clock_finish = 100
You can also use these variables to make a particular modification occupy only part of a scene, eg:
#declare clock_type = "Accelerate"
#declare clock_start = .7
will only start accelerating 70% of the way through the animation.
#declare clock_type = "Recoil"
#declare clock_repeat = 10
could be used to make a cannon fire 10 times.
#declare clock_type = "Jump"
#declare clock_strength = 2
will make the jumping motion more apparent.
#declare clock_type = "Wave"
#declare clock_repeat = 10
will give 10 waves, each taking the same length of time. If you wanted the waves to get quicker as time passed, you could combine the above with an Accelerate, eg:
#declare clock_combine = "Accelerate"
The Combine.pov scene shows how this option works. Note that if you using the Clock Modification include file more than once in a scene, and you have used clock_combine once but don't want to use it again, you should declare it as "", eg:
#declare clock_combine = ""#declare clock_type = "Wave" #declare clock_combine = "Accelerate"
#include "ClockMod.inc"
USING THE CLOCK MODIFICATION PREVIEW |
mclock
variable. You
use achieve this using the ClockP.inc file; first declare the desired
clock options, and then include the ClockP.inc file (do not include the
ClockMod.inc file), eg:
#declare clock_type = "Recoil" #declare clock_repeat = 3
#declare clock_combine = "Decelerate" #declare clock_strength = 2
#include "ClockP.inc"
No other cameras, lights, or objects are necessary, though the following options can be used to control the clock preview.
USING THE mclock VARIABLE |
mclock
variable to modify different objects in a variety of ways.
Note that if you are using POV-Ray 3.1 or later, you will probably want to use the Automatic Clock Modifier Macro File, which eliminates the need to perform the tasks described below.
object {MyObject translate <10, 10, -10>}
This will move the specified object 10 units along the x-axis, 10 units up the y-axis, and -10 units along the z-axis. If you wanted to animate the object so that it started at its current position, and then accelerated to its new position, you would use:
object {MyObject
#declare clock_type = "Accelerate"
#include "ClockMod.inc"
translate <10, 10, -10> * mclock}
Note that you can add translations together, so you can first create your object at the origin, then animate it, and finally move it into the correct position, eg:
sphere {<0, 0, 0>, 1
pigment {color Red}
#declare clock_type = "Bounce"
#include "ClockMod.inc"
translate y * mclock * 5
translate <10, 1, 20>}
This will create a red sphere that bounces 5 units high (up the y-axis), and bounces on the spot located at <10, 1, 20>.
mclock
with rotate and scale in the same way as with
translate, eg:
#declare clock_type = "Oscillate"
object {MyObject
#declare clock_type = "Jump"
#include "ClockMod.inc"
scale mclock * 2
#include "ClockMod.inc"
rotate y * 50 * mclock}
This will make the object pulsate between its normal size and double its size, and also rotate back and forth 50 degrees around the y-axis.
mclock
variable
with any POV-Ray attribute that requires a number. An example of this is
pigments, eg. to make a flashing blue light:
light_source {<10, 30, -20>
#declare clock_type = "Wave"
#declare clock_repeat = 20
#include "ClockMod.inc"
color Blue * mclock}
The mclock
variable can also be used in the pigment, normal and finish
statements of objects, as well as when animating camera angles, etc.
Often you will want to go from one value to another, eg. changing an
object from Red to Green. To do this, use the following commands:
#declare clock_type = "S-Curve"
#include "ClockMod.inc"
pigment {Red + mclock * (Green - Red)}
As you can see, you start with the first value, and then add mclock
multiplied by the different between the two values (which is always the
second value take away the first value). If you wanted to make an object
become less reflective during an animation, you could use:
#declare clock_type = "Decelerate"
#include "ClockMod.inc"
finish {reflection .8 + mclock * (.2 - .8)}
This will change the reflection from 0.8 at the start of the animation, down to 0.2 at the end.
COPYRIGHT AND LEGAL INFORMATION |
The Clock Modifier Include File may be bundled with or without other software on CD-ROM collections, Bulletin Board systems and other file archives, providing that all associated files, including documentation and samples, are included. I would also request that persons intending to distribute the Clock Modifier Include File in this manner or otherwise would first contact me to ensure that they are in possession of the latest available version.
Further, no restrictions of any sort are placed on the usage of the include files themselves (ClockMod.inc and ClockP.inc), and scene files or images created using the include files remain entirely the property of the user or users who have created them. I claim no liability or responsibility for damages or loss resulting from usage of the include files, or any part of the include file package.
CONTACTING THE AUTHOR |
or by regular mail at: