# HG changeset patch # User John Tsiombikas # Date 1440303476 -10800 # Node ID 430d8dde62aac6f585ce9da09581e493ce93490b # Parent dab7d6a158e23fabdedc6a15efa84b072b668e21 random changes diff -r dab7d6a158e2 -r 430d8dde62aa .hgignore --- a/.hgignore Thu Apr 17 13:51:10 2014 +0300 +++ b/.hgignore Sun Aug 23 07:17:56 2015 +0300 @@ -6,3 +6,4 @@ ^metasurf\.dylib ^Makefile$ \.png$ +\.jpg$ diff -r dab7d6a158e2 -r 430d8dde62aa examples/volume/Makefile --- a/examples/volume/Makefile Thu Apr 17 13:51:10 2014 +0300 +++ b/examples/volume/Makefile Sun Aug 23 07:17:56 2015 +0300 @@ -9,6 +9,7 @@ CC = gcc CFLAGS = -pedantic -Wall -g -I../../src $(inc) $(nosdr) LDFLAGS = -L../.. -lmetasurf $(libgl) -limago -lm +#-lgomp ifeq ($(shell uname -s), Darwin) inc = -I/opt/local/include diff -r dab7d6a158e2 -r 430d8dde62aa examples/volume/src/volume.c --- a/examples/volume/src/volume.c Thu Apr 17 13:51:10 2014 +0300 +++ b/examples/volume/src/volume.c Sun Aug 23 07:17:56 2015 +0300 @@ -25,6 +25,7 @@ void disp(void); void reshape(int x, int y); void keyb(unsigned char key, int x, int y); +void keyb_up(unsigned char key, int x, int y); void mouse(int bn, int state, int x, int y); void motion(int x, int y); int parse_args(int argc, char **argv); @@ -38,6 +39,8 @@ unsigned int sdr; #endif +float yscale = 1.0; + struct img_pixmap *volume; int xres, yres, num_slices; @@ -67,6 +70,7 @@ glutDisplayFunc(disp); glutReshapeFunc(reshape); glutKeyboardFunc(keyb); + glutKeyboardUpFunc(keyb_up); glutMouseFunc(mouse); glutMotionFunc(motion); @@ -158,6 +162,7 @@ glMatrixMode(GL_MODELVIEW); glPushMatrix(); + glScalef(1.0, yscale, 1.0); glRotatef(90, 1, 0, 0); if(need_update) { @@ -219,6 +224,8 @@ cam_aspect((float)x / (float)y); } +int mode_scale; + void keyb(unsigned char key, int x, int y) { static int wire; @@ -263,11 +270,24 @@ need_update = 1; break; + case 'y': + mode_scale = 1; + break; + default: break; } } +void keyb_up(unsigned char key, int x, int y) +{ + switch(key) { + case 'y': + mode_scale = 0; + break; + } +} + int bnstate[32]; int prev_x, prev_y; @@ -287,11 +307,15 @@ prev_x = x; prev_y = y; - if(bnstate[GLUT_LEFT_BUTTON]) { - cam_inp_rotate(dx, dy); - } - if(bnstate[GLUT_RIGHT_BUTTON]) { - cam_inp_zoom(dy); + if(mode_scale) { + yscale += dy * 0.001; + } else { + if(bnstate[GLUT_LEFT_BUTTON]) { + cam_inp_rotate(dx, dy); + } + if(bnstate[GLUT_RIGHT_BUTTON]) { + cam_inp_zoom(dy); + } } glutPostRedisplay(); } diff -r dab7d6a158e2 -r 430d8dde62aa src/metasurf.c --- a/src/metasurf.c Thu Apr 17 13:51:10 2014 +0300 +++ b/src/metasurf.c Sun Aug 23 07:17:56 2015 +0300 @@ -160,7 +160,6 @@ pos[0] = ms->min[0]; for(i=0; ires[0] - 1; i++) { - pos[1] = ms->min[1]; for(j=0; jres[1] - 1; j++) { @@ -279,6 +278,7 @@ ms->normal(dfdx, dfdy, dfdz); } + /* TODO multithreadied polygon emmit */ ms->vertex(v[0], v[1], v[2]); } } @@ -409,5 +409,4 @@ } }*/ } - #endif /* USE_MTETRA */