Orthogonal Tutorial

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Guest

Orthogonal Tutorial

Post by Guest »

I can't find where exactly the tut is. The link is here: http://www.saigumi.net/archives/000067.html

but I can't seem to find it on the page.

Can you please point out where it is?

-Thank you-
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

Post by Conquistador »

It's also in the Wiki.
Royal Hamilton Light Infantry - http://www.rhli.ca
Paris/Port Dover Pipes'n Drums - http://www.parisdover.ca
Guest

Post by Guest »

O, thank you, didn't know that :D
AnTeevY
Posts: 6
Joined: Mon Dec 04, 2006 7:26 pm

Post by AnTeevY »

The Wiki's also down :/
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

life is ironic isn't it?

good old murphy.
Vox
Posts: 47
Joined: Fri Apr 01, 2005 5:25 pm

Post by Vox »

Midnight wrote:life is ironic isn't it?

good old murphy.
Life is hard, but unfair.
AnTeevY
Posts: 6
Joined: Mon Dec 04, 2006 7:26 pm

Post by AnTeevY »

Bah, is there another orthogonal tutorial?
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

Why do we need another one?
AnTeevY
Posts: 6
Joined: Mon Dec 04, 2006 7:26 pm

Post by AnTeevY »

Another one? No, just one, but saigumi.net and the Wiki are down.
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

AnTeevY wrote:Another one? No, just one, but saigumi.net and the Wiki are down.
Maybe we need a more stable wiki? I'm not sure that I have the bandwidth to run one on my site, but again I'm not sure.
AnTeevY
Posts: 6
Joined: Mon Dec 04, 2006 7:26 pm

Post by AnTeevY »

So there's nobody who's got that (or a similar) tutorial?
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

I used to have it, but I deleted it because I couldn't get the camera how I wanted it.. I didn't want large sections of the view to be cut off, and that's what the tutorial was giving me.
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Ill post orthogonal tut from wiki here but ill need 2-3 days
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Orthogonal Tutorial
[edit]
Download

The package for this tutorial can be downloaded at http://irrforge.org/images/c/c5/Orthogonal.zip
[edit]
What does Orthogonal mean?

From the Computing Dictionary: "N mutually orthogonal vectors span an N-dimensional vector space, meaning that, any vector in the space can be expressed as a linear combination of the vectors. This is true of any set of N linearly independent vectors."

Now that your brain is fried, let me give you my own definition.

Orthogonal(sometimes referred to as Orthogonical): rendering without perspective

Quick Note: This does not mean "a way to reduce 'fish-eye'". To reduce 'fish-eye', you should really work with your Field-of-View (FOV), Aspect Ratio, and Near/Far planes.

In Orthogonal, you do not have perspective. NONE AT ALL. If you took a 1x1x1 block and put it at 0x0x0 and took another 1x1x1 block and put it at 2x0x100 they would look identical. There would be no change in size.
[edit]
How do you create an orthogonal view?

To create an orthogonal view, you define a projection matrix for your viewing area. In a perspective world, the projection matrix starts as a pinhole and expands out as a cone. You can simulate this by taking a piece of paper, poking a hole in it, and looking through. In an orthogonal world, you have a box. You can simulate this by getting a cardboard box and looking into it.

Think about the dimensions of a box, you have a height, a width, a back side, and a front side. Building the matrix requires these exact parameters.

buildProjectionMatrixOrthoLH(width,height,near plane,far plane)

So, say in your world, you want a carboard box that is 16 units wide, 12 units tall, and 7 units deep. You might think:

buildProjectionMatrixOrthoLH(16.0f,12.0f,0.0f,7.0f)

While this would work, there is a slight problem with it. Say you have a 1x1x1 cube and you put it in the center of the world at 0x0x0. It wouldn't be rendered. It would in a normal perspective world, you would see the back half of it, but not the front half. In an orthogonal world, the cube wouldn't be drawn at all as the front of it would be behind the camera. So, what I have done is moved the near and far plan into a middle ground.

buildProjectionMatrixOrthoLH(16.0f,12.0f,-3.5f,3.5f)

Now, if you look at the code attached in the zip, you may notice that something is different. The near and far planes are reversed. Why the heck is the far plane behind the camera?

buildProjectionMatrixOrthoLH(16.0f,12.0f,3.5f,-3.5f)

For some reason, Irrlicht's rendering order is backwards of what intuition tells you. Reversing the near and far plane will reverse the rendering order. Try reversing the values to see what happens.
[edit]
Tips

With an orthogonal projection matrix, their is no half-on/half-off the viewable area. It's either on or off
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
TheRLG
Posts: 372
Joined: Thu Oct 07, 2004 11:20 pm

Post by TheRLG »

With an orthogonal projection matrix, their is no half-on/half-off the viewable area. It's either on or off
This is why I don't like orthogonal, I want orthogonal, but I want things to be able to be half on/off.
Post Reply