#### Archived

This topic is now archived and is closed to further replies.

# triangle strips

This topic is 6514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m trying to figure out triangle strips. I''m currently drawing the following two quads 1---2---3 | | | | | | 4---5---6 As 4 triangles ... 2,1,4 4,5,2 3,2,5 5,6,3 What I''d like to do is draw them as triangle strips but I''m haveing trouble getting them in the right order. If someone could tell me what the proper order for this would be I would be able to understand how there supposed to work.

##### Share on other sites
Here the order I use

2--4--6
|\ |\ |
| \| \|
1--3--5

just keep the odd vertices on the bottom and even on the top and you can draw a strip any lenght

##### Share on other sites
triangle strip order is
0,1,2 - 2,1,3 - 2,3,4 - 4,3,5 etc

http://members.xoom.com/myBollux

##### Share on other sites
Thanks, I got it working now!
For anyone that''s interested in the performance difference.
drawing a 128 x 128 grid as dual triangle quads
draw each triangle independantly = 7.5 fps
draw each quad as two triangles in a quad strip = 10.4 fps
draw each row as a strip of 128*2 triangles = 22.6 fps
I''ve qot 3 times the performance and the only changes were in the drawing calls (glColor, glVertex, and glNormal) Now to optomize some to the other code!

##### Share on other sites
use vertex arrays and you''ll gain another ±50%

http://members.xoom.com/myBollux

##### Share on other sites
I''ll have to try to find some info on those, do you know where there are any tutorials on vertex arrays? I optimized the calculations and removed approx 65000 multiplications per frame and I got no performance increese. I can only assume that the compiler was already implementing the same changes.

##### Share on other sites
maybe not you''ld be surprised how fast cpu''s r nowadays

http://members.xoom.com/myBollux

##### Share on other sites
If the information I found is correct a pentiumII takes only 1-3 cycles to execute the fmul instruction. On my system that means I saved only 0.1% of the processors time.

1. 1
Rutin
22
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633307
• Total Posts
3011289
• ### Who's Online (See full list)

There are no registered users currently online

×