Off-axis perspective projection is useful when the viewer's eyes aren't perpendicular to the center of the screen. Example applications for this are caves (multiple screens surrounding the viewer) and stereo views (see e.g. 9.080 in http://www.opengl.org/resources/faq/tec ... ations.htm)
I looked at the Camera class, but didn't find anything about this, nor about supplying your own projection matrix. Perhaps SceneManager::manualRender can be used directly, but that seems unnecessary complex.
Off-axis perspective projection
-
grimm
- Gnoblar
- Posts: 11
- Joined: Sat Feb 12, 2005 12:39 am
- Location: Sweden
-
grimm
- Gnoblar
- Posts: 11
- Joined: Sat Feb 12, 2005 12:39 am
- Location: Sweden
I think it actually is quite easy to add this support to Ogre, since the functions for creating the matrix is already there (the second overload of RenderSystem::_makeProjectionMatrix). This function corresponds to glFrustum where you can specify different values for left/right and top/bottom.
It can be supported by adding the following to the class Frustum:
- One more projection type, perhaps calling it PT_WINDOW.
- Four new member variables: left, right, top, and bottom.
- Member function(s) for setting these member variables.
- Code for handling the new projection type in updateFrustum() (just calling the function mentioned above).
However, perhaps it is not very clean to add even more members to Frustum, especially since they will only be used for this type of projection (and then the other member will not be used).
I can create a patch for this, but it would be good to know what others think first.
It can be supported by adding the following to the class Frustum:
- One more projection type, perhaps calling it PT_WINDOW.
- Four new member variables: left, right, top, and bottom.
- Member function(s) for setting these member variables.
- Code for handling the new projection type in updateFrustum() (just calling the function mentioned above).
However, perhaps it is not very clean to add even more members to Frustum, especially since they will only be used for this type of projection (and then the other member will not be used).
I can create a patch for this, but it would be good to know what others think first.
- AmitMathew
- Gnoblar
- Posts: 21
- Joined: Mon Jul 21, 2003 3:48 pm
- Location: Athens, GA, USA
- Contact:
-
pgavigan
- Gnoblar
- Posts: 22
- Joined: Wed Jun 06, 2007 7:09 pm
- Location: Carleton University, Ottawa Ontario Canada
Hey there,AmitMathew wrote:I would be interested in seeing this. On my to-do list is to add support to Ogre for different VR displays but I haven't really had a chance to research into what is necessary to pull this off. I would be interested to see what you come up with.
Amit
I'm working on a v-cave right now, and am wondering if anything ever came of this? Do you know of any easy way for me to set this up off hand?
Patrick
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Code: Select all
Ogre::RenderSystem::_setProjectionMatrix(someMatrix);
Ogre::RenderSystem::_setViewMatrix(m);
Ogre::RenderSystem::_setWorldMatrix(Ogre::Matrix4::IDENTITY);
The camera has go a transform setting function too.
/* 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.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact: