
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; modifies
transform1
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()
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...