Adobe 65036570 - Director - PC User Manual page 392

User guide
Hide thumbs Also See for 65036570 - Director - PC:
Table of Contents

Advertisement

Selecting models
Selecting models (picking) refers to clicking on models in a 3D cast member. Because models are objects that exist
within a 3D cast member and a 3D sprite, they are not normally sensitive to mouse clicks. Normally, only the entire
sprite is sensitive to mouse clicks.
You can use scripts to determine specifically which models have been clicked within a 3D sprite. In practice, this
allows for changing model positions to make it appear that an action such as a button being pushed or a door being
opened has taken place, or to allow the user to select or drag an object. Picking can be accomplished by using cast
member or camera methods.
Camera methods
The following camera methods let you determine which models have been clicked within a 3D sprite. You can also
translate coordinates in 3D space to coordinates in 2D sprite space and vice versa.
Method
Description
Returns the 2D sprite-space coordinates of a point from a 3D world
worldSpaceTo
vector.
SpriteSpace
(vector)
The opposite of the
spriteSpaceTo
WorldSpace
(vector)
camera's projection plane from a sprite-space point.
(point)
Multiple world-space positions can map to the same sprite-space
point. A round-trip
y=worldSpaceToSpriteSpace(x)
z=worldSpaceToSpriteSpace(y)
won't necessarily result in
Returns the first model intersected by a ray from a location
modelUnder
within the
Loc(point)
is relative to the upper-left corner of the sprite, in pixels. The ray is
cast forward in the direction the camera is looking.
This method is useful for picking in conjunction with an
onMouseDown
left corner of the sprite's
Returns a list of all models intersected by a ray from a location
modelsUnder
Loc(point,
point
optionalMax
point
ray is cast forward in the direction the camera is looking.
NumberOf
Models)
This method is useful for picking in conjunction with an
onMouseDown
left corner of the sprite's
worldSpaceToSpriteSpace
, this method returns a world-space vector on the
.
x=z
of the sprite using this camera. The location
rect
handler. For accuracy, be sure to subtract the upper-
from the
loc
mouseLoc
within the
of the sprite using this camera. The location
rect
is relative to the upper-left corner of the sprite, in pixels. The
handler. For accuracy, be sure to subtract the upper-
from the
loc
mouseLoc
Returns
A point.
A vector.
The first model inter-
point
sected by the ray.
point
A value of
void
there is no model under
the ray.
.
The first model inter-
sected by the ray or a list
of up to the specified
maximum.
If no maximum is speci-
fied, the method
.
returns all models under
the ray.
A value of
void
there is no model under
the ray.
ADOBE DIRECTOR 11.0
User Guide
means
means
381

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents