User Guide

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