newModelResource
425
newModelResource
Usage
member(
whichCastmember
).newModelResource(
newModelResourceName
\
{ ,
#type, #facing
})
Description
3D command; creates a new model resource, optionally of a give type and facing, and adds it to
the model resource palette.
If you do not choose to specify the
facing
parameter and specify
#box
,
#sphere
,
#particle
or
#cylinder
for the
type
parameter, only the front faces are generated. If you specify
#plane
, both
the front and back faces are generated. Model resources of the type
#plane
have two meshes
generated (one for each side), and consequently has two shaders in the
shaderList
.
A facing of
#both
creates the double amount of meshes and consequently produces double the
number of shader entries in the
shaderList
. There will be 2 for planes and spheres (for the inside
and outside of the model respectively), 12 for cubes (6 on the outside, 6 on the inside), and 6 for
cylinders (top, hull and bottom outside, and another set for the inside).
Parameters
newModelResourceName
Required. Specifies the name of the new model resource.
type
Optional. Specifies the primitive type of the new model resource. Valid values are as follows:
•
#plane
•
#box
•
#sphere
•
#cylinder
•
#particle
facing
Optional. Specifies the face of the new model resource. Valid values are as follows:
•
#front
•
#back
•
#both
Example
The following handler creates a box. The first line of the handler creates a new model resource
called box10. Its type is
#box
, and it is set to show only its back. The next three lines set the
dimensions of box10 and the last line creates a new model which uses box10 as its model
resource.
on makeBox
nmr = member("3D").newModelResource("box10", #box, #back)
nmr.height = 50
nmr.width = 50
nmr.length = 50
aa = member("3D").newModel("gb5", nmr)
end
Содержание DIRECTOR MX 2004
Страница 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...