Jump to content
  • Advertisement
Sign in to follow this  
Haris072

Zooming diaginal in corners?

This topic is 2263 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!