Lingo Dictionary
149
You must use the model resource’s
build()
command after setting this property; otherwise, the
changes will not take effect.
Example
This example creates a model resource whose type is
#mesh
, specifies its properties, and then
creates a new model with it.
Line 1 uses the
newMesh()
command to create a
#mesh
model resource named Triangle, which
has one face, three vertices, and a maximum of three colors. The number of normals and the
number of texture coordinates are not set.
Line 2 sets the
vertexList
property to a list of three vectors.
Line 3 assigns the vectors of the
vertexList
property to the vertices of the first face of Triangle.
Line 4 sets the color list to three
rgb
values.
Line 5 assigns colors to the first face of Triangle. The third color in the color list is applied to the
first vertex of Triangle, the second color to the second vertex, and the first color to the third
vertex. The colors will spread across the first face of Triangle in gradients.
Line 6 creates the normals of Triangle with the
generateNormals()
command.
Line 7 uses the
build()
command to construct the mesh.
Line 8 creates a new model named TriModel that uses the new mesh.
nm = member("Shapes").newMesh("Triangle",1,3,0,3,0)
nm.vertexList = [vector(0,0,0), vector(20,0,0), vector(20, 20, 0)]
nm.face[1].vertices = [1,2,3]
nm.colorList = [rgb(255,255,0), rgb(0, 255, 0), rgb(0,0,255)]
nm.face[1].colors = [3,2,1]
nm.generateNormals(#smooth)
nm.build()
nm = member("Shapes").newModel("TriModel", nm)
See also
face
,
vertices
,
colorList
,
flat
colorSteps
Syntax
member(
whichCastmember
).model(
whichModel
).toon.colorSteps
member(
whichCastmember
).model(
whichModel
).shader.colorSteps
member(
whichCastmember
).shader(
whichShader
).colorSteps
Description
3D
toon
modifier and
painter
shader property; the maximum number of colors available for use
by the
toon
modifier or
painter
shader. The value of this property can be 2, 4, 8, or 16. If you
set the value of
colorSteps
to any other number, it will be rounded to one of these.
The default value is 2.
Example
This statement limits the number of colors available for use by the
toon
modifier for the model
named Teapot to 8. The teapot will be rendered with a maximum of eight colors.
member("shapes").model("Teapot").toon.colorSteps = 8
See also
highlightPercentage
,
shadowPercentage
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...