Mike Weber posted a question on povray.general about smooth triangles and normals. This page should explain how normals work in smooth triangles. I will be leaning heavily on an explanation found at Warps Mesh Smoother.
| Part One Setting up a triangle | |
|---|---|
|
In this first section we will explore how three different normal vectors at each vertice of the triangle effect the normal vector on different points on each triangle. The next section will explore smoothing several triangles in a mesh. To the right we see a simple triangle and three individual vectors
Notice how the triangle is highlighted. The far corner has a normal vector that points towards the light, so it is higlighted, but the closer corner to the left is creating a shadow because it points away from the light. (The light is at <-30,30,-30>.) Now we need to check random points on the triangle, calculate their normals, and display them. Here is a bit more code:
This sloppy bit of code is probably not accurate, but it seems to work.
|
![]() 1. A Smooth Triangle ![]() 2. Some calculated normals ![]() 3. More calculated normals |
Thanks for watching.