View Full Version : Normals and lighting
12-17-2003, 01:18 AM
We render lights without specifying Normals vectors for each vertex. But everywhere you find a mention about the computation of Normal vectors for determing the orientation of
the object relative to the light sources. What is the logic behind.Also tell me how normal vectors are computed for determining the orientation of light sources.
Thanks in advance
we specify normals in accordance with the Phong shading model I believe. To compute one you need to compute two vectors (from three vertices) and then take the cross product of the two vectors. Angel's Computer Graphics, a top down aproach describes a little bit the theory behind normals and lighting in general. Hope that helped a bit.
--cont'd: You can specify a normal for each polygon if you want flat shading. Thus all polygon vertices use the same normal. But if you want smooth shading you have to provide a normal for each vertex. And to be even more precise each normal has to be average of the normals of the polygons surrounding the vertex. Of course if you want some fast results you could use GLU objects for automatic calculations of normals.
[This message has been edited by moucard (edited 12-17-2003).]
12-17-2003, 05:26 AM
the logic behind specifying normal vectors is to found out the oritentation of a surface in relation to the light source, which gives the brightness of the surface. What is the logic behind rendering lights WITHOUT using normal vectors? what do you do??
12-17-2003, 06:54 PM
In my opengl programs I never had specified commands such as glNormal3f( ) before lighting calculations. How to specify normals explicitly
Originally posted by iris_raj:
How to specify normals explicitly
By using glNormal before each vertex or each triangle...
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.