: Zoom, pan, rotate with mouse

: Zoom, pan, rotate with mouse

Post by Daniel G. Hyam » Wed, 01 Apr 1998 04:00:00



Hello all;

Is there some code or pointers for handling zooming, panning,
and rotating a scene with the mouse (assuming a three-button
mouse).  I am looking for info on how the movement of the
mouse, during a mouse drag, relates to the projection matrices
such that the user gets a smooth and intuitive pan, zoom, or
rotate.

-----------------------------------------------------------
Daniel G. Hyams

phone:  (601) 323-4198  
-----------------------------------------------------------

 
 
 

: Zoom, pan, rotate with mouse

Post by Stephen Gan » Thu, 02 Apr 1998 04:00:00




Quote:>mouse).  I am looking for info on how the movement of the
>mouse, during a mouse drag, relates to the projection matrices
>such that the user gets a smooth and intuitive pan, zoom, or
>rotate.

Well, if you wanted mouse movement to map to rotation, then you'll
probably want left and right mouse movement to map to angles of rotation
about the y-axis.  You'll probably also want up and down mouse movement to
map to angles of rotation about the x-axis.  These angles would comprise
your modelview matrix.  

One way to "zoom" is to simply translate the scene closer to you.  This
will not effect projection or field of view, so it's not really zooming -
so I'm not sure it's really what you're loking for.  This translation
amount would also effect your modelview matrix.  If you really want to
zoom and change the projection, you'll need to affect the projection
matrix.  

For panning, again, you would just map left and right, up and down mouse
movements to x and y translations.  Then you would affect your modelview
matrix with these new translations.

Steve

 
 
 

1. Pan, Zoom+, Zoom-, Zoom Window, Rotate and Redraw

Ok....with your help (Ananth B. & Rene) I was able to draw points on a
canvas, along with small circles and squares. My next step is to be able to
perform the options I described in the subject line (Pan, Zoom+, Zoom-, Zoom
Window, Rotate and Redraw). Your help is greatly appreciated.

2. Simple and double buffer

3. Zoom - Rotate - Pan

4. S.O.S. I need for 3DS4...

5. rotate,zoom,pan & screendump

6. AVS/Express users

7. zoom-in zoom-out in mouse-clicks

8. SVG Pan Zoom buttons

9. Web page 3D image/rotation (pan/zoom?)

10. pan/zoom drawPixels/lrectwrite

11. Detecting panning/zooming

12. VUIMAGE Ver 2.1 GIF/TIFF viewer, Zoom/Pan Herc/C/E/VGA/SupVGA submitted