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 } ... }
_______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/OpenSource-Dev Please read the policies before posting to keep unmoderated posting privileges