Optional. A list of model references that are included if they are found under the
modelList
specified ray. Model references not included in this list are ignored, even if they are under the
specified ray. Use the model references, not the string names of the models. Specify each model
you want to include. Adding a parent model reference does not automatically include its child
model references.
Example
This statement creates a list of ten models:
tModelList = [member("3D").model("foo"),member("3D").model[10]]
This statement builds a list of options that would return a maximum of ten models, include
simple detail, and draw results from
tOptionsList = [#maxNumberOfModels: 10, #levelOfDetail: #simple, #modelList:
tModelList]
After the options list is built, 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 uses the
command to obtain the first three models found under that point. The third line displays the
returned information about the models in the message window.
-- Lingo syntax
on mouseUp
pt = the mouseLoc - point(sprite(5).left, sprite(5).top)
m = sprite(5).camera.modelsUnderLoc(pt, tOptionsList)
put m
end
// JavaScript syntax
function mouseUp() {
pt = _mouse.mouseLoc - point(sprite(5).left, sprite(5).top);
m = sprite(5).camera.modelsUnderLoc(pt, tOptionsList);
put(m);
}
See also
modelsUnderRay,
modelsUnderRay
Usage
member(whichCastmember).modelsUnderRay(locationVector, directionVector,
optionsList)
Description
3D command; returns a list of models found under a ray drawn from a specified position and
pointing in a specified direction, with both vectors being specified in world-relative coordinates.
The list of models can also be compared to a set of optional parameters before being returned.
Within the returned list, the first model listed is the one closest to the position specified by
locationVector
Only one intersection (the closest intersection) is returned per model.
The command returns an empty list if there are no models found under the specified ray.
402
Chapter 12: Methods
tModelList
modelUnderLoc
and the last model listed is the furthest from that position.
:
modelsUnderLoc
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