Questions About Zooming and Scaling

Hello I’m in a bit of a stand still, I’m trying too figure out how some vector editing programs do a few things. Right now my 2 main questions are below.

  1. Figuring out the mouse position in a second 2D Orthro with zoom?

I have a second Ortho for the scene I want too zoom in on and such, but when I zoom in or out that means my mouse position is messed up with the scene I’m editing. This is how I figure out the mouse position in the second 2D Ortho:


	int ImageHalfWidth = RenderImageWidth / 2;
	int ImageHalfHeight = RenderImageHeight / 2;
	int halfw = (windowWidth / 2) - ImageHalfWidth;
	int halfh = (windowHeight / 2) - ImageHalfHeight;

			Vector2D vec = Vector2D(MouseCurPos.m_X-ViewPos.m_X-halfw, MouseCurPos.m_Y-ViewPos.m_Y-halfh);

MouseCurPos of course means mouse position and the ViewPos is the position the camera is currently at XY with the second 2D Ortho.

  1. I can’t figure out how too scale a polygon by hand. Is there a way instead of having too use glScale too scale a 2D polygon? I need too get the new position of the vertexes, so I can save them in a file.

Thanks, Andrew.