Advertisement

ASCII Files

Started by February 03, 2003 09:07 PM
1 comment, last by adam17 22 years, 1 month ago
i am using the ascii file type (from MAX) for inputting models into my program. i was wondering if there was anyway to output in quads instead of triangles. if there is not a way to output in quads then can anyone give me an idea of how to texture the triangles?
what you mean 'texture triangles' ?
Like you have a 3d model and you want to put a texture on it ?
I worked with the ascii files from max a time ago and it can store also the uv coordinates. So you have to read it corectly and then just
glBegin(GL_TRIANGLES);
glTexCoord2d(Trian.u0,Trian.v0);
glVertex3f(Train.x0,Train.y0,Trian.z0);
... //and the same for 1,2.
glEnd();

Quads are in general bad idea, because 4 points can be non-coplanar. The only way using quads is to use them together
with triangles :-)

[edited by - koza on February 4, 2003 10:29:09 AM]
Advertisement
Well if you do it with triangles texturing is the same way as with quads. 2 triangles make one quad (if you do it right) and just think for every triangle point "what point would this be in the quad?" and just texture it that way... there''s a new tutorial added to nehe about texturing triangles too, so you can look there. If you really want to load up the quads, just load up the triangles and do the same as with the triangle->to->quad conversion I just told you but just the other way around (only use 4 of the 6 gives vertices)

This topic is closed to new replies.

Advertisement