volmetrics

diff src/main.cc @ 21:c22866ecb7ae

frame :p
author Eleni Maria Stea <elene.mst@gmail.com>
date Tue, 25 Mar 2014 00:17:39 +0200
parents 21bc62bb3e14
children 4e120dcd55ec
line diff
     1.1 --- a/src/main.cc	Tue Mar 25 00:07:12 2014 +0200
     1.2 +++ b/src/main.cc	Tue Mar 25 00:17:39 2014 +0200
     1.3 @@ -182,6 +182,7 @@
     1.4  	float aspect = win_xsz / win_ysz;
     1.5  
     1.6  	glDisable(GL_LIGHTING);
     1.7 +	glDisable(GL_DEPTH_TEST);
     1.8  
     1.9  	glMatrixMode(GL_MODELVIEW);
    1.10  	glPushMatrix();
    1.11 @@ -195,7 +196,7 @@
    1.12  	glBindTexture(GL_TEXTURE_3D, vol->get_texture());
    1.13  	glEnable(GL_TEXTURE_3D);
    1.14  	glBegin(GL_QUADS);
    1.15 -	glColor3f(1.0, 0.0, 0.0);
    1.16 +	glColor3f(1.0, 1.0, 1.0);
    1.17  	glTexCoord3f(0, 0, zeta); glVertex3f(-1.0, 1.0, 0.0);
    1.18  	glTexCoord3f(0, 1, zeta); glVertex3f(-1.0, 0.5, 0.0);
    1.19  	glTexCoord3f(1, 1, zeta); glVertex3f(-0.5, 0.5, 0.0);
    1.20 @@ -203,12 +204,22 @@
    1.21  	glEnd();
    1.22  	glDisable(GL_TEXTURE_3D);
    1.23  
    1.24 +	glLineWidth(3);
    1.25 +	glBegin(GL_LINE_LOOP);
    1.26 +	glColor3f(0.4, 0.8, 0.4);
    1.27 +	glVertex3f(-1.0, 1.0, 0.0);
    1.28 +	glVertex3f(-1.0, 0.5, 0.0);
    1.29 +	glVertex3f(-0.5, 0.5, 0.0);
    1.30 +	glVertex3f(-0.5, 1.0, 0.0);
    1.31 +	glEnd();
    1.32 +
    1.33  	glMatrixMode(GL_PROJECTION);
    1.34  	glPopMatrix();
    1.35  
    1.36  	glMatrixMode(GL_MODELVIEW);
    1.37  	glPopMatrix();
    1.38  
    1.39 +	glEnable(GL_DEPTH_TEST);
    1.40  	glEnable(GL_LIGHTING);
    1.41  }
    1.42