Here's how I would visualize a curved space — from
within that space:
For simplicity I'll address the case of a Riemannian 3-manifold. And I'll assume that we can figure out the shortest geodesics between any two points.
To visualize anything in a space, we need to have
something in that space. So let's assume our 3-manifold is called M, and suppose that we want to visualize a certain subset of M that we will call X — our
scene.
I) At each moment of time:
-----
a) Our eye will need to be
located at some specific point P in M.
b) At that point P, we will need to also know in what
direction away from that point are we looking. This will be some tangent vector v ∈ T
P(M).
c) Given P and v, there are 360º worth of directions perpendicular to v that might be our
vertical direction. This will be defined by some vector u ∈ T
P(M) (u for "up") satisfying
<u, v> = 0.
Then (P, V, u) completely determine the camera position P and orientation at P.
-----
II) Now we need some way to map the scene X onto our computer screen. But for simplicity we will first map it onto the unit sphere S
2 in the tangent space T
P(M):
S2 = {w ∈ TP(M) | ||w|| = 1}.
Here's what we do:
For each point w of S
2, we need to imagine extending the unique geodesic from P in the direction of w until it first reaches some point Q of the scene X.
III) We also need to have some source or sources of
light. Typically these are at some fixed location in our space M, but for sure they are at some fixed location at any moment of time.
IV) We also need to have decided on the
surface characteristics of the scene X, meaning how it reflects light at each of its boundary points. Typically these are some combination of a) specular and b) diffuse reflection, with some color being assigned to the diffuse reflection.
V) Our geodesic from P in the direction of w has first reached X at its point Q. At this stage we need to calculate the
color and intensity of the light that will be reflected by X at Q back in the direction of that geodesic from P to Q, except of course in the reverse direction.
VI) Then that color at that intensity will be what the viewer will see — but wait, we still have to
identify our screen rectangle with some portion of the sphere S
2 of unit tangent vectors at P. There are many ways to do this, but normally it's most important that the portion of S
2 identified with the screen rectangle have the horizontal (longer) direction of the rectangle identified with a comfortable viewing angle in S
2. This should be around 70º, that is, from 35º to the left of straight ahead to 35º to the right of straight ahead.
Using this identification, we know how to display the correct color and intensity at each point of the screen.
Note 1: Of course, we don't need to calculate any geodesics that don't pass through the screen rectangle, since they won't be displayed.
And, this writeup has done things a bit backwards, since it makes the most sense to go pixel by pixel on our screen first, then to figure out what color that pixel should be displaying. But I'll leave that part to you.
Note 2: Since this is obviously a complicated procedure, it would make the most sense to start with a very simple case for M, like letting M be the 3-sphere (the unit sphere S
3 in 4-space):
S
3 = {x ∈ R
4 | ||x|| = 1}.
In S
3, all geodesics are great circles, and the sectional curvature is always equal to 1. Which makes things considerably simpler than for a general Riemannian manifold.
Note 3: Some general software has already been written to visualize sufficiently simple scenes in sufficiently simple Riemannian manifolds. You may want to check out the freely downloadable Geomview at
http://www.geomview.org.