home *** CD-ROM | disk | FTP | other *** search
- The triangle primitive is available in order to make more complex objects
- than the built-in shapes will permit. Triangles are usually not created by
- hand, but are converted from other files or generated by utilities.
-
- A triangle is defined by:
- triangle { <CORNER1>, <CORNER2>, <CORNER3> }
- where <CORNERn> is a vector defining the x,y,z coordinates of each corner of
- the triangle.
-
- Because triangles are perfectly flat surfaces it would require extremely
- large numbers of very small triangles to approximate a smooth, curved sur-
- face. However much of our perception of smooth surfaces is dependent upon
- the way light and shading is done. By artificially modifying the surface
- normals we can simulate as smooth surface and hide the sharp-edged seams
- between individual triangles.
-
- The smooth_triangle primitive is used for just such purposes and use a
- formula called Phong normal interpolation to calculate the surface normal
- for any point on the triangle based on normal vectors which you define for
- the three corners. This makes the triangle appear to be a smooth curved
- surface. A smooth_triangle is defined by:
- smooth_triangle {
- <CORNER1>, <NORMAL1>,
- <CORNER2>, <NORMAL2>,
- <CORNER3>, <NORMAL3>
- }
- where the corners are defined as in regular triangles and <NORMALn> is a
- vector describing the direction of the surface normal at each corner.
-
- These normal vectors are prohibitively difficult to compute by hand.
- Therefore smooth_triangles are almost always generated by utility programs.
- To achieve smooth results, any triangles which share a common vertex should
- have the same normal vector at that vertex. Generally the smoothed normal
- should be the average of all the actual normals of the triangles which share
- that point.
-