Reference:Smooth Triangle

From POV-Wiki
Revision as of 22:27, 11 March 2012 by Jholsenback (talk | contribs) (1 revision: Initial Load (TF))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The smooth_triangle primitive is used for just such purposes. The smooth triangles 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:
  smooth_triangle {
  <Corner_1>, <Normal_1>, <Corner_2>,
  <Normal_2>, <Corner_3>, <Normal_3>
  [OBJECT_MODIFIER...]
  }

where the corners are defined as in regular triangles and <Normal_n> 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.

The mesh object is a way to combine many triangle and smooth_triangle objects together in a very efficient way. See Mesh for details.