In my 3D perspective view, I’m drawing a (rotated) surface, and I want the user to be able to zoom in and out, and click and drag the surface to translate it (one-to-one movement with the mouse). The zoom is done by holding a key and using the mouse wheel, and this is simply translating down the z-axis (I specify my camera with gluLookAt, initially pointing down negative z-axis, and all rotations are done in local coordinate frame).
If I want to simply click and translate, shouldn’t it be as simple as: 1) store click x, y, z obtained by gluUnproject in the mouse down event, 2) add the delta x, y, z from the “click” in the mouse move event, and 3) add that to my cumulative glTranslate? Keep in mind that the scene can be zoomed or rotated, which is why I thought I needed to gluUnproject.
It seems like a simple concept, and I remember coding it for a (now lost) program, but I don’t have a ton of time to work on this smaller detail. Any help is appreciated!