Orthogonal camera zooming panning ratio
Posted: Sat May 20, 2006 10:10 am
Hi all,
I really need to know how to zoom and pan an orthogonal camera.
One of the things i thought of to zoom the camera, is rebuild the projection matrix each time with a smaller width and height to make it look like it zooms.
MyMatrix.buildProjectionMatrixOrthoLH(width,height,500.0f,-10000.0f);
A problem I encounter when doing this is that for some reason I cannot get the projection matrix to have the right ratio. For example if i place a cube of 50x50 and build the projection matrix with width and height 1000.
the cube looks like a rectangle and not like a cube.
Panning is something which I cannot get to work, does anyone have an idea? I tried to PM one of the members here who said he knew how to do it, but he did not respond
One of the member said it was easier to move the whole world, but i guess that would mean finding each scenenode and moving it. This is not an option in a multiplayer environment.
Anyone who knows how to do this please take some time to answer this post, it will be greatly appreciated.
Phxx
I really need to know how to zoom and pan an orthogonal camera.
One of the things i thought of to zoom the camera, is rebuild the projection matrix each time with a smaller width and height to make it look like it zooms.
MyMatrix.buildProjectionMatrixOrthoLH(width,height,500.0f,-10000.0f);
A problem I encounter when doing this is that for some reason I cannot get the projection matrix to have the right ratio. For example if i place a cube of 50x50 and build the projection matrix with width and height 1000.
the cube looks like a rectangle and not like a cube.
Panning is something which I cannot get to work, does anyone have an idea? I tried to PM one of the members here who said he knew how to do it, but he did not respond
One of the member said it was easier to move the whole world, but i guess that would mean finding each scenenode and moving it. This is not an option in a multiplayer environment.
Anyone who knows how to do this please take some time to answer this post, it will be greatly appreciated.
Phxx