[opensource-dev] Need help creating stereo renderer in snowstorm

Kip Haynes Haynes at ict.usc.edu
Thu Apr 18 21:45:17 PDT 2013


Hello opensourcedev members.

I'm trying to create a version of snowstorm that will render in stereo. The device I'm working on requires that the screen be split two side by side viewports and each viewport must render a parallel camera translated by x units.

I have the two viewports working but I cannot seem to sort out how to translate the camera. I figure the best place to do it is in pipeline.cpp. below is part of my code (I set up the viewports back in llviewerdisplay.cpp before calling renderGeom)

I'm not the best opengl programmer. Can anyone assist me or point me in the right direction?
Thanks!
Kip

void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate, int LEFTRIGHT)
{
       glh::matrix4f saved_proj = glh_get_current_projection();
       glh::matrix4f saved_view = glh_get_current_modelview();


       if (LEFTRIGHT==0) {//set up left projection matrix
         gGL.matrixMode(LLRender::MM_PROJECTION);
  gGL.loadIdentity();
         saved_proj.set_translate(glh::vec3f(2.f, 2.f, 0.f));//or some fixed value
         glh_set_current_projection(saved_proj);

       }

       if (LEFTRIGHT==1){

//do nothing to the right eye for now
       }
...
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20130419/b5daecfb/attachment.htm 


More information about the opensource-dev mailing list