|
How to compute vertex normal for triangle?
Hello All,
I have the following question related to graphics project using C, related to Vertex Normal for triangle:
For the smooth shading, normal at each vertex needs to be computed. To compute the normal at a vertex, we average the surface normals of the polygons sharing that vertex. In our lab3 assignment, how could it be done? How would I know the polygons sharing the specified vertex? Do I need to check the vertex list of all the triangles in the OFF file and mark those triangles that contain the vertex under consideration. Then compute the surface normal for each of those marked triangles and average them to get normal at a vertex. Is it the right way to compute a normal at a vertex? I think this is quite tedious. Is there any simple way to compute the normal at a vertex?
Thanks a lot.
|