Orthogonal camera zooming panning ratio

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Phxx
Posts: 13
Joined: Wed May 10, 2006 7:55 pm

Orthogonal camera zooming panning ratio

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
Phxx
Posts: 13
Joined: Wed May 10, 2006 7:55 pm

Post by Phxx »

Yes That could very well be, I'll try that.

In the mean time, nobody knows how to move the orthogonal camera?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Re: Orthogonal camera zooming panning ratio

Post 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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply