[Plib-devel] off-axis stereo projection with plib
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2006-08-14 15:02:56
|
ssgHello(ALL) I'm trying to add a stereo option to a PLIB application. Now, I want to do the stereo properly. This means not using the 'toe-in' method. Instead a proper off-axis projection. This method is described very accurately by Paul Bourke at: http://local.wasp.uwa.edu.au/~pbourke/stereographics/stereorender/ I'm not really sure about the approach I should take. Currently, in the monoscopic case, I am using a ssgContext class, and call setFrustum() in glut's reshape() callbacks. When moving to a stereo app, I guess my options are: -1- Drop the use of ssgContext and make direct calls to glu and friends -2- Create two ssgContext instances. One for L and one for R -3- Derive a ssgStereoContext from ssgContext class, and do all the handling in there (e.g. eye-sep calculations and maintaining two Frusti). Maybe have a ssgStereoContext->makeCurrent(LEFT | RIGHT) ? -4- Use a single instance of the ssgContext, and change all its settings twice each frame I draw. Also, in my case there are extra complicating factors, as my target platform is a passive stereo system. This means even more options: two viewports in a single window? two windows? Currently, I nigh to the class derivation, maybe even two classes ssgActiveStereoContext and ssgPassiveStereoContext ? Or a unified stereo class with a boolean active/passive ? But maybe people on this list have some good insights on how to do stereo with plib properly, or maybe even have some experience with it. The only sample use of stereo in plib I could find was a old tuxkart, but that one does not use ssgContext, and neither does it do off-axis projection. thx, Bram -- Bram Stolk, VR Engineer SARA, Amsterdam. tel +31 20 592 3000 "Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit operating system originally coded for a 4-bit microprocessor by a 2-bit company that can't stand 1 bit of competition." |