Stereoscopic view, glFrustum

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Akiko
Posts: 7
Joined: Sun Mar 13, 2005 10:26 pm

Stereoscopic view, glFrustum

Post by Akiko »

Hi.
Sorry if it isn’t advanced topic.

I need to set up stereo view – two viewports and two cameras with different position. I’ve read posts about multiple cameras but now my question is a little different.

In stereoscopic the best results we get using asymmetric view –
(I am not sure the definition but in opengl we can set it with glFrustum(left, right, bottom, top, near, far) ).
Symmetric view is when top=-bottom and left=-right (glPerspective (fov, aspect, near, far) ).

I suppose Irrlicht cameras are symmetric.
I wonder if there is any way to get asymmetric one, e.g. modifying projection matrix.

Thanks in advance.
[/code]
Guest

Post by Guest »

Actually... there's only one difference between the projection of the left eye and right eye...

One's to the left and the other is to the right. (Plus there's a nose in the way)

In other words, there is no difference in the projection, only in the position of the camera.
Guest

Post by Guest »

...to answer the question of how to change the projection matrix:
virtual void irr::scene::ICameraSceneNode::setProjectionMatrix ( const core::matrix4 & projection ) [pure virtual]

Sets the projection matrix of the camera. The core::matrix4 class has some methods to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH. Note that the matrix will only stay as set by this method until one of the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.

Parameters:
projection: The new projection matrix of the camera.
katoun
Posts: 239
Joined: Mon Nov 15, 2004 9:39 am
Location: Romania
Contact:

Post by katoun »

Stereoscopic view is a little diferent:
Each eye is like a normal camera but hulf of each one's view intersect but the image is made by the brain that liks them together .
For games I think you should have to cameras and yes with asymetric progecton one having the center to the left the other to the right and use to viewports but I thing sliping the view in juf you change the aspect ratio for each camera and the value of the aspect ration is Width/Height. Then is should be set to hulf of the Width (meaning Withdth/2*Height).
Think about it you just cannt put one viewport over the other to cross them togheder because I've tried that and it dosent get nice. :(
Kat'Oun
Akiko
Posts: 7
Joined: Sun Mar 13, 2005 10:26 pm

Post by Akiko »

Thanks for answer,

only moving camera to left and right (even if we have nose :) ) doesn't look nice.
I will try to build projection with builProjectionMatrix...(...) function and than change some values by hand before setting it on camera.
Post Reply