# How to switch Perspective to Orthogonal projection while keeping things in almost same size?

This topic is 2246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,I want to change my projection matrix from Persective to Orthogonal way.I use the same width,height and other properties,so I get bigger things showing on the screen.My question is how to modify the projection matrix so I can get simillar size as Perspective Projection?

##### Share on other sites
The size of an object in perspective projection depends on its distance from the viewpoint. First you have to define a distance within the view volume where you want objects from the perspective and the orthographic projections to have the same sizes. And secondly, which way are you going; do you have an orthographic projection and want a similar perspective one, or the other way around?

##### Share on other sites
Actually, I don't need that information to give an answer, but you need it yourself when you plug in some numbers to get an actual projection matrix.

The size of a perspective projection at depth d is
 width = d*tan(fov/2); height = aspect*d*tan(fov/2); 
where fov is the full vertical field of view, and aspect is the width-to-height aspect ratio of the view volume. At this particular depth d, the visible coordinate system range from -width to width in the horizontal direction, and from -height to height in the vertical direction.

Based on that, you can set up the orthographic projection with the width and the height values. At depth d in the perspective projection, objects will have the same size as in the orthographic projection.

If you need to go the other way around, solve for fov given the width or height instead. The two are linked by the aspect parameter so they are effectively the same parameter.

1. 1
2. 2
Rutin
13
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633261
• Total Posts
3011127
• ### Who's Online (See full list)

There are no registered users currently online

×