A primitive is a solid shape that one command draws, with no vertices to list. It is
placed by the transform in force and coloured by the material in force. The scripts
that use them on RenderWare’s demonstration disc are HUMAN.RWX, an
articulated figure made of blocks, cones, cylinders and spheres, and
TRIAD.RWX, a set of axes with arrowheads. The primitives do not touch the
vertex list: the numbers a Triangle or Polygon uses are not
counted among them.
The files fix where each shape sits and what its arguments mean in the cases they use. RenderWare decides how many polygons make a round shape, and no file says how many. The counts here are those of this viewer, so the pictures show the shapes, not RenderWare’s facets.
The shapes
| Command | Arguments | Shape and place | Evidence |
|---|---|---|---|
Block |
width, height, depth | A box centred on the origin, with its width along x, height along y and depth along z. | HUMAN.RWX hangs an upper arm from the shoulder with Translate 0 -0.25 0 and Block 0.05 0.5 0.1: half its height below the shoulder at y 0 puts the block’s centre there. |
Cone |
height, radius, sides | A circular base of the given radius in the plane y = 0, centred on the y axis, and a tip at y = height. The viewer closes the base. | TRIAD.RWX draws a shaft with Cylinder 0.9 …, then Translate 0 0.9 0 and Cone 0.1 0.04 8 for the head, which ends at y 1.0, so the cone starts at its own origin and points up. |
Cylinder |
height, bottom radius, top radius, sides | A tube from y = 0 up to y = height, the first radius at the bottom and the second at the top. The viewer closes both ends. | The shaft of the TRIAD arrow runs from 0 to its height of 0.9. Both radii are equal in every sample use (Cylinder 0.4 0.03 0.03 12 in HUMAN, Cylinder 0.9 0.02 0.02 8 in TRIAD), so which radius is the bottom one is from memory, not from a file. |
Disc |
height, radius, sides | A flat circle of the given radius in the plane y = 0, with the middle raised to y = height. With a height of 0 it is flat. The viewer draws it as a fan of triangles that is visible from both sides. | TRIAD.RWX has Rotate 0 0 1 180 and Disc 0 0.04 8 directly after the cone of the arrowhead, which is the flat base of that cone. What a height above 0 does is a guess from the name. |
Hemisphere |
radius, density | The half of a sphere above the plane y = 0, with a flat base that the viewer closes. | No sample file uses it. Which half, and whether it has a base, is from memory. |
Sphere |
radius, density | A sphere centred on the origin. The density is how finely it is cut: more is rounder. This viewer cuts it into 4 × density slices and 2 × density bands. | HUMAN.RWX uses densities of 3 (Sphere 0.1 3, scaled to a foot or a head), TRIAD uses 4 for the ball at the origin. The pictures of both look like spheres, ellipsoids once scaled. |
Torus |
major radius, minor radius, major density, minor density | A ring around the y axis: the distance from the axis to the middle of the tube, the radius of the tube, and how many segments go round the ring and round the tube. | No sample file uses it; the arguments are from memory. |
Sides and density
For Cone, Cylinder and Disc, the last argument
is the number of straight sides round the circle; the sample files use 8 and 12. The
viewer takes a number from 3 to 512, and rounds anything else. A density is a whole
number from 1; the viewer takes 1 to 32.
A primitive’s polygons are put through the transform in force when the command is read,
and are drawn in the current Color. Together with the
transforms, which scale and turn a shape before it
is placed, this is how HUMAN.RWX makes a torso, a head and limbs from a
handful of commands: Scale 0.4 0.4 1.0 then Sphere 0.1 3 is a
foot, long in z.
Not described
Only Block, Cone, Cylinder, Disc and Sphere appear in the sample files; the rest is from memory.
- Reference: Hemisphere and Torus have no sample use, so their arguments and placement are unverified.
- Reference: which Cylinder radius is the bottom one, what a Disc height above 0 does, and which side of a Disc faces out are unverified.
- Reference: how RenderWare divides round shapes into polygons, and what the density means exactly, is unknown.
- Viewer: uses its own tessellation (4 × density slices, 2 × density bands), so facets differ from RenderWare’s.