Docsity

Triangles and Planes - Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Triangles and Planes - Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Computer

Graphics

Lecture 21

Triangles &

Planes

  • Triangles are to 3D graphics what pixels are to 2D graphics
  • Every PC hardware accelerator under the sun uses triangles as the fundamental drawing primitive
  • When we draw a polygon…
  • Hardware devices really draw a fan of triangles
  • The ordering of the

vertices goes clockwise

around the triangle

Three points in space, and the triangle connecting them Docsity.com

  • The code that defines

triangle with the help of

structure and public

constructor:

  • struct triangle

type v[3]; // Array access useful for loops triangle() { // nothing } triangle(type v0, type v1, type v2) { v[0] = v0; v[1] = v1; v[2] = v2; }

  • Lists of triangles are

generally represented in

one of three ways:

Triangle List

  • The first is an explicit list or array of triangles, where every three elements represent a new triangle.

Triangle Fans

  • Triangle fans, conceptually, look like the folding fans you see in souvenir shops. They are a list of triangles that all share a common point.
  • An N-sided polygon can be represented efficiently using a triangle fan

Triangle Strips