This topic is now archived and is closed to further replies.

Q3 Map faces

This topic is 5753 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m a little confused over the face structure of the q3 map format. I just want the triangles to render but I can not seem to get it rigt. I do it like this.... number_of_tris = 0 for (all faces) { if (current_face.type == 1) { // type one describes triangle fans... number_of_tris += current_face.n_vertexes - 2 number_of_tris += current_face.n_meshverts - 2 } if (current_face.type == 3) { // type 3 describes unconnected triangles... number_of_tris += current_face.n_vertexes / 3 } } ... To get the indices of the mesh vertices i do something like this: ... current_face.vertex + meshverts[current_face.meshvert + i].offset ... But this does not seem to be right... anyone got any ideas? Regards! /hObbE

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
actually type 1 AND 3 are discrete triangles, not triangle fans.

type 1 are planar faces (walls for instance, the normal field of the face structure can be used for further culling)
type 3 are triangle soups (mostly former mapobjects)

to be complete:
type 2 are patches (with the vertices being the control points, dimension of the patch is stored in face.patchdim[])
type 4 are meant to be flares (use the lmorigin field of the face structure as midpoint for the billboard)


Share this post

Link to post
Share on other sites