Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Zooming diaginal in corners?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Haris072   Members   -  Reputation: 112

Like
0Likes
Like

Posted 13 July 2012 - 11:22 PM

Hi ,


I have a sphere that I need to be able to Zoom in and out with.

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??



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 13558

Like
1Likes
Like

Posted 13 July 2012 - 11:38 PM

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.

#3 Haris072   Members   -  Reputation: 112

Like
0Likes
Like

Posted 14 July 2012 - 03:07 AM

Thanks for reply,
I want to zoom in/out and rotate the sphere like google earth.

#4 dpadam450   Members   -  Reputation: 537

Like
0Likes
Like

Posted 14 July 2012 - 12:09 PM

Zooming is done by changing your field of view call in gluPerspective.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS