Zoom an image on a Personal Iris
Brent L. Bates AAD/TAB MS361 x42854
blbates at AERO4.LARC.NASA.GOV
Thu Aug 9 21:53:27 AEST 1990
What I do is a call to perspective (or in your case ortho.)
Then I call lookat(viewpnt-delta,ypos,zpos,viewpnt,ypos,zpos,-900),
next I call rot with my three angles.
Above I use viewpnt to zoom in and out, and ypos/zpos for
translating the image up/down left/right.
At the beginning of each loop to draw my objects I set:
viewpnt=viewpnt-zoomrate
ypos=ypos+yrate
zpos=zpop+zrate
etc. for other transformations.
The rate parameters equal the previous rate + the change in
mouse position times some scale factor.
The way I have things set up, as long as the mouse button is
pressed you keep zooming (or translating/rotating/etc.) I can
also use all the buttons at the same time. The last button pressed
is the only one that changes its rate value.
For example: I use my left button for rotations, middle button
for zooming (as well as some other things), and the right button to
translate. If I push the middle button and move the mouse, I increase
the rate of zoom. If the mouse is stationary, the zoom rate stays
constant. If I press another button, while keeping the middle one
down, I change the new rate value, but keep the zoom rate constant.
This gives me a lot of control and freedom to do multiple transformations
at one time.
Hope this helps some. I think I posted some sample source a
long time ago, it is probably in the info-iris archives on vgr.brl.mil
--
Brent L. Bates
NASA-Langley Research Center
M.S. 361
Hampton, Virginia 23665-5225
(804) 864-2854
E-mail: blbates at aero4.larc.nasa.gov or blbates at aero2.larc.nasa.gov
More information about the Comp.sys.sgi
mailing list