ThreeDimensional Graphics Primitives
One of the most powerful aspects of graphics in Mathematica is the availability of threedimensional as well as twodimensional graphics primitives. By combining threedimensional graphics primitives, you can represent and render threedimensional objects in Mathematica.
Point[{x,y,z}]  point with coordinates x, y, z 
Line[{{x_{1},y_{1},z_{1}},{x_{2},y_{2},z_{2}},...}]  line through the points {x_{1}, y_{1}, z_{1}}, {x_{2}, y_{2}, z_{2}}, ... 
Polygon[{{x_{1},y_{1},z_{1}},{x_{2},y_{2},z_{2}},...}] 
 filled polygon with the specified list of corners 
Cuboid[{x_{min},y_{min},z_{min}},{x_{max},y_{max},z_{max}}] 
 cuboid 
Text[expr,{x,y,z}]  text at position {x, y, z} (see "Graphics Primitives for Text") 
Threedimensional graphics elements.
Every time you evaluate rcoord, it generates a random coordinate in three dimensions. 
This generates a list of 20 random points in threedimensional space. 
Here is a plot of the points.
Out[3]=  

This gives a plot showing a line through 10 random points in three dimensions.
Out[4]=  

If you give a list of graphics elements in two dimensions, Mathematica simply draws each element in turn, with later elements obscuring earlier ones. In three dimensions, however, Mathematica collects together all the graphics elements you specify, then displays them as threedimensional objects, with the ones in front in threedimensional space obscuring those behind.
Every time you evaluate rantri, it generates a random triangle in threedimensional space. 
This draws a single random triangle.
Out[6]=  

This draws a collection of 5 random triangles. The triangles in front obscure those behind.
Out[7]=  

By creating an appropriate list of polygons, you can build up any threedimensional object in Mathematica. Thus, for example, all the surfaces produced by ParametricPlot3D are represented essentially as lists of polygons.
Point[{pt_{1},pt_{2},...}]  a multipoint consisting of points at pt_{1}, pt_{2}, ... 
Line[{line_{1},line_{2},...}]  a multiline consisting of lines line_{1}, line_{2}, ... 
Polygon[{poly_{1},poly_{2},...}]  a multipolygon consisting of polygons poly_{1}, poly_{2}, ... 
Primitives which can take multiple elements.
As with the twodimensional primitives, some threedimensional graphics primitives have multicoordinate forms which are a more efficient representation. When dealing with a very large number of primitives, using these multicoordinate forms where possible can both reduce the memory footprint of the resulting graphic and make it render much more quickly.
rantricoords defines merely the coordinates of a random triangle. 
Using the multicoordinate form of Polygon, this efficiently represents a very large number of triangles.
Out[9]=  

Mathematica allows polygons in three dimensions to have any number of vertices in any configuration. Depending upon the locations of the vertices, the resulting polygons may be noncoplanar or nonconvex. When rendering noncoplanar polygons, Mathematica will break the polygon into triangles, which are planar by definition, before rendering it.
The noncoplanar polygon is broken up into triangles. The interior edge joining the triangles is not outlined like the outer edges of the Polygon primitive.
Out[10]=  

Selfintersecting nonconvex polygons are filled according to an evenodd rule that alternates between filling and not at each crossing.
Out[11]=  

Cuboid[{x,y,z}]  a unit cube with opposite corners having coordinates {x, y, z} and {x+1, y+1, z+1} 
Cuboid[{x_{min},y_{min},z_{min}},{x_{max},y_{max},z_{max}}]  a cuboid (rectangular parallelepiped) with opposite corners having the specified coordinates 
Cylinder[{x_{1},y_{1},z_{1}},{x_{2},y_{2},z_{2}}]  a cylinder of radius 1 with endpoints at {x_{1}, y_{1}, z_{1}} and {x_{2}, y_{2}, z_{2}} 
Cylinder[{x_{1},y_{1},z_{1}},{x_{2},y_{2},z_{2}},r]  a cylinder of radius r 
Sphere[{x,y,z}]  a unit sphere centered at {x, y, z} 
Sphere[{x,y,z},r]  a sphere of radius r 
Cuboid graphics elements.
This draws a number of random unit cubes and spheres in threedimensional space.
Out[12]=  

Even though Cylinder and Sphere produce highquality renderings, their usage is scalable. A single image can contain thousands of these primitives. When rendering so many primitives, you can increase the efficiency of rendering by using special options to change the number of points used to render Cylinder and Sphere by default. The "CylinderPoints" Method option to Graphics3D is used to reduce the rendering quality of each individual cylinder. Sphere quality can be similarly adjusted using "SpherePoints".
Because the cylinders are so small, the number of points used to render them can be reduced with almost no perceptible change.
Out[13]=  







