Advertisement

Quake 3 faces and triangles

Started by June 18, 2004 07:55 AM
2 comments, last by b3rs3rk 20 years, 5 months ago
if someone knows how the quake3 bsp format works maybe could help me.... i need a way to compute the indexes of every single triangle of a face, does someone know how i can do?
http://graphics.stanford.edu/~kekoa/q3/
Advertisement
Hmmm I'm not sure I understand your question but here's a try...
In Q3A, there are 4 kinds of faces : polygons, meshes, patches and billboards.

I think you're not interested in billboards (I guess you want to have a list of triangles to generate either tangents/binormals or info to generate shadow volumes).

Polygons are easy : they are triangle fans (the first and last indices are given IIRC), so you can figure the triangles.

Meshes are easier : they are triangle lists (described in the meshverts array).

Patches are trickier : you have to tesselate them to obtain a smooth bezier patch, so you have to generate the triangle list by yourself (hey, keep in mind that you can avoid tesselating when control points are aligned ; that has a great impact on number of triangles).

If you want some code you can look at q3view in NeHe's download section.

Hope it helps !
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
@rodzilla: you're always a source of very very very very very useful answers :D thanks!

This topic is closed to new replies.

Advertisement