■ The Cube command
The Cube command in B3D and CSV objects is equivalent to a series of Vertex/AddVertex and Face/AddFace commands.
Given the following code (B3D style):
▶ |
Cube x, y, z |
The Cube command corresponds to these instructions (B3D style):
▶ |
Vertex x, y, -z |
where v is the number of vertices that have already been created before the Cube command was used.
If you want to texture the cube, you need to add appropriate Coordinate/SetTextureCoordinate commands manually.
■ The Cylinder command
The Cylinder command in B3D and CSV objects is equivalent to a series of Vertex/AddVertex and Face/AddFace commands.
Given the following code (B3D style):
▶ |
Cylinder n, r1, r2, h |
The Cylinder command first corresponds to n pairs of two vertex instructions (B3D style):
▶ |
Vertex cos[2*pi*0/n]*r1, h/2, sin[2*pi*0/n]*r1 |
Then, n faces are added to form the side walls (B3D style):
▶ |
Face 2, 3, 1, 0 |
If r2>0, a lower cap is then added (B3D style):
▶ |
Face 2*n-2, 2*n-4, 2*n-6, …, 4, 2, 0 |
If r1>0, an upper cap is then added (B3D style):
▶ |
Face 1, 3, 5, …, 2*n-5, 2*n-3, 2*n-1 |
If you want to texture the cylinder, you need to add appropriate Coordinate/SetTextureCoordinate commands manually.