07-27-2010, 10:01 AM
I am currently developing a 3D CAD application by using glOrtho. How can I create a zoom, with the typical CAD features? I mean, the zoom tool in which the user makes 1st click with the mouse + dynamic window indicating zoom extencion+2nd mouse click (this is the end of zoom).
10-07-2010, 07:08 AM
Well, I'm not shure if this is the response you are looking for, but the actual "zooming" can be done with the glOrtho function, for example, if you first set your orthographic proyection to something like:
meaning that you have a coordinate system with the origin at screen's left-bottom and the screen right most position is 800 and the top most is 600
and you select with the mouse a rectangle at left-top P0( 200,400 ) and right-bottom ( 600,200 ), then you can zoom your view by changing the orthographic view to:
p0.x, p1.x, // left, right
p1.y, p0.y, // bottom, top
-1.0f,1.0f // near, far
01-02-2011, 03:04 AM
I solved the matter time ago. Actually it is required to do two things: glOrtho adjustment to the new captured window (i.e. the zoom window) and also to translate the coordinate system to the center of that box.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.