3D Lingo Dictionary > E-K > interpolateTo()

 

interpolateTo()

Syntax

transform1.interpolateTo(transform2, percentage)

Description

3D transform method; modifiestransform1 by interpolating from the position and rotation of transform1 to the position and rotation of transform2 by the specified percentage. The original transform1 is changed. To interpolate a copy of transform1, use interpolate().

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 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()