PDA

View Full Version : Are quads worth their weight in code?



BwB
08-21-2000, 02:13 PM
I've been slowing writing a 3d engine over the last couple of weeks.. one that implements both quads and tris in its models. But I'm beginning to wonder if the advantages of quads are really worth the duplicity of code. Will I really gain enough to warrent writing all my collision detection and everything else to use both quads and tris or would I merely split the quads up into tris the first chance I get??

Thanks in advance,
-BwB

MikeC
08-21-2000, 03:10 PM
Personally I'd stick to triangles for mesh-type models - you'll usually get better stripping than you would if you mixed the primitive types, and as you say it makes for much cleaner code.

GL_QUADS is useful when you're drawing a whole bunch of disconnected quads within a single glBegin/glEnd pair - the obvious example is a particle system. Otherwise you'd have to specify 6 verts/texcoords (2 triangles) instead of 4. Of course, your collision code would treat the particles as points, not quads, so you wouldn't get duplication there.