istereo

diff src/istereo.c @ 23:e3742aafc85b

oh yeah
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 Sep 2011 02:57:29 +0300
parents 889dade25667
children 70309d71c899
line diff
     1.1 --- a/src/istereo.c	Wed Sep 07 10:56:18 2011 +0300
     1.2 +++ b/src/istereo.c	Thu Sep 08 02:57:29 2011 +0300
     1.3 @@ -30,7 +30,7 @@
     1.4  int segm = 20;
     1.5  float ring_height = 0.5;
     1.6  
     1.7 -float split = 0.5;
     1.8 +float split = 0.53;
     1.9  
    1.10  int init(void)
    1.11  {
    1.12 @@ -71,12 +71,29 @@
    1.13  	if(stereo) {
    1.14  		int split_pt = (int)((float)view_ysz * split);
    1.15  
    1.16 -		/* left eye */
    1.17 +		/* right eye */
    1.18  		glViewport(0, 0, view_xsz, split_pt);
    1.19  		cam_aspect((float)split_pt / (float)view_xsz);
    1.20  
    1.21  		gl_matrix_mode(GL_PROJECTION);
    1.22  		gl_load_identity();
    1.23 +		cam_stereo_proj_matrix(CAM_RIGHT);
    1.24 +		gl_rotatef(-90, 0, 0, 1);
    1.25 +
    1.26 +		gl_matrix_mode(GL_MODELVIEW);
    1.27 +		gl_load_identity();
    1.28 +		cam_stereo_view_matrix(CAM_RIGHT);
    1.29 +		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    1.30 +		/*gl_rotatef(-90, 0, 0, 1);*/
    1.31 +
    1.32 +		render(tsec);
    1.33 +
    1.34 +		/* left eye */
    1.35 +		glViewport(0, split_pt, view_xsz, view_ysz - split_pt);
    1.36 +		cam_aspect((float)(view_ysz - split_pt) / (float)view_xsz);
    1.37 +
    1.38 +		gl_matrix_mode(GL_PROJECTION);
    1.39 +		gl_load_identity();
    1.40  		cam_stereo_proj_matrix(CAM_LEFT);
    1.41  		gl_rotatef(-90, 0, 0, 1);
    1.42  
    1.43 @@ -87,23 +104,6 @@
    1.44  		/*gl_rotatef(-90, 0, 0, 1);*/
    1.45  
    1.46  		render(tsec);
    1.47 -
    1.48 -		/* right eye */
    1.49 -		glViewport(0, split_pt, view_xsz, view_ysz - split_pt);
    1.50 -		cam_aspect((float)(view_ysz - split_pt) / (float)view_xsz);
    1.51 -
    1.52 -		gl_matrix_mode(GL_PROJECTION);
    1.53 -		gl_load_identity();
    1.54 -		cam_stereo_proj_matrix(CAM_RIGHT);
    1.55 -		gl_rotatef(-90, 0, 0, 1);
    1.56 -
    1.57 -		gl_matrix_mode(GL_MODELVIEW);
    1.58 -		gl_load_identity();
    1.59 -		cam_stereo_view_matrix(CAM_RIGHT);
    1.60 -		gl_translatef(-pan_x, -pan_y, -1.1 * ring_height * segm);
    1.61 -		/*gl_rotatef(-90, 0, 0, 1);*/
    1.62 -
    1.63 -		render(tsec);
    1.64  	} else {
    1.65  		gl_matrix_mode(GL_MODELVIEW);
    1.66  		gl_load_identity();