Commit c62540c7633dc156b9eb1914b24b4888b26b6a3f

Authored by Jiaming Guo
1 parent f85b1b3a

normalization

Showing 1 changed file with 14 additions and 13 deletions   Show diff stats
@@ -182,21 +182,21 @@ void glut_render(void) { @@ -182,21 +182,21 @@ void glut_render(void) {
182 glut_render_modelview(); //set up the modelview matrix with camera details 182 glut_render_modelview(); //set up the modelview matrix with camera details
183 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen 183 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
184 GT.glCenterline0(); //render the GT network (the only one loaded) 184 GT.glCenterline0(); //render the GT network (the only one loaded)
  185 + glDisable(GL_DEPTH_TEST);
185 } 186 }
186 187
187 if (num_nets == 2) { //if two networks are loaded 188 if (num_nets == 2) { //if two networks are loaded
188 - glEnable(GL_DEPTH_TEST); //enable depth  
189 - glut_render_left_projection(); //set up a projection for the left half of the window  
190 - glut_render_modelview(); //set up the modelview matrix using camera details  
191 - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen  
192 -  
193 glEnable(GL_TEXTURE_1D); //enable texture mapping 189 glEnable(GL_TEXTURE_1D); //enable texture mapping
194 - if(light_fac == 0) 190 + if (light_fac == 0)
195 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color 191 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
196 else 192 else
197 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 193 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
198 -  
199 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map 194 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map
  195 +
  196 + glEnable(GL_DEPTH_TEST); //enable depth
  197 + glut_render_left_projection(); //set up a projection for the left half of the window
  198 + glut_render_modelview(); //set up the modelview matrix using camera details
  199 + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
200 200
201 GT.glCylinder(sigma, radius); //render the GT network 201 GT.glCylinder(sigma, radius); //render the GT network
202 if (adjoint_fac == 1) { 202 if (adjoint_fac == 1) {
@@ -229,17 +229,17 @@ void glut_render(void) { @@ -229,17 +229,17 @@ void glut_render(void) {
229 } 229 }
230 if (num_nets == 2) { //if two networks are loaded 230 if (num_nets == 2) { //if two networks are loaded
231 if (compareMode) { 231 if (compareMode) {
232 - glEnable(GL_DEPTH_TEST); //enable depth  
233 - glut_render_left_projection(); //set up a projection for the left half of the window  
234 - glut_render_modelview(); //set up the modelview matrix using camera details  
235 - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen  
236 -  
237 glEnable(GL_TEXTURE_1D); //enable texture mapping 232 glEnable(GL_TEXTURE_1D); //enable texture mapping
238 if (light_fac == 0) 233 if (light_fac == 0)
239 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color 234 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color
240 else 235 else
241 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//map light to texture 236 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//map light to texture
242 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map 237 glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map
  238 +
  239 + glEnable(GL_DEPTH_TEST); //enable depth
  240 + glut_render_left_projection(); //set up a projection for the left half of the window
  241 + glut_render_modelview(); //set up the modelview matrix using camera details
  242 + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen
243 243
244 _GT.glCylinder(sigma, radius); //render the GT network 244 _GT.glCylinder(sigma, radius); //render the GT network
245 if (adjoint_fac == 1) { 245 if (adjoint_fac == 1) {
@@ -279,6 +279,8 @@ void glut_render(void) { @@ -279,6 +279,8 @@ void glut_render(void) {
279 } 279 }
280 } 280 }
281 } 281 }
  282 + glDisable(GL_DEPTH_TEST);
  283 + glDisable(GL_TEXTURE_1D);
282 284
283 if (num_nets == 2) { // works only with two networks 285 if (num_nets == 2) { // works only with two networks
284 std::ostringstream ss; 286 std::ostringstream ss;
@@ -287,7 +289,6 @@ void glut_render(void) { @@ -287,7 +289,6 @@ void glut_render(void) {
287 else 289 else
288 ss << "Compare Mode"; // default mode is compare mode 290 ss << "Compare Mode"; // default mode is compare mode
289 291
290 - glDisable(GL_TEXTURE_1D);  
291 if (light_fac == 1) 292 if (light_fac == 1)
292 glDisable(GL_LIGHTING); 293 glDisable(GL_LIGHTING);
293 glMatrixMode(GL_PROJECTION); // set up the 2d viewport for mode text printing 294 glMatrixMode(GL_PROJECTION); // set up the 2d viewport for mode text printing