Jump to content
  • Advertisement

Archived

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

triangle strips

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!