Basic Triangle

Rendering Methods | Tuesday 2 June 2009 7:30 pm

The triangle is the basic geometry that is used when rendering. All other shapes of geometry you want to draw must be divided into triangles.

Basic Triangle

The triangle parts:

  1. Face, the triangle itself, the area is what is gonna be rasterized (with normal fill mode at least).
  2. Face normal, the normal to the plane which the triangle is parallell too. It is mostly used for calculating the vertex normal.
  3. Vertex, a triangle has three vertices with x,y,z coordinates, they are located in the triangle corners. All transformations apply to these ones.
  4. Edge, the line between vertices are called edges, a triangle has three edges. Are used for example shadow volumes.
  5. Vertex normal, each vertex has a normal which decides the smoothness of the geometry.

Other data often used per vertex:

  • Tangent and Binormal for per pixel lighting
  • Texture coordinates (uvw-coords), sometimes more than one per vertex

Tutorial to render a triangle in DirectX10
http://msdn.microsoft.com/en-gb/library/bb172486(VS.85).aspx

Tutorial to render a triangle in OpenGL
 http://60hz.csse.uwa.edu.au/workshop/workshop0/workshop1.html

Tutorial to render a triangle in XNA
http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/The_first_triangle.php

Tutorial to render a triangle in OpenGL ES 2.0
http://www.webreference.com/programming/opengl_es/