#### Archived

This topic is now archived and is closed to further replies.

# Surface Normal (Again)

This topic is 6913 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've tried to specified the simple square plain surface normal. Can you guys tell me if I understand it right? Here's my code: glBegin(GL_QUADS); glNormal3f(-1.0f, 1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f); glNormal3f(-1.0f,- 1.0f, 1.0f); glVertex3f(-1.0f,-1.0f, 1.0f); glNormal3f( 1.0f,-1.0f, 1.0f); glVertex3f( 1.0f,-1.0f, 1.0f); glNormal3f( 1.0f, 1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f); glEnd(); Edited by - Iceman on 5/14/00 7:00:57 AM

##### Share on other sites
The normal vector points out from the quad, so the normal
should be the same at all four vertices. (it also has a length of one unit so x*x + y*y + z*z=1)

also I don''t think you need to keep redefining the normal - they are all the same. so you could try something like:

glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(-1.0f, 1.0f, 1.0f);
glVertex3f(-1.0f,-1.0f, 1.0f);
glVertex3f( 1.0f,-1.0f, 1.0f);
glVertex3f( 1.0f, 1.0f, 1.0f);
glEnd();

i hope this is right

alistair

##### Share on other sites
OK, Thanks
But I still confuse about Surface Normal anyway.
(I didn''t know anything about vector at all.)

##### Share on other sites
You should look at the OpenGL Superbible for info on this type of thing. Chapter 9 Section "Using a Light Source - Surface Normals" is what you want.

It is at:

http://www.itknowledge.com/reference/archive/1571690735/ewtoc.html

alistair

##### Share on other sites
Also, Nate (nate.scuzzy.net) has a good tutorial on normals and stuff.

Morgan

• 10
• 13
• 52
• 11
• 15