User Guide

Primitives 337
Primitives
Each type of primitive has its own set of methods and properties used to define its appearance.
Use the
newModelResource() method to create the various primitives at runtime. Exceptions
include mesh model resources, which require you to use the
newMesh() method, and extruder
resources, which require you to use the
extrude3D() method of a text cast member.
Sphere properties
Spheres created at runtime arent saved with the cast member’s media when the Director movie is
saved. Their
type is #sphere. Their surface is generated by sweeping a two-dimensional
semicircle arc in the xy plane from
startAngle to endAngle in the y-axis. If startAngle = 0.0
and
endAngle= 360.0, a full sphere is generated. If startAngle = 180.0 and endAngle =
360.0
, a half sphere is generated. These properties can be modified or animated at runtime.
Cylinder properties
Cylinders have a
type property of #cylinder. Director generates a cylinders surface by sweeping
a 2D line around the z-axis in the xy plane from
startAngle to endAngle. If startAngle = 0.0
and
endAngle = 360.0, a full cylinder is generated. If startAngle = 180.0 and endAngle =
360.0
, a half cylinder is generated. These properties can be modified or animated at runtime.
Property Access Description Value Range
radius
Get and set Radius of the sphere. Positive floating-point
value. The default is
25.0.
resolution
Get and set Controls the number of polygons used in
the creation of the sphere surface. The
higher the value, the smoother
the surface.
An integer value of 1
or greater. The default
is 20.
startAngle
Get and set Starting angle of the sweep. Floating-point value
of from 0.0 to 360.0.
The default is 0.0.
endAngle
Get and set Ending angle of the sweep. Floating-point value
of from 0.0 to 360.0.
The default is 360.0.
Property Access Description Value Range
topRadius
Get and set Radius of the top of the cylinder. Setting
this value to 0 produces a cone.
Positive floating-point
value. The default
is 25.0.
bottomRadius
Get and set Radius of the bottom of the cylinder. Positive floating-point
value. The default
is 25.0.
numSegments
Get and set Number of polygonal segments from
bottom to top.
An integer value
greater than 0.