General Game Development questions spawned from nehe lesson10

Started by filzr, April 03, 2007, 23:26:59

Previous topic - Next topic

filzr

Greetings all!
    Moving right along with the NeHe tutorials I have fianlly hit lesson 10.   One question and this is probably more of a gaming development question than something specific to LWJGL but i thought someone could help me out. 
    The author of the tutorial draws the walls floors and ceilings in sets of triangles.  If you are drawing a wall why would you want to draw two triangles instead of one rectangle?

   Thanks in advance!
filzr

bobjob

ummm its because the video card converts quads to triangles anyway (apparantly).
Im sure all opengl cards support triangles.
its not such a hard conversion, also makes it alot easier to right a script to import ".obj" file format (after you triangulate the object).
as each face will only have three points. Also u have the option of making anyshape wall not just a square.

you said it is more of a gaming development question then:
personally i find it very useful for collision detection. when u rotate a single triangle u can make if flat on a plane with a maximum of tree rotations (x, y, z) . In a quad if the last point isnt flat along with the other tree (before rotation) it can end up seeming silly when colliding or not with that part of that quad. also if u set collision detection effectivly for a quad, u have to rewrite a new collision detection for other shapes, were as with a triangle it works for all shapes, (as all shapes can be divided into many triangles).

hope that explain it

filzr

Yea I sorta remember hearing something about video cards dealing with triangles with everything.   I was just wondering, either way I guess it will work but if the standard is by drawing triangles its no skin off my back!!
Thanks for the quick response!