View Full Version : How to make walls in OpenGL?

04-25-2002, 05:35 PM
I want to make a room with walls, how do i do it? If i use GL_QUADS or GL_POLYGON my walls turn out flat.
Also, what is glNormal3f used for? Doesnt it have the same effect as glTranslatef?
Another thing, in glVertex3f(x, y, z); I know z is depth but what exactly is depth? thickness?

Questions Burner
04-25-2002, 10:15 PM
Use GL_QUADS and texture map it.
glNormal3f is used to set the normal of an object, normal is used in lighting calculation.
You use glTranslatef for translation.
x, y, z is just a coordinate of 3D space.

Download this 'Red Book'

04-26-2002, 05:35 AM
Polygons don't have any thickness. If you want to model a wall with some thickness, you'll have to use a quad for each visible side.

Horrible ASCII art to follow...

This is a quad
| |
This is a quad -> | | <- This is a quad
| |
This is a quad

04-26-2002, 07:29 AM
NeHe ( http://nehe.gamedev.net ) has a tutorial which included this. I think it's tutorial # 10.

[This message has been edited by Furrage (edited 04-26-2002).]