Page 1 of 1

Orthogonal camera zooming panning ratio

Posted: Sat May 20, 2006 10:10 am
by Phxx
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

Posted: Sat May 20, 2006 10:27 am
by JP
I would think that possibly the reason your cube appears as a rectangle is to do with the fact you shouldn't have width and height the same? Not too sure myself but wouldn't it need to be the same ratio as the screen? Similarly to how your desktop resolution isn't square, it's rectangular, i.e. something like 1024x768, not 1024x1024.

Posted: Mon May 22, 2006 6:46 am
by Phxx
Yes That could very well be, I'll try that.

In the mean time, nobody knows how to move the orthogonal camera?

Re: Orthogonal camera zooming panning ratio

Posted: Mon May 22, 2006 2:06 pm
by bitplane
I have nothing useful to add on moving the orthogonal camera, but for moving the whole scene you could have a common parent for all nodes and just move that instead.