Re: [Plib-users] BGL Loader
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-04-23 22:13:16
|
John Tsao wrote: > I have tried ssgVtxTable in tux_example. Looks Ok. To be safe, I think I won't use > ssgaCube. > One little question: I know what a normal vector of a surface is. However, it looks like > every vertix can have it's own normal vector. I am confused. OpenGL (and hence SSG) uses the concept of a normal to the *true* surface shape - not necessarily the shape of the polygons that you use to represent it. Think of a sphere that's approximated by a dodecahedron or something....the polygons are only an approximation of the sphere - but you can compute normals that stick radially outwards to better represent the spherical shape. By using these "more correct" normals computed at the vertices of each triangle, OpenGL can perform lighting calculations at each vertex and then blend the resulting colours to get smoother looking lighting. With this, you can make things look rounded even though they are made of flat planes. For surfaces like spheres and cylinders, it's easy to generate the correct normal at each vertex. For things like cubes (and dodecahedrons that you *want* to look facetted rather than smooth) you should take the true normal for each polygon and apply that to each vertex. For more 'freeform' surfaces, people generally compute the true normal of each triangle that shares a particular vertex - then take the average of those to form a 'composite' normal for the surface at that vertex. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |