istereo2

diff src/istereo.c @ 17:f4dd01c36b0c

fixed inverted left/right stereo pairs
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 01 Oct 2015 08:03:43 +0300
parents 7bd4264bf74a
children 25d821ab1ca2
line diff
     1.1 --- a/src/istereo.c	Thu Oct 01 07:54:57 2015 +0300
     1.2 +++ b/src/istereo.c	Thu Oct 01 08:03:43 2015 +0300
     1.3 @@ -155,12 +155,28 @@
     1.4  	if(stereo) {
     1.5  		int split_pt = (int)((float)view_xsz * split);
     1.6  
     1.7 -		/* right eye */
     1.8 +		/* left eye */
     1.9  		glViewport(0, 0, split_pt, view_ysz);
    1.10  		cam_aspect((float)split_pt / (float)view_ysz);
    1.11  
    1.12  		gl_matrix_mode(GL_PROJECTION);
    1.13  		gl_load_identity();
    1.14 +		cam_stereo_proj_matrix(CAM_LEFT);
    1.15 +		//gl_rotatef(-90, 0, 0, 1);
    1.16 +
    1.17 +		gl_matrix_mode(GL_MODELVIEW);
    1.18 +		gl_load_identity();
    1.19 +		cam_stereo_view_matrix(CAM_LEFT);
    1.20 +		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    1.21 +
    1.22 +		render(tsec);
    1.23 +
    1.24 +		/* right eye */
    1.25 +		glViewport(split_pt, 0, view_xsz - split_pt, view_ysz);
    1.26 +		cam_aspect((float)(view_xsz - split_pt) / (float)view_ysz);
    1.27 +
    1.28 +		gl_matrix_mode(GL_PROJECTION);
    1.29 +		gl_load_identity();
    1.30  		cam_stereo_proj_matrix(CAM_RIGHT);
    1.31  		//gl_rotatef(-90, 0, 0, 1);
    1.32  
    1.33 @@ -170,22 +186,6 @@
    1.34  		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    1.35  
    1.36  		render(tsec);
    1.37 -
    1.38 -		/* left eye */
    1.39 -		glViewport(split_pt, 0, view_xsz - split_pt, view_ysz);
    1.40 -		cam_aspect((float)(view_xsz - split_pt) / (float)view_ysz);
    1.41 -
    1.42 -		gl_matrix_mode(GL_PROJECTION);
    1.43 -		gl_load_identity();
    1.44 -		cam_stereo_proj_matrix(CAM_LEFT);
    1.45 -		//gl_rotatef(-90, 0, 0, 1);
    1.46 -
    1.47 -		gl_matrix_mode(GL_MODELVIEW);
    1.48 -		gl_load_identity();
    1.49 -		cam_stereo_view_matrix(CAM_LEFT);
    1.50 -		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    1.51 -
    1.52 -		render(tsec);
    1.53  	} else {
    1.54  		glViewport(0, 0, view_xsz, view_ysz);
    1.55  		cam_aspect((float)view_xsz / (float)view_ysz);