Bsplines Splines and Mesh Normals
Bsplines Bsplines are a way to create a very smooth non-interpolating spline. "Non-interpolating" means that the spline itself does not pass through the guide points. It is created by successive convolutions, where B0 is a pulse, and B3 is the final Bspline spread function:
For any unit width segment, the value within that segment is a cubic function which is the sum of four cubic functions, each a different part of B3:
We can rewrite these four cubic functions as the Bspline Matrix:
Computing mesh normals If you create a general parametric surface mesh, there might not be an easy formula to compute a surface normal at each vertex. In such cases, there is a method you can use to compute the vertex normals. It proceeds in two steps:
To do step (1) above, you need to sum up the cross products of each pair of neighboring edges in the face: For an N sided face:
faceNormal = [0,0,0] for (i = 0 ; i < N ; i++) { a = v[i+1 mod N) - v[i] b = v[i+2 mod N) - v[i+1 mod N] faceNormal += cross(a, b) } To do step (2) above, just sum up the faceNormals for all faces that meet at that vertex, and then normalize.
|