rayfract

diff src/rayfract.cc @ 5:48e0e7d33d9e

foo
author John Tsiombikas <nuclear@siggraph.org>
date Sat, 28 May 2011 22:31:07 +0300
parents e4349f5804b9
children 8a9aa21b32cf
line diff
     1.1 --- a/src/rayfract.cc	Fri Apr 29 07:30:31 2011 +0300
     1.2 +++ b/src/rayfract.cc	Sat May 28 22:31:07 2011 +0300
     1.3 @@ -31,7 +31,7 @@
     1.4  float err_thres = 0.0075;
     1.5  int iter = 10;
     1.6  float reflectivity = 0.2;
     1.7 -Vector3 color(0.9, 0.95, 1.0);
     1.8 +Vector3 color(0.75, 0.75, 0.75);
     1.9  
    1.10  int main(int argc, char **argv)
    1.11  {
    1.12 @@ -109,6 +109,7 @@
    1.13  	set_uniform_float(sdr, "reflectivity", reflectivity);
    1.14  	set_uniform_int(sdr, "iter", iter);
    1.15  	set_uniform_float(sdr, "err_thres", err_thres);
    1.16 +	set_uniform_float3(sdr, "diffuse_color", color.x, color.y, color.z);
    1.17  
    1.18  	glMatrixMode(GL_TEXTURE);
    1.19  	glPushMatrix();
    1.20 @@ -145,6 +146,8 @@
    1.21  	glLoadIdentity();
    1.22  	gluPerspective(45.0, (float)x / (float)y, 1.0, 1000.0);
    1.23  
    1.24 +	imtk_set_viewport(x, y);
    1.25 +
    1.26  	if(ray_tex) {
    1.27  		glDeleteTextures(1, &ray_tex);
    1.28  	}
    1.29 @@ -207,6 +210,12 @@
    1.30  			glutPostRedisplay();
    1.31  		}
    1.32  		break;
    1.33 +
    1.34 +	case '\n':
    1.35 +	case '\r':
    1.36 +		printf("(%.3f %+.3fi %+.3fj %+.3fk) i:%d err: %.4f cam(theta: %.2f phi: %.2f rad: %.2f)\n", seed.w,
    1.37 +				seed.x, seed.y, seed.z, iter, err_thres, cam_theta, cam_phi, cam_dist);
    1.38 +		break;
    1.39  	}
    1.40  
    1.41  	imtk_inp_key(key, 1);