istereo2

changeset 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 1b7776cb800b
children 25d821ab1ca2
files src/glut/main.c src/istereo.c
diffstat 2 files changed, 26 insertions(+), 17 deletions(-) [+]
line diff
     1.1 --- a/src/glut/main.c	Thu Oct 01 07:54:57 2015 +0300
     1.2 +++ b/src/glut/main.c	Thu Oct 01 08:03:43 2015 +0300
     1.3 @@ -107,3 +107,12 @@
     1.4  {
     1.5  	mouse_motion(x, y);
     1.6  }
     1.7 +
     1.8 +/* dummy ad banner functions */
     1.9 +void ad_banner_show(void)
    1.10 +{
    1.11 +}
    1.12 +
    1.13 +void ad_banner_hide(void)
    1.14 +{
    1.15 +}
     2.1 --- a/src/istereo.c	Thu Oct 01 07:54:57 2015 +0300
     2.2 +++ b/src/istereo.c	Thu Oct 01 08:03:43 2015 +0300
     2.3 @@ -155,12 +155,28 @@
     2.4  	if(stereo) {
     2.5  		int split_pt = (int)((float)view_xsz * split);
     2.6  
     2.7 -		/* right eye */
     2.8 +		/* left eye */
     2.9  		glViewport(0, 0, split_pt, view_ysz);
    2.10  		cam_aspect((float)split_pt / (float)view_ysz);
    2.11  
    2.12  		gl_matrix_mode(GL_PROJECTION);
    2.13  		gl_load_identity();
    2.14 +		cam_stereo_proj_matrix(CAM_LEFT);
    2.15 +		//gl_rotatef(-90, 0, 0, 1);
    2.16 +
    2.17 +		gl_matrix_mode(GL_MODELVIEW);
    2.18 +		gl_load_identity();
    2.19 +		cam_stereo_view_matrix(CAM_LEFT);
    2.20 +		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    2.21 +
    2.22 +		render(tsec);
    2.23 +
    2.24 +		/* right eye */
    2.25 +		glViewport(split_pt, 0, view_xsz - split_pt, view_ysz);
    2.26 +		cam_aspect((float)(view_xsz - split_pt) / (float)view_ysz);
    2.27 +
    2.28 +		gl_matrix_mode(GL_PROJECTION);
    2.29 +		gl_load_identity();
    2.30  		cam_stereo_proj_matrix(CAM_RIGHT);
    2.31  		//gl_rotatef(-90, 0, 0, 1);
    2.32  
    2.33 @@ -170,22 +186,6 @@
    2.34  		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    2.35  
    2.36  		render(tsec);
    2.37 -
    2.38 -		/* left eye */
    2.39 -		glViewport(split_pt, 0, view_xsz - split_pt, view_ysz);
    2.40 -		cam_aspect((float)(view_xsz - split_pt) / (float)view_ysz);
    2.41 -
    2.42 -		gl_matrix_mode(GL_PROJECTION);
    2.43 -		gl_load_identity();
    2.44 -		cam_stereo_proj_matrix(CAM_LEFT);
    2.45 -		//gl_rotatef(-90, 0, 0, 1);
    2.46 -
    2.47 -		gl_matrix_mode(GL_MODELVIEW);
    2.48 -		gl_load_identity();
    2.49 -		cam_stereo_view_matrix(CAM_LEFT);
    2.50 -		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    2.51 -
    2.52 -		render(tsec);
    2.53  	} else {
    2.54  		glViewport(0, 0, view_xsz, view_ysz);
    2.55  		cam_aspect((float)view_xsz / (float)view_ysz);