Search code examples
c++frustumopeninventor

Setting a 3D environment reference


I'm setting a Frustum camera to create a Virtual Reality environment that looks like a window when you look at the screen. I've checked all the documentation of the SoCamera, SoFrustumCamera, SoPerspectiveCamera and SoOrtographicCamera, but culdn't find a way to set my scene in order to match its borders with the borders of the screen.

I want to do something like this...

https://www.youtube.com/watch?v=Jd3-eiid-Uw

The problem on my code is that the whole scene moves, instead of only the "back" of the scene. It looks 3D, but doesn't look as immersive as a real window.

Does anyone have a hint or can help me on that? Im making my code in C++, using OpenInventor. Thanks!!


Solution

  • I think you might need an off-center perspective camera in order to do perspective shifts like in the youtube clip. Take a look at DirectXMath XMMatrixPerspectiveOffCenterLH() function. Maybe that'd help.