GL_TRIANGLES needing resetting as GL_QUADS? Quick question

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

GL_TRIANGLES needing resetting as GL_QUADS? Quick question

Post by sg57 »

Seeing as how the GU_TRIANGLE_FAN needs to:

Code: Select all

glBegin(GL_TRIANGLE_FAN);

draw a wal for example

glEnd();
glBegin(GL_TRIANGLE_FAN)

draw another wall

glEnd();

etc...
Since GL_QAUDS isnt really in the PSPGL, I was wondering if the GL_TRIANGLES needs the same treatment as the fan.

Quick and probablay stupid question, i kno, but Id like an answer :-?[/code]
zilt
Posts: 45
Joined: Tue Feb 21, 2006 11:59 pm
Location: Ontario, Canada
Contact:

Post by zilt »

Quick answer - no. Each GL_TRIANGLES element is independent from the previous triangle. However, trying to reuse the same veritces in the following triangle sometimes allows the low level driver/hardware to speed up the triangle rendering by converting the GL_TRIANGLES into a GL_TRIANGLE_STRIP - but is heavily dependent on the hardware and order. Google for it if you want more info.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Do a little research on what each one does. GL_TRIANGLES will create a triangle from each 3 points you give it, so you can wrap them all between a glBegin and glEnd.

See this page for more info on them and other primitives.

http://www.rush3d.com/reference/opengl- ... ter02.html
Post Reply