OpenGL

Started by
5 comments, last by yot 22 years, 8 months ago
hi, I wanted to know if it is possible to say when it is better to use GL_TRIANGLE_STRIP or GL_TRIANGLES. Is it right that GL_TRIANGLE_STRIP is faster? Do you ever habe experienced while writing OpenGL Apps, that sometimes when you have a 3d world for example there are some kind of (common black or white) pixels between some of the polygons? I hope you know what I am speaking about yot
Advertisement
Triangle strips and triangle fans will be faster than just using triangles if your program is geometry limited.

Also, if I understand what you mean the ''see though'' between polygons is caused by what are essentially rounding errors. You could also be talking about zbuffer inaccuracies, but I don''t think you are.

[Resist Windows XP''s Invasive Production Activation Technology!]
hi,

yeah I think the ''see though'' is exactly what I wanted to say, I just didn''t know the word for =)

I know that this is because of rounding errors, but what can I do to avoid them?

yot
I''m not sure exactly (I''ve done a lot more 2D in OpenGL than 3D ). At least this will bump your post up for someone else to answer though .

[Resist Windows XP''s Invasive Production Activation Technology!]
Try to stay away from very thin polygons, and make sure that adjacent polygon''s vertices have the exact same value. Also, don''t build things like this:


    /\1   /  \  /    \ /2  3  \4*---*---* \  |  /  \ | /   \|/    *5 


where the triangles are [1, 2, 4], [2, 3, 5] & [3, 4, 5]. If you do this you will probably see a crack in the line segment [2, 4]. Instead, you should break up triangle [1, 2, 4] into two triangles: [1, 2, 3] & [1, 3, 4]
hi,
thx @ Null and Void and Wolfman

@Wolfman: Your idea is good, but to realize this? What to do, if you have a much more complicated figure?

@all: What do you think is the best online OpenGL Rendering document?

yot
What wolfman explained is called ''T-vertices''. They are _extremely evil_, don''t use them, cracks are allmost unavoidable. Normally, if you are using standard 3d modelling packages (blender, 3dsmax, maya...), they will not appear. You will stumble over them if you do some kind of subdivision of your geometry afterwards. Just do a second pass over the geometry and check for them. You can correct the problem by splitting the triangle (1,2,4) in Wolfmans post. Do this recursively, and you''ll be fine.

This topic is closed to new replies.

Advertisement