Im still a newbin in this and I really dont underestand the difference between perspective and orthographic projection. Anyway, everybody says that it is the best choice to implement an isometric like view, so, i started working.
The problem is that I draw my terrain, put a robot mesh and place camera at (200,200,200). That worked fine in normal mode, but if I set camera in ortho mode, the view gets inside mesh. No matter how far I move the camera, still the mesh interferes with the view, actually there is not much difference between 200 or 1000. So, i guess Im doing something wrong here, but, what is it? Do I need to do something special before setting ortho mode? Or simply should I try placing camera 100 times far away?
problem underestanding orthographic projection
- rogerdv
- Gnome
- Posts: 351
- Joined: Fri May 09, 2003 10:43 pm
- Location: Cuba
- x 1
- Contact:
-
- Greenskin
- Posts: 116
- Joined: Tue Jun 12, 2007 10:28 am
the difference between perspective and orthographic projection is:
With perspective projection distant objects appear smaller, the view frustum (the area you see on screen) is shaped like a pyramid with its tip cut off (you sit at the smaller side). With orthographic projection distant objects don't get smaller, your view frustum is a cuboid. The far plane has the same size as the near plane. Parallel lines in space remain parallel.
Because distant objects don't get smaller with orthographic projection you normally can specify the size of the near plane / the view area. I don't know about Ogre, because I'm quite new to it, but there should be a way to do that. Moving the camera away won't change a thing about what you see.
With perspective projection distant objects appear smaller, the view frustum (the area you see on screen) is shaped like a pyramid with its tip cut off (you sit at the smaller side). With orthographic projection distant objects don't get smaller, your view frustum is a cuboid. The far plane has the same size as the near plane. Parallel lines in space remain parallel.
Because distant objects don't get smaller with orthographic projection you normally can specify the size of the near plane / the view area. I don't know about Ogre, because I'm quite new to it, but there should be a way to do that. Moving the camera away won't change a thing about what you see.
- syedhs
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
Maybe what you need is 'zoom' feature within Orthographic projective mode. For that matter, here is the thread: http://www.ogre3d.org/phpBB2/viewtopic.php?=&p=214034
- rogerdv
- Gnome
- Posts: 351
- Joined: Fri May 09, 2003 10:43 pm
- Location: Cuba
- x 1
- Contact:
- walaber
- OGRE Expert User
- Posts: 829
- Joined: Sat Oct 02, 2004 2:20 pm
- Location: California, USA
- Contact:
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
http://www.ogre3d.org/phpBB2/viewtopic.php?p=241989walaber wrote:what kind of game are you trying to make that requires an orthographic view?
http://www.ogre3d.org/phpBB2/viewtopic.php?p=242150
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Greenskin
- Posts: 116
- Joined: Tue Jun 12, 2007 10:28 am
In the thread linked by syedhs, Sinbad explains a solution that should work for you.
There should be a function called setOrthoWindow(Real w, Real h) which should do just what you need. 'w' and 'h' define the size of the window in world units. You can try and imagine that as a rectangle through which you will look. The bigger that rectangle is, the "farther" away you seem to be, i.e. the smaller objects will get. Perhaps that helped.
There should be a function called setOrthoWindow(Real w, Real h) which should do just what you need. 'w' and 'h' define the size of the window in world units. You can try and imagine that as a rectangle through which you will look. The bigger that rectangle is, the "farther" away you seem to be, i.e. the smaller objects will get. Perhaps that helped.
- rogerdv
- Gnome
- Posts: 351
- Joined: Fri May 09, 2003 10:43 pm
- Location: Cuba
- x 1
- Contact:
You can see in the threads posteb by jacmoe.walaber wrote:what kind of game are you trying to make that requires an orthographic view?
After some reasoning I found why ortho is the best mode. In perspective mode objects in the "lower" side of screen are "closer" to camera , so they should look bigger than the objects in the "upper" side. In ortho mode, all objects will seem to have the same size. Thats why the screenshot from daimonin 3d client looks so different to my application and so similar to old style isometric games.