PDA

View Full Version : Rendering BSP Entities



nukem
08-19-2003, 06:37 PM
I wrote a BSP engine and I am having some trouble rendering the entities. The first part of the problem is the entities do not appear to be facing the right direction this is the code I use to render them




//renders our entities
void RenderEntities(Vect3& Pos)
{
//go threw all the entities
for(int i=0;i<entitiecount;i++)
{
//if an entitie has an origin it has to be rendered
if(entities[i].origin)
{
//if its an md3 model
if(strcmp(entities[i].classname, "misc_model") == 0)
{
glPushMatrix();
//move the model to were it should be in the map
glTranslatef(entities[i].origin->x, entities[i].origin->y, entities[i].origin->z);
//rotate the model
glRotatef(entities[i].angle, entities[i].origin->x, entities[i].origin->y, entities[i].origin->z);
//render it
entities[i].model.Render(0);
glPopMatrix();
}
}
}
}


When loading the entities coords I do swap the y and z coords and get the opposite of the z coord.

The other part of my problem is that none of the entities have textures. Does anyone know were the path to the entities textures are stored and how to tell what texture goes with what entities?

Thanks
nuke

[This message has been edited by nukem (edited 08-20-2003).]

B_old
08-19-2003, 11:46 PM
Are you talking about Q3's map-format?
Try this link: http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm , to get some usefull information about it. I hope this is what you want.

nukem
08-19-2003, 11:49 PM
I started using the tutorials on that site to learn how to do everything but now ive moved onto the more advanced stuff that they dont cover.

B_old
08-19-2003, 11:51 PM
I guess this thread is not relevant anymore then, right?

nukem
08-19-2003, 11:55 PM
No why would that be? I still dont know were to get the textures for the entities and how to make my rendering code right, everything looks like its facing the wrong way.

B_old
08-19-2003, 11:59 PM
Well, this is covered in the tutorials found at the link I posted...

EDIT: Ah, I think I see now what you mean, you don't mean the bsp-faces but the models, right? Sorry, but I can't help.

Maybe you want to post on a forum like www.flipcode.com? (http://www.flipcode.com?)

[This message has been edited by B_old (edited 08-20-2003).]

nukem
08-20-2003, 12:17 AM
Yes I realize part of it is a little OT but the way its being rendered is OGL so I was wondering if anyone knew how to fix that, the texture part I threw in just incase someone here knew.