Advertisement

GLUT, when to use or when not to use? Performance.

Started by September 28, 2000 05:19 PM
3 comments, last by JizzRoy 24 years, 1 month ago
I don''t use GLUT to bring up a window or read the keyboard and mouse, But I was wondering if I should use it to create objects like Cubes, not provided in the gl header. Right now I create my cubes using a function that takes 6 parameters. (x, y, z, length, width, depth) and then inside of course I have six faces being built. This way there is no translating or scaling. What kind of performance hit is this taking? What if I built the rectangular box out of 12 right triangles would this be faster that 6 faces of a cube, or should I use the GLUT cube and rotate, scale, and translate. What does the industry use? There own libraries, or do they actually use glut for these objects? just curious, thanks
Don''t use GLUT to create cubes, that''s silly. You are better off doing it on your own.

Nate Miller
http://nate.scuzzy.net
Advertisement
Thank you for the answer
would it be better to use Quads or two triangles... I''ve heard that most cards turn quads into two triangles anyway..?

Is pork a noun or a verb?

Jamie
Even thought most cards *might* turn them into triangles, if you have enough quads on the screen, this translation from quad to triangle will be a significant performance hit. Plus, you shouldn''t have faces that are defined with one normal being split across planes. To make sure of this, it''s best to use a triangle, since you can never have that on more than one plane, with a quad, you can, if you mess up the arithmetic behind it...

In short. Triangles are always faster... (unless you want a smooth curve, then use a nurb. )

S.

This topic is closed to new replies.

Advertisement