3D Lingo Dictionary > O-S > pointAt |
![]() ![]() ![]() |
pointAt
Syntax
member(
whichCastmember
).model(
whichModel
).pointAt(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).camera(
whichCamera
).pointAt(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).light(
whichLight
).pointAt(
vectorPosition
{,
vectorUp
})
member(
whichCastmember
).group(
whichGroup
).pointAt(
vectorPosition
{,
vectorUp
})
Description
3D command; rotates the referenced object so that its forward direction vector points at the world relative position specified by vectorPosition
, then it rotates the referenced object to point it's up direction vector in the direction hinted at by the world relative vector specified by vectorUp
.
The optional parameter vectorUp
is a world relative vector that hints at where the object's up vector should point. If this parameter isn't specified, then this command defaults to using the world's y axis as the up hinting vector. If you attempt to point the object at a position such that the object's forward vector is parallel to the world's y axis, then the world's x axis is used as the up hinting vector.
The direction at which you wish to point the object's forward direction and the direction specified by vectorUp
do not need to be perpendicular to each other being as this command only uses the vectorUp
parameter as a hinting vector.
The object's front and up direction vectors are defined by the object's pointAtOrientation
property.
Example
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))
See also
![]() ![]() ![]() |