Zooming diaginal in corners?

Started by
2 comments, last by dpadam450 11 years, 9 months ago
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]Hi ,[/background]

[/font]
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]I have a sphere that I need to be able to Zoom in and out with. [/background]

[/font][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)] I do this by using the mouse to get a deltaZ value and then plug this deltaZ into glTranslate(). This method works great when my sphere is sitting in the center of the screen, but if I move it to the corners or the sides of my viewport(by calling glTranslate with a different X and Y value), it zooms and goes in a diaginal direction (in X and Y). Please note that there is only one glTranslate call in my code and it is in my draw method. All the values that change the X, Y or Z values are passed into this draw method. Any ideas on what my problem could be and how to fix it?? [/background]

[/font]

Advertisement
That's how perspective works.
If you don't want any perspective in your image, then you can use an orthographic projection matrix instead of a perspective projection matrix.
Thanks for reply,
I want to zoom in/out and rotate the sphere like google earth.
Zooming is done by changing your field of view call in gluPerspective.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement