Sign in to follow this  
moeron

Parallel / Orthographic projections

Recommended Posts

I'm writing a plugin (a scene file exporter) for a modeling program, Rhinoceros to be specific, and when I render my scene files the views do not match what I see in the app. I'm having a bit of trouble understanding something about parallel projections. I guess they are really orthographic projections (the front - right, etc... ). I was told the field of view is not a factor for these views, that a zoom factor is what actually controls the view. However, varying fields of view do alter the resultant view so I'm a bit lost. Should there be some fixed field of view that all orthographic views have? At first I was thinking that it would be a 90 degree field of view at all times since orthographic views are perpendicular to the plane of projection, but I suppose I am wrong in this? I've done a lot of googling on the subject, but I have seen no sites that mention that a parallel or orthographic view is suppposed to have a locked FOV.

Share this post


Link to post
Share on other sites
Quote:
Original post by moeron
[...]
I was told the field of view is not a factor for these views, that a zoom factor is what actually controls the view. However, varying fields of view do alter the resultant view so I'm a bit lost. Should there be some fixed field of view that all orthographic views have? At first I was thinking that it would be a 90 degree field of view at all times since orthographic views are perpendicular to the plane of projection, but I suppose I am wrong in this? [...]


You shouldn't think of this as FOV angles; theses angle only come into play with perspective projection, where the projection matrix maps a pyramid-shaped volume into a normalized cuboid.

Orthographic projections on the other hand, don't scale things with respect to their distance from the view point. Thus the visible volume is not a pyramid-like solid in space, it is already a cuboid.
All you need to determine is its desired width and height, and this is what actually defines the "FOV" in this case. Their ratio should comply with the viewport's dimensions.
Once you've determined these dimensions you can use the following projection matrix to transform vertices in screen space:

[ 2/width 0 0 0 ]
[ 0 2/height 0 0 ]
[ 0 0 1/(z1-z2) z1/(z1-z2)]
[ 0 0 0 1 ]

z1,z2 are the near and far clippling planes z=z1 and z=z2
If your system is left-handed, negate camera Z. This is usually performed by the projection matrix, by negating its (3,3) member.
Column-major vector convention is assumed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this