Hi all,
I am using a 3rd-party "rotator" object, which is providing a smooth, random rotation along the surface of a sphere. The rotator is used to control a camera (see rotator.h/c in source code for xscreensaver).
The output of the rotator is latitude and longitude. What I want is for the camera to stay above the "equator" - thus limited to a hemisphere.
I'd rather not modify the rotator itself. So I could take the latitude output and use the absolute value of it. However, smooth rotator movement across the equator would not produce smooth camera motion: it would bounce.
I suppose I could scale output latitude from the rotator from its current range to my target range: e.g. f(lat) = (lat+1)/2 would map the (0, 1) range to (0.5, 1). I.e. map the whole "globe" to the northern hemisphere. The movement would still be smooth. But what would be intended as the "south pole" by the rotator would become the "equator" for my camera. Wouldn't that result in strange motion? Maybe discontinuities? I'm not sure.
Is there another way to map a sphere (latitude and longitude) to a hemisphere, smoothly?
Update:
Thanks for your attention and responses. A couple of people have asked for clarification on "smooth". I mean not jerky: a small change in velocity of the rotator should be mapped to a small change in velocity of the camera. If I just took the absolute value of the latitude, a zero change in velocity of the rotator as it crossed the equator would translate to an abrupt sign-flip of the velocity of the camera (a.k.a. a bounce).
IIRC this is equivalent to requiring that the first derivative of the velocity be continuous. Continuous second derivative might be nice but I don't think it's essential.