Camera methods
These camera methods let you determine which models have been clicked when a user clicks the
mouse within a 3D sprite. You can also translate coordinates in 3D space to coordinates in 2D
sprite space and vice versa.
Method
worldSpaceTo
SpriteSpace
(vector)
spriteSpaceTo
WorldSpace
(point)
modelUnder
Loc(point)
modelsUnder
Loc(point,
optionalMax
NumberOf
Models)
modelsUnder
Ray(location
Vector,
direction
Vector,
optionalMax
NumberOf
Models)
396
Chapter 17: Controlling the 3D World
Description
Returns the 2D sprite-space coordinates of a point from
a 3D world vector.
The opposite of the
worldSpaceToSpriteSpace
, this method returns a world-space vector on
(vector)
the camera's projection plane from a sprite-space 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
within the
point
camera. The location
point
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
handler. For accuracy, be sure to subtract
onMouseDown
the upper left corner of the sprite's
.
mouseLoc
Returns a list of all models intersected by a ray from a
location
within the
point
camera. The location
point
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
handler. For accuracy, be sure to subtract
onMouseDown
the upper left corner of the sprite's
.
mouseLoc
Returns a list of models under the ray starting at the
vector
locationVector
, with both vectors specified in world-
directionVector
relative coordinates.
.
x=z
of the sprite using this
rect
is relative to the upper left
from the
loc
of the sprite using this
rect
is relative to the upper left
from the
loc
and pointing down the vector
Returns
A point.
A vector.
The first model
intersected by the ray.
A value of
means
void
there is no model
under the ray.
The first model
intersected by the ray
or a list of up to the
specified maximum.
If no maximum is
specified, the method
returns all models
under the ray.
A value of void
means there is no
model under the ray.
The first model
intersected by the ray
plus a list of up to the
specified maximum
number of models.
If the maximum
number of models
isn't specified, all
models the ray
intersects are
returned.
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?
Questions and answers