Fixing the triangulation of the Parametric Surfaces.
@lorensen noticed that the front face of orientable surfaces was being displayed as a back face. This arose as a "hack" when these functions were first implemented because the cross-product used to create the normals was right-handed, thus the triangulation orientation was clockwise. Additionally there were weird triangulations in the ParametricSuperEllipsoid and ParametricSuperToroid.
The following fixes have been applied:
- The orientation of the normals is fixed in the case of anti-clockwise ordering by calculating cross(Dv,Du) instead of cross(Du,Dv). When this is done the normals point in the expected direction and the front face is rendered correctly. See: vtkParametricFunctionSource.cxx.
- All the surfaces now implement anti-clockwise ordering with respect to the triangulation.
- The ParametricSuperEllipsoid and ParametricSuperToroid have been reworked, now the surface is constructed as four pieces that are abutted together, this removes the triangulations resulting in weird appearances.
- In order to implement the anti-clockwise ordering in the triangulation the x, y points have had to be swapped in a few cases.
- TestParametricFunctions.png has had to be replaced. The images for ParametricTorus, ParametricSuperEllipsoid and ParametricSuperToroid changed as a result of the above changes.