Jump to content
  • Advertisement
Sign in to follow this  

Rendering the quake 1 bsp format

This topic is 3690 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 working my way up so I'm starting using the old Quake 1 .bsp format. Using the references online, I was able to load it up but I'm not sure what type of polygon I'm supposed to be rendering it in. When using lines it works, but of course I dont want just lines. For now I'm just rendering the entire seen and will use the PVS later on. My rendering loop looks something like:
for(int x = 0; x < bsp->numFaces; ++x){
	glColor3f( (float)x / bsp->numFaces, (float)x / bsp->numFaces, (float)x / bsp->numFaces);
	// No texturing for now.
	int reverse = 0;
	if(bsp->listOfEdges[ bsp->faces[x].firstEdge ] < 0){ 
		//		Reverse the order. Go from Vertex 1 to 0, instead of 0 to 1
		reverse = 1;
	int numEdges = bsp->faces[x].numEdges;
	if(numEdges == 4){
	} else if(numEdges == 3){
	} else {

	for(int i = 0; i < numEdges; i++){
		int temp = abs(bsp->listOfEdges[ bsp->faces[x].firstEdge + i]);
		BSPVertex *vertex1;
		BSPVertex *vertex2;
			vertex1 = &bsp->vertices[ bsp->edges[ temp ].edgeIndices[1] ];
			vertex2 = &bsp->vertices[ bsp->edges[ temp ].edgeIndices[0] ];
		} else {
			vertex1 = &bsp->vertices[ bsp->edges[ temp ].edgeIndices[0] ];
			vertex2 = &bsp->vertices[ bsp->edges[ temp ].edgeIndices[1] ];
		glVertex3f(vertex1->x, vertex1->y, vertex1->z);
		glVertex3f(vertex2->x, vertex2->y, vertex2->z);


Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!