Rayshade provides basic animation animation support by allowing time-varying transformations to be associated with primitives and aggregate objects. Commands are provided for controlling the amount of time between each frame, the speed of the camera shutter, and the total number of frames to be rendered.
By default, rayshade renders a single frame, with the shutter open for an instant (0 units of time, in fact). The shutter speed in no way changes the light-gathering properties of the camera, i.e., frames rendered using a longer exposure will not appear brighter than those with a shorter exposure. The only change will be in the potential amount of movement that the frame ``sees'' during the time that the shutter is open.
Each ray cast by rayshade samples a particular moment in time. The time value assigned to a ray ranges from the starting time of the current frame to the starting time plus the amount of time the shutter is open. When a ray encounters an object or texture that possesses an animated transformation, the transformed entity is moved into whatever position is appropriate for the ray's current time value before intersection, shading, or texturing computations are performed.
The starting time of the current frame is computed using the length of each frame the current frame number, and the starting time of the first frame.
Variables may be defined through the use of the define keyword:
An animated transformation is one for which animated expressions have been used to define one or more of its parameters (e.g. the angle through which a rotation occurs). An animated expression is one that makes use of a time-varying (``animated'') variable or function.
There are two supported animated variables. The first, time, is equal to the current time. When a ray encounters an animated transformation defined using an expression containing time, the ray substitutes its time value into the expression before evaluation. Using the time variable in an animated expression is the most basic way to create blur-causing motion.
The second animated variable, frame, is equal to the current frame number. Unlike the time variable, frame takes on a single value for the duration of each frame. Thus, transforms animated through the use of the frame variable will not exhibit motion blurring.
Also supported is the linear function. This function uses time implicitly to interpolate between two values.
frames 5 shutter 1 sphere 1 0 0 2 translate 0 0 (-time)
Further examples of animation may be found in the Examples directory of the rayshade distribution.