how to do off-axis projections

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
gtimworks
Posts: 21
Joined: Sun Nov 03, 2013 8:07 pm

how to do off-axis projections

Post by gtimworks »

Hi guys,

most of the time, when a 3d scene is projected to the 2d space, the target (where the camera is looking at) is projected at the center of the projected 2d screen. This is called on-axis projections, where (0,0) of the projected 2d space is at the center of the viewport. However, sometimes it is useful to do off-axis projection (for example stereo view).

I know in OpenGL this is done through glFrustum() but I couldn't figure out how to get this done with Irrlicht. Can anyone explain how to do it?

Thanks,

gtimworks
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: how to do off-axis projections

Post by thanhle »

I think you need two camera views, where 1 view has a pan offset distance from the other view to achieve stereoscopic.
Just render the scene two times with camera switching onto different view.

I think I saw some discussion on this topic trolling the forum before.

Regards
thanh
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: how to do off-axis projections

Post by CuteAlien »

IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: how to do off-axis projections

Post by mongoose7 »

They draw the two images at the same place. The OP wants the images side-by-side. I think he needs two viewports.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: how to do off-axis projections

Post by CuteAlien »

Ah OK, in that case example 18.SplitScreen is probably the better starting point. Or maybe a mixture of that example and the links above.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply