404
Chapter 12: Methods
This statement builds a list of options that would return a maximum of ten models, include
simple detail, draw results from
tModelList
, and have a maximum ray distance of 50:
tOptionsList = [#maxNumberOfModels: 10, #levelOfDetail: #simple, #modelList:
tModelList, #maxDistance: 50]
After the option list is built, this statement includes it under a ray drawn from the position vector
(0, 0, 300) and pointing down the -z axis:
put member("3d").modelsUnderRay(vector(0, 0, 300), vector(0, 0, -\
1), tOptionsList)
See also
modelsUnderLoc
,
modelUnderLoc
modelUnderLoc
Usage
member(
whichCastmember
).camera(
whichCamera
).\
modelUnderLoc(
pointWithinSprite
)
Description
3D command; returns a reference to the first model found under a specified point within the rect
of a sprite using the referenced camera.
This command returns
void
if there is no model found under the specified point.
For a list of all of the models found under a specified point, and detailed information about them,
see
modelsUnderLoc
.
Parameters
pointWithinSprite
Required. A point under which the first model is found. The location of
pointWithinSprite
is relative to the upper left corner of the sprite, in pixels.
Example
The first line in this handler translates the location of the cursor from a point on the Stage to a
point within sprite 5. The second line determines the first model under that point. The third line
displays the result in the message window.
-- Lingo syntax
on mouseUp
pt = the mouseLoc - point(sprite(5).left, sprite(5).top)
m = sprite(5).camera.modelUnderLoc(pt)
put m
end
// JavaScript syntax
function mouseUp() {
pt = _mouse.mouseLoc - point(sprite(5).left, sprite(5).top);
m = sprite(5).camera.modelUnderLoc(pt);
put(m);
}
See also
modelsUnderLoc
,
modelsUnderRay
Содержание 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...