User Guide

372 Chapter 12: Methods
interpolate()
Usage
transform1.interpolate(transform2,percentage)
Description
3D transform method; returns a copy of transform1 created by interpolating from the position
and rotation of
transform1 to the position and rotation of transform2 by the specified
percentage. The original
transform1 is not affected. To interpolate transform1, use
interpolateTo().
To interpolate by hand, multiply the difference of two numbers by the percentage. For example,
interpolation from 4 to 8 by 50 percent yields 6.
Example
In this example, tBox is the transform of the model named Box, and tSphere is the transform of
the model named Sphere. The third line of the example interpolates a copy of the transform of
Box halfway to the transform of Sphere.
tBox = member("3d world").model("Box").transform
tSphere = member("3d world").model("Sphere").transform
tNew = tBox.interpolate(tSphere, 50)
See also
interpolateTo()
interpolateTo()
Usage
transform1.interpolateTo(transform2, percentage)
Description
3D transform method; modifiestransform1 by interpolating from the position and rotation
of
transform1 to the position and rotation of a new transform by a specified percentage. The
original
transform1 is changed. To interpolate a copy of transform1, use the interpolate()
function.
To interpolate by hand, multiply the difference of two numbers by the percentage. For example,
interpolation from 4 to 8 by 50 percent yields 6.
Parameters
transform2
Required. Specifies the transform to which a given transform is interpolated.
percentage Required. Specifies the rotation percentage of transform2.
Example
In this example, tBox is the transform of the model named Box, and tSphere is the transform of
the model named Sphere. The third line of the example interpolates the transform of Box halfway
to the transform of Sphere.
tBox = member("3d world").model("Box").transform
tSphere = member("3d world").model("Sphere").transform
tBox.interpolateTo(tSphere, 50)
See also
interpolate()