Hi Folks,
I have a orthographic camera. With the help of this camera i'm able to render a quad onto the screen using screen-cordinates.
Using the camera i perform the zoom in/out on specific mouse position which is based on the pseudocode from http://www.gamedev.net/topic/541443-zoom-about-cursor-position/ post which all seems to work fine as expected.
Now the trouble i'm having is to resize the orthographic camera when the window size changes while i'm zoomed in.
Part of this issue is my quad now renders on the entire screen rather than the co-ordinates i specify.
If i now click on the window area then my quad is rendered correctly within the co-ordinates that I specify on window resize with the texture but i still see the texture image that was rendered on the entire screen before the quad is rendered on the appropriate co-ordinates..
If i'm completely zoomed out then resizing is fine and works as expected.
Any suggestions ?
If any code is required then do let me know as I'm happy to upload it here.
Thanks.
EDIT:
Code used for projection matrix:
// Prepare ViewProjection matrices
// Create the view matrix from our camera position, look target and up direction direct X uses left hand co-ordinate system
m_projectionMatrix = Matrix.OrthoOffCenterLH(0, (float)m_displaySize.Width, (float)m_displaySize.Height, 0, 0f, 100.0f);
m_viewProjectionMatrix = m_viewMatrix * m_projectionMatrix;
m_perObject.ViewProjection = m_viewProjectionMatrix;
// perform the Transpose of the matrices
m_perObject.Transpose();
Screenshots:
Screenshot 1: Normal display:
[attachment=31658:Normal.JPG]
Screenshot 2: No zoom resize
[attachment=31657:Normal resize.JPG]
Screenshot 3: Zoomed in
[attachment=31659:Zoomed in.JPG]
Screenshot 4: Error when zoomed in but resized
[attachment=31656:Error when zoomed.JPG]
Screenshot 5: Invalid display when zoomed but when performing zoom again on mouse click
[attachment=31655:Error when zoomed after mouse click.JPG]