This statement builds a list of options that would return a maximum of ten models, include
simple detail, draw results from
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
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
For a list of all of the models found under a specified point, and detailed information about them,
see
modelsUnderLoc
Parameters
pointWithinSprite
pointWithinSprite
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,
404
Chapter 12: Methods
tModelList
modelUnderLoc
if there is no model found under the specified point.
void
.
Required. A point under which the first model is found. The location of
is relative to the upper left corner of the sprite, in pixels.
modelsUnderRay
, and have a maximum ray distance of 50:
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers