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]
Stereoscopic view, glFrustum
...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.
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.
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