Triangle strip

Triangle strip

A triangle strip is a series of connected triangles, sharing vertices, allowing for faster rendering and more efficient memory usage for computer graphics. They are optimized on most graphics cards, making them the most efficient way of describing an object. There are two primary reasons to use triangle strips:

* Triangle strips increase code efficiency. After the first triangle is defined using three vertices, each new triangle can be defined by only one additional vertex, sharing the last two vertices defined for the previous triangle.
* Triangle strips reduce the amount of data needed to create a series of triangles. The number of vertices stored in memory is reduced from "3N" to "N+2", where "N" is the number of triangles to be drawn. This allows for less use of disk space, as well as making them faster to load into RAM.

For example, the four triangles in the diagram, without using triangle strips, would have to be stored and interpreted as four separate triangles: ABC, CBD, CDE, and EDF. However, using a triangle strip, they can be stored simply as ABCDEF.

OpenGL implementation

OpenGL has innate support for triangle strips using the "glBegin()", "glVertex*()", and "glEnd()" functions. To draw a triangle strip, "glBegin()" must be passed the argument "GL_TRIANGLE_STRIP", which notifies OpenGL a triangle strip is about to be drawn. The "glVertex*()" family of functions specify the coordinates for each vertex in the triangle strip. For more information, consult The OpenGL Redbook. [The OpenGL Redbook [http://www.glprogramming.com/red/] ]

To draw the triangle strip in the diagram, the code is as follows:

glBegin(GL_TRIANGLE_STRIP); glVertex3f( 0.0f, 0.0f, 0.0f ); //vertex 1 glVertex3f( 0.0f, 1.0f, 0.0f ); //vertex 2 glVertex3f( 1.0f, 0.0f, 0.0f ); //vertex 3 glVertex3f( 1.5f, 1.0f, 0.0f ); //vertex 4 glEnd();

Note that only one additional vertex is needed to draw the second triangle.In OpenGL, the order in which the vertices are specified is important so that surface normals are consistent.

Quoted directly from the OpenGL redbook:

GL_TRIANGLE_STRIP Draws a series of triangles (three-sided polygons) using vertices v0, v1, v2, then v2, v1, v3 (note the order), then v2, v3, v4, and so on. The ordering is to ensure that the triangles are all drawn with the same orientation so that the strip can correctly form part of a surface.

Fortunately, OpenGL will automatically rearrange the vertices in a triangle strip to make all of the triangles in the strip consistently clockwise or counterclockwise [NeHe Productions [http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19] ] , depending on the value of glFrontFace(). [Description of glFrontFace() [http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/frontface.html] ]

Converting from polygon mesh

Converting a general polygon mesh to a single long strip is generally not possible. In order to describe a complete object, one has to create either several strips, as used in Stripe, [Azanli, Elvir. [http://www.cs.sunysb.edu/~stripe/ Stripe] , retrieved on March 28, 2007.] or a degenerate strip, which contains zero-area triangles that the processing software or hardware will discard. The degenerate triangles effectively introduce discontinuities or "jumps" to the strip. For example, the mesh in the diagram could also be represented as ABCDDFFEDC, which would be interpreted as triangles ABC BCD "CDD DDF DFF FFE" FED EDC (degenerate triangles marked with italics). Notice how this strip first builds two triangles from the left, then restarts and builds the remaining two from the right.

Patent

The use of polygon strips in products distributed in the United States prior to December 4, 2014, may be subject to a patent owned by General Electric Company. [US patent|5561749, retrieved on March 28, 2007.]

References

External links

* [http://www.delphi3d.net/articles/viewarticle.php?article=tristrips.htm] - Triangle strip generation

ee also

* Triangle
* Triangle fan
* Computer graphics
* Graphics cards
* Optimization (computer science)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Triangle Strip — aus 4 Dreiecken Ein Triangle Strip besteht aus miteinander verbundenen Dreiecken. Er wird durch eine Folge von Eckpunkten für die Dreiecke definiert, wobei jede Gruppe von drei aufeinander folgenden Eckpunkten ein Dreieck beschreibt. Triangle… …   Deutsch Wikipedia

  • Strip — A strip is a long, thin piece of a bigger item; strip, stripping or stripped may refer to:* Landing strip or runway, where airplanes land * Landing strip, type of hairstyle * removing the insulation from the core of an electrical wire, known as… …   Wikipedia

  • Strip — Der Begriff Strip hat folgende Bedeutungen: die Kurzform von Striptease Comic Strip die Kurzform für das chemische Verfahren Strippen im Börsenwesen: eine Optionsstrategie bestehend aus zwei Puts und einem Call ein Unix Befehl zum entfernen der… …   Deutsch Wikipedia

  • Triangle fan — A triangle fan is a primitive in 3D computer graphics that saves on storage and processing time. It describes a set of connected triangles that share one central vertex. If N is the number of triangles in the fan, the number of vertices… …   Wikipedia

  • Triangle and Robert — Infobox Webcomic| title = Triangle and Robert caption = author = Patrick Shaughnessy url = http://home.comcast.net/ pshaughn/tandr.html status = Completed began = August 1999 ended = September 2007 genre = ratings = Triangle and Robert is a… …   Wikipedia

  • Strip club — Exterior photograph of a strip club advertising full nude entertainment (Cheetahs, in San Diego, California USA). A strip club is an adult entertainment venue in which striptease or other erotic or exotic dance is regularly performed. Strip clubs …   Wikipedia

  • Norma Triangle — is a residential neighborhood in West Hollywood, California. It encompasses the area bound by Doheny Drive and Beverly Hills on the west, Sunset Blvd and Holloway Drive on the north, and Santa Monica Blvd on the south. The small district is… …   Wikipedia

  • Penrose triangle — [ http://im possible.info/english/articles/real/real3.html More pictures from other angles.] ] The Penrose triangle, also known as the tribar, is an impossible object. It was first created by the Swedish artist Oscar Reutersvärd in 1934. The… …   Wikipedia

  • Cherokee Strip, California — Cherokee Strip   census designated place   …   Wikipedia

  • Missouri Triangle, California — Missouri Triangle   Unincorporated community   …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”