487
Examples
This example points three objects at the model named Mars: the camera named MarsCam, the
light named BrightSpot, and the model named BigGun:
thisWorldPosn = member(“Scene”).model(“Mars”).worldPosition
member("Scene").camera("MarsCam").pointAt(thisWorldPosn)
member("Scene").light("BrightSpot").pointAt(thisWorldPosn)
member("Scene").model("BigGun").pointAt(thisWorldPosn, \
vector(0,0,45))
If you use non-uniform scaling and a custom
pointAtOrientation
on the same node, e.g., a
model, using
pointAt
will likely cause unexpected non-uniform scaling. This is due to the order
in which the non-uniform scaling and the rotation to properly orient the node are applied. To
workaround this issue, do one of the following:
•
Avoid using non-uniform scaling and non-default
pointAtOrientation
together on the
same node.
•
Remove your scale prior to using
pointAt
, and then reapply it afterwards.
For example:
scale = node.transform.scale
node.scale = vector( 1, 1, 1 )
node.pointAt(vector(0, 0, 0)) -- non-default pointAtOrientation
node.transform.scale = scale
See also
pointAtOrientation
pointAtOrientation
Syntax
member(
whichCastmember
).model(
whichModel
).pointAtOrientation
member(
whichCastmember
).group(
whichGroup
).pointAtOrientation
member(
whichCastmember
).light(
whichLight
).pointAtOrientation
member(
whichCastmember
).camera(
whichCamera
).pointAtOrientation
Description
3D model, light, group and camera property; allows you to get or set how the referenced object
responds to the
pointAt
command. This property is a linear list of two object-relative vectors, the
first vector in the list defines which direction is considered the object’s front direction, the second
defines which direction is considered the object’s up direction.
The object’s front and up directions do not need to be perpendicular to each other, but they
should not be parallel to each other.
Example
This statement displays the object-relative front direction and up direction vectors of the model
named bip01:
put member("scene").model("bip01").pointAtOrientation
-- [vector(0.0000, 0.0000, 1.0000), vector(0.0000, 1.0000, 0.0000)]
See also
pointAt
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...