Animation

<#988#><#2071#>Rayshade<#2071#><#988#> 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, <#989#><#2073#>rayshade<#2073#><#989#> 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 <#990#><#2075#>rayshade<#2075#><#990#> 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.

<#5121#><#5121#>
<#1677#>shutter<#1677#> <#1678#>t<#1678#>
Specifies that the shutter is open for t units of time for each exposure.
A larger value of <#995#>t<#995#> will lead to more motion blur in the final image. Note that <#996#>t<#996#> may be greater than the actual length of a frame. By default, <#997#>t<#997#> is zero, which prevents all motion blur.

<#5122#><#5122#>
<#1681#>framelength<#1681#> <#1682#>frameinc<#1682#>
Specifies the time increment between frames.
The default time between frames is 1 unit.

<#5123#><#5123#>
<#1685#>starttime<#1685#> <#1686#>time<#1686#>
Specifies the starting time of the first frame.
By default, <#1006#>time<#1006#> is zero.

Variables may be defined thorugh the use of the <#1007#>define<#1007#> keyword:

<#5124#><#5124#>
<#1689#>define<#1689#> <#1690#>name value<#1690#>
Associate <#1011#>name<#1011#> with the given <#1012#>value<#1012#>. Value may be a constant or a parenthesized expression.
The variable <#1014#>name<#1014#> may thereafter be used in expressions in the input file.

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, <#1015#>time<#1015#>, is equal to the current time. When a ray encounters an animated transformation defined using an expression containing <#1016#>time<#1016#>, the ray substitutes its time value into the expression before evaluation. Using the <#1017#>time<#1017#> variable in an animated expression is the most basic way to create blur-causing motion.

The second animated variable, <#1018#>frame<#1018#>, is equal to the current frame number. Unlike the <#1019#>time<#1019#> variable, <#1020#>frame<#1020#> takes on a single value for the duration of each frame. Thus, transforms animated through the use of the <#1021#>frame<#1021#> variable will not exhibit motion blurring.

Also supported is the <#1022#>linear<#1022#> function. This function uses <#1023#>time<#1023#> implicitly to interplate between two values.

<#5125#><#5125#>
<#1693#>linear<#1693#> <#1694#>(<#1694#> <#1695#>Stime, Sval, Etime, Eval<#1695#> <#1696#>)<#1696#>
Linearly interpolate between <#1029#>Sval<#1029#> at time <#1030#>Stime<#1030#> and <#1031#>Eval<#1031#> at time <#1032#>Etime<#1032#>. If the current time is less than <#1033#>Stime<#1033#>, the function returns <#1034#>Sval<#1034#>. If the current time is greater than <#1035#>Etime<#1035#>, <#1036#>Eval<#1036#> is returned.

The following example shows the use of the <#1038#>time<#1038#> variable to animate a sphere by translating it downwards over five frames. Note thet the <#1039#>shutter<#1039#> keyword is used to set the shutter duration in order to induce motion blurring.

verbatim45#

Further examples of animation may be found in the Examples directory of the <#1042#><#2077#>rayshade<#2077#><#1042#> distribution.