Subject: Re: Converting a mouse location to a 3d coordinate

From: [email-masked]. (Dan Benson)
Date: 17 Jul 92 14:49:16 GMT

In article <[email-masked]> [email-masked] (Ken Waletzki) writes:
>Howdie!
>
>I am in need of some assistance with a problem to covert an XY from
>a two dimensional plane to a location on a 3d surface.  For instance,
>say one calculates and displays a sphere on a computer screen.  I
>know how to calculate an XY coordinate from the lat/lon on a sphere,
>but now I want to reverse the process and take an XY coord, say
>maybe from a mouse locator, and return the lat/lon on the sphere,
>as well as returning an error when the mouse XY location goes off the
>sphere.
>
>Essentially this:
>
>	get_latlon(x, y, &lat, &lon);
>
>Thanks,
>    Ken Waletzki
>-- 
>Ken Waletzki Consulting, 2525 Arapahoe #E4-107, Boulder, Colorado  80302
>303-494-8953, email [email-masked]

I think this may be what you're looking for:

M. Chen, A Study in Interactive 3-D Rotation Using 2-D Control
Devices, Computer Graphics, vol. 22, no. 4, 121-129, August 1988.

This article discusses a virtual trackball interface for 3-D
rotation using a mouse. The idea is to superimpose a virtual
trackball in the view so that the ball's center is on the surface
of the screen with half the ball in the screen and half coming
out of the screen. Mouse clicks in the circle are interpreted as
clicks on the surface coming out of the screen. Rotation can
take place along all three axis using a 2-D mouse. The paper
includes calculations for converting a 2-D point to its
equivalent 3-D surface point.

--
Dan Benson                           Siemens Corporate Research, Inc.
(609) 734-3668                       755 College Road East
[email-masked]           Princeton, NJ  08540