# Orthographic projection help

5 replies to this topic

### #1 JYoshi10

JYoshi10

GMC Member

• New Member
• 23 posts

Posted 24 January 2012 - 01:35 AM

Hello,
I was wondering if it would be possible use an orthographic projection in the same way you would use a perspective one. Say you have a camera at the bottom-center of your room looking from point 100 in the air to the center of the floor in the room. Normally you would use a perspective projection but I want to use an orthographic one. An example (from Blender):
Perspective:

Ortho (from the same point):

If this is possible, how would I do it?

Edited by JYoshi10, 07 February 2012 - 05:31 AM.

• 0

### #2 JYoshi10

JYoshi10

GMC Member

• New Member
• 23 posts

Posted 07 February 2012 - 05:32 AM

Can someone help me please? My game would be a lot better with this effect.
• 0

### #3 TheSnidr

TheSnidr

That guy

• Global Moderators
• 2440 posts
• Version:GM:Studio

Posted 07 February 2012 - 05:56 AM

Try increasing the distance between the camera and the point you're looking at while also decreasing the angle of the view frustum (the angle should be a function of the distance, a trigonometric function I don't remember at the moment, but try a little).
Isometric graphics are the ultimate form of this method, and are defined as the view from a camera infinetely far away zooming in the same amount (which is quite absurd if you think about it)

Edited by TheSnidr, 07 February 2012 - 06:08 AM.

• 0

### #4 Gamer3D

Gamer3D

Human* me = this;

• GMC Member
• 1590 posts
• Version:GM8.1

Posted 08 February 2012 - 06:19 PM

You can use the d3d_transform functions to rotate/scale/move your scene, while using the default orthographic perspective. Good luck.
• 0

### #5 JYoshi10

JYoshi10

GMC Member

• New Member
• 23 posts

Posted 13 February 2012 - 06:09 AM

TheSnidr, I tried your suggestion and it seems to have worked, although I didn't make a function for it, I just hard-coded the values in. It looks pretty good with the y- and z-values +2000 and a FOV of 5 (the camera doesn't move, so I don't really need a function). I also tried Gamer3D's method but found that the camera was looking at the underside of the floor.
• 0

### #6 Gamer3D

Gamer3D

Human* me = this;

• GMC Member
• 1590 posts
• Version:GM8.1

Posted 13 February 2012 - 08:04 PM

TheSnidr, I tried your suggestion and it seems to have worked, although I didn't make a function for it, I just hard-coded the values in. It looks pretty good with the y- and z-values +2000 and a FOV of 5 (the camera doesn't move, so I don't really need a function). I also tried Gamer3D's method but found that the camera was looking at the underside of the floor.

Camera was looking at underside of floor? Rotate the scene using d3d_transform commands, as suggested earlier.

Anyway, for the formula you should be using for TheSnidr's suggestion, read the Wikipedia article on Dolly Zoom. Same idea.
• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users