• Advertisement
Sign in to follow this  

Walls,windows, and doors

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

Hello, I got this code that draws a textured wall of a brick house glBegin(GL_QUADS); glTexCoord2f(0.0, 1.0); glVertex3f(x,y,z); // TL glTexCoord2f(0.0, 0.0); glVertex3f(x,y,z); // BL glTexCoord2f(1.0, 0.0); glVertex3f(x,y,z); // BR glTexCoord2f(1.0, 1.0); glVertex3f(x,y,z); // TR glEnd(); If I want to put a window or door in that wall defined by GL_QUADS, what woudl be the best way to do it. Another GL_QUADS,glScissor, or alpha testing? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Best would be not to hardcode it that way, but to write an object loader and model your wall, including doors and windows, in a 3D program.

Then you draw the triangles belonging to an object (which incidentially is a wall with a door or a window), and you need not care about all the 57 million special cases of walls with or without doors, floors with and without stairs going down, roofs, chimneys, or whatever objects happen to be in your world.

Write code once, model data in a tool.

Share this post


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

  • Advertisement