PDA

View Full Version : How to make walls in OpenGL?



04-25-2002, 04: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, 09: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'
http://fly.cc.fer.hr/~unreal/theredbook/theredbook.zip

Deiussum
04-26-2002, 04: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
|
v
---
| |
This is a quad -> | | <- This is a quad
| |
---
A
|
This is a quad

Furrage
04-26-2002, 06: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).]