Prespective view to Orthographic view transition.

Started by
4 comments, last by Kitasia 14 years, 7 months ago
Is there anyway to convert a perspective view to an orthographic view? Lowering the field of view seems to work but camera distance becomes a large issue. In case you wondering, no I have no clue what goes on behind the scenes when it comes to cameras and matrices.
Advertisement
What are you trying to get from the conversion? Perspective and orthographic projections are different, so a conversion depends on what you want to do.
The basic idea is converting from a 3D view to a 2D view without the camera distance changing but the focus on the target remaining the same. I think I've gotten close by simply modifiying the perspective matrix but now I'm presented with a clipping plane issue.
Just a though, have you tried element wise interpolating the matrices? I dont know if it will work, but you might be lucky.

What are you using?

If you "modified" perspective matrix, it does mean you can change it, doesn't it? Why can't you modify it into a orthographic matrix?
Camera position and target are in view matrix, I don't think they would be affected by your perspective/orthographic matrix anyway.

I did the pipeline by software once, if you tell me what you are using I can probably help.
Rosália G. Schneiderhttp://rosaliaschneider.wordpress.com/
Sorry completely forget about this thread, kinda gave up on the idea. I'm using XNA which uses the Matrix class for the projection. Lerping the matrix for whatever reason did not work. But setting M44 (row 4 column for) to the distance away from the target and setting M34 to zero gave me the proper distance from the target and an orthographic view but there is still the clipping plane issue.

I don't know why modifying the field of view makes the target look much much farther or closer but OpenGL gave me the same problem so I just assumed it was something normal.

Update:

Actually lerping does work! I think I was doing it in too large a scale before.
Thanks!

This topic is closed to new replies.

Advertisement