Hi All,

I have a little problem I'm trying to solve in my polytope viewer. The basic idea is this: I want to render some 4D objects with curved surfaces (e.g., the cubinder) by approximating said surfaces with ridges. These ridges are projected from 4D to 3D, and then broken up into triangles so that povray can render them. For best results, I'd like to interpolate surface normals in the resulting 2-manifold, so that it will actually appear as a smooth surface instead of a faceted surface.

However, here's a little problem here: a 2-manifold projected from 4D can be oriented either way (surface normal pointing one direction or its opposite direction). For individual ridges, we can simply pick any direction and it will be fine; however, to have consistent interpolation between adjacent ridges (triangles), there needs to be a way to consistently pick a normal direction so that adjacent ridges will be oriented the same way. (Otherwise, normal interpolation will go haywire.) But there is no guarantee that the projected 2-manifold is actually orientable! (E.g., if one projects the Klein bottle...)

Barring non-orientable surfaces, is there an efficient algorithm to compute surface normals such that the normals for each ridge will be consistent with its neighbours? Normally, for auto-generated 3D surfaces, this is not a problem because the generating code already knows which way the normals should point; the problem here is that we are projecting from 4D, and in 4D 2-manifolds don't have "surface normals". So we are given a set of ridges (triangles) projected to 3D, and we need to consistently compute surface normals for them.

Any hints?