Skip to content
Snippets Groups Projects
Commit dbd5a700 authored by Gilles Marckmann's avatar Gilles Marckmann
Browse files

implementation of stereography

parent c76a4d8a
Branches
Tags
No related merge requests found
...@@ -584,6 +584,10 @@ graphicWindow::graphicWindow(bool main, int numTiles) ...@@ -584,6 +584,10 @@ graphicWindow::graphicWindow(bool main, int numTiles)
int mode = FL_RGB | FL_DEPTH | (CTX::instance()->db ? FL_DOUBLE : FL_SINGLE); int mode = FL_RGB | FL_DEPTH | (CTX::instance()->db ? FL_DOUBLE : FL_SINGLE);
if(CTX::instance()->antialiasing) mode |= FL_MULTISAMPLE; if(CTX::instance()->antialiasing) mode |= FL_MULTISAMPLE;
//mode |= FL_STEREO; //mode |= FL_STEREO;
if(CTX::instance()->stereo) {
mode |= FL_DOUBLE;
mode |= FL_STEREO;
}
for(unsigned int i = 0; i < gl.size(); i++) gl[i]->mode(mode); for(unsigned int i = 0; i < gl.size(); i++) gl[i]->mode(mode);
tile->end(); tile->end();
......
...@@ -271,7 +271,6 @@ void openglWindow::draw() ...@@ -271,7 +271,6 @@ void openglWindow::draw()
glAccum(GL_RETURN,1.0); glAccum(GL_RETURN,1.0);
*/ */
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
//right eye //right eye
XYZ eye =cam->eyesep / 2.0* cam->right; XYZ eye =cam->eyesep / 2.0* cam->right;
...@@ -291,6 +290,8 @@ void openglWindow::draw() ...@@ -291,6 +290,8 @@ void openglWindow::draw()
cam->up.x, cam->up.y, cam->up.z); cam->up.x, cam->up.y, cam->up.z);
_ctx->draw3d(); _ctx->draw3d();
_ctx->draw2d(); _ctx->draw2d();
_drawScreenMessage();
_drawBorder();
//left eye //left eye
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
...@@ -310,8 +311,8 @@ void openglWindow::draw() ...@@ -310,8 +311,8 @@ void openglWindow::draw()
cam->up.x, cam->up.y, cam->up.z); cam->up.x, cam->up.y, cam->up.z);
_ctx->draw3d(); _ctx->draw3d();
_ctx->draw2d(); _ctx->draw2d();
_drawScreenMessage();
glPushMatrix(); _drawBorder();
} }
else{ else{
......
...@@ -25,7 +25,8 @@ void Camera::init(){ ...@@ -25,7 +25,8 @@ void Camera::init(){
on=true; on=true;
glFnear=0.1 ; glFnear=0.1 ;
glFfar=10000; glFfar=10000;
eye_sep_ratio=.015; // eye_sep_ratio=.015;
eye_sep_ratio=.05;
// apparent angle of the screen height // apparent angle of the screen height
aperture = 25; aperture = 25;
focallength = 100.; focallength = 100.;
......
...@@ -455,7 +455,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) ...@@ -455,7 +455,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
fabs(CTX::instance()->max[2])); fabs(CTX::instance()->max[2]));
if(zmax < CTX::instance()->lc) zmax = CTX::instance()->lc; if(zmax < CTX::instance()->lc) zmax = CTX::instance()->lc;
if (CTX::instance()->camera ) { // if we use the new camera mode if ( (CTX::instance()->camera) && (!CTX::instance()->stereo) ) { // if we use the new camera mode
double clip_near, clip_far; double clip_near, clip_far;
clip_near = 0.75 * CTX::instance()->clipFactor * zmax; clip_near = 0.75 * CTX::instance()->clipFactor * zmax;
...@@ -472,12 +472,12 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) ...@@ -472,12 +472,12 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick)
glBegin(GL_QUADS); glBegin(GL_QUADS);
//glColor4ubv((GLubyte *) & CTX::instance()->color.bg); //glColor4ubv((GLubyte *) & CTX::instance()->color.bg);
glColor3d(.8,.8,.95); glColor3d(.8,.8,.95);
glVertex3i(-dx,-dy,dz); glVertex3i((int)-dx,(int)-dy,(int)dz);
glVertex3i( dx,-dy,dz); glVertex3i((int) dx,(int)-dy,(int)dz);
// glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad); // glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad);
glColor3d(.1,.1,.3); glColor3d(.1,.1,.3);
glVertex3i( dx, dy,dz); glVertex3i((int) dx,(int) dy,(int)dz);
glVertex3i(-dx, dy,dz); glVertex3i((int)-dx,(int) dy,(int)dz);
glEnd(); glEnd();
glPopMatrix(); glPopMatrix();
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment