myModel.createPrimitive( primitiveType, subType, resolution, dummy ) in Anark Studio 2.5
Create primitive geometry in the model.
Arguments
name | type | description |
---|---|---|
primitiveType | Number | Type of primitive (see below)< |
subType | Number | Texture mapping for primitive< |
resolution | Number |
Number of faces (see below) |
dummy | Number | Placeholder; must always be "0 |
- Return Type
- (none)
Description
Creates a simple geometric object. This method can only be used with "empty" models (i.e., a model created without specifying a Library asset name). Primitives are created with dimensions of 100x100x100 units. To alter the dimensions, use the scale property.
Valid values for primitiveType
:
1
— Rectangle2
— Sphere3
— Cone4
— Cylinder5
— Cube
Valid values for subType
:
0
— Single-sided; Maps the material to the rectangle so that only one side, or "face," is drawn. If the rectangle is rotated so that the back face is in view, it would appear to be completely transparent.1
— Mirrored; Maps the material to the rectangle so that it is two-sided, with the image flipped from left to right so that if there were text in the image, it would be readable on both sides.2
— Double-sided; Maps the material to the rectangle so that it is two-sided like a flag, where text would be reversed on the back side. This is the default setting.
For the resolution
parameter:
- For rectangles, which are flat planes, a value of 1 is most common.
- For spheres, a value of 3 is often adequate and a value of 5 creates a smooth sphere.
- For cones, a value of 10 creates a smooth cone, while a value of 4 creates a pyramid.
- For cylinders, a value of 10 creates a smooth surface while a value of 3 creates a prism shape.
- For cubes, a value of 1 is most common.