• Advertisement
Sign in to follow this  

Q3MAP2

This topic is 3917 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

Hey dudes, I wrote a simple Q3 loader and it seems to load standard q3 bsp files ok. However, any map compiled with q3map2 does not work (looks weird) in my loader but works in Quake 3. It is a pity, since GtkRadient is such a nice tool. Any ideea?

Share this post


Link to post
Share on other sites
Advertisement
There's something wrong with your loader. Q3map2 produces valid BSPs.

Share this post


Link to post
Share on other sites
Well yes. I was using triangle fans but found out i should be using indexed triangles. The problem is I cant get them working (however I believe I wrote good code). I will post snippets when I get home.

Share this post


Link to post
Share on other sites
Here's what I mean.

I was drawing faces like this:

glDrawArrays(GL_TRIANGLE_FAN, Scene.BSPMap.fFaces.Vertex + Scene.BSPMap.fMeshVerts[Scene.BSPMap.fFaces.MeshVert], Scene.BSPMap.fFaces.MeshVertCount);


which works ok for q3map compiled BSPs.

I found out that in order to render a q3map2 BPS you should use the MeshVert array as an index to vertices you want to draw, which would produce a call like this:

glDrawElements(GL_TRIANGLES, Scene.BSPMap.fFaces.MeshVertCount, GL_INT, @Scene.BSPMap.fMeshVerts[Scene.BSPMap.fFaces.MeshVert]);


However this gives me a blank screen. This is an alternate solution:


glBegin(GL_TRIANGLES);
for aux := 0 to Scene.BSPMap.fFaces.MeshVertCount-1 do
glVertex3fv(@Scene.BSPMap.fVertices[Scene.BSPMap.fFaces.Vertex + Scene.BSPMap.fMeshVerts[Scene.BSPMap.fFaces.MeshVert] + aux].Position);
glEnd();


Which gives me errors the same way the triangle fan solution did.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement