[cig-commits] commit: Added some comments regarding the transparency. There's no quick fix for this

Mercurial hg at geodynamics.org
Mon Nov 24 11:28:49 PST 2008


changeset:   11:6cd1790e9db3
user:        StuartClark
date:        Fri Jun 01 01:17:56 2007 +0000
files:       DrawingObjects/src/SwarmSquares.c
description:
Added some comments regarding the transparency. There's no quick fix for this
in the end !!


diff -r e8660cfc8a76 -r 6cd1790e9db3 DrawingObjects/src/SwarmSquares.c
--- a/DrawingObjects/src/SwarmSquares.c	Tue May 22 04:28:39 2007 +0000
+++ b/DrawingObjects/src/SwarmSquares.c	Fri Jun 01 01:17:56 2007 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: SwarmSquares.c 667 2007-03-01 06:43:11Z RobertTurnbull $
+** $Id: SwarmSquares.c 696 2007-06-01 01:17:56Z StuartClark $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -266,16 +266,19 @@ void _lucSwarmSquares_BuildDisplayList( 
 void _lucSwarmSquares_BuildDisplayList( void* drawingObject, void* _context ) {
 	lucSwarmViewer*          self                = (lucSwarmViewer*)drawingObject;
 
-        /* Hack to allow the transparency to work properly 
-	 *See : http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_render.html?page=2 
-	 * ROB IS COMMENTING THESE OUT NOW TO GET IT TO WORK - HAVE TO TRY THIS ANOTHER TIME - 1st MARCH 2007
+     /* 
+		Hack to allow the transparency to work properly 
+	 	See : http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_render.html?page=2 
+	  	glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+		
+		This isn't so great either ... it's hard to overlay darker colours on 
+		light with this choice of blending.
 	 */
-//	glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+	
 	
 	_lucSwarmViewerBase_BuildDisplayList( self, _context );
 	
-	/* Put back the blending to what it was by default */
-//	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+	/* glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); */
 }
 
 void _lucSwarmSquares_PlotParticle( void* drawingObject, void* _context, Particle_Index lParticle_I ) {
@@ -294,8 +297,14 @@ void _lucSwarmSquares_PlotParticle( void
 	if ( lengthVariable )
 		SwarmVariable_ValueAt( lengthVariable, lParticle_I, &length );
 
-		
-	luc_OpenGlFatSquare( context->dim, coord, normal, NULL, length, length * 0.1);
+	glEnable(GL_BLEND);
+	
+	/*  The fat square has a pizza box shape ... i.e. edges and two faces 
+		which have opposite normals */
+	
+	luc_OpenGlFatSquare( context->dim, coord, normal, NULL, length, length * 0.1);  
+	/* luc_OpenGlSquare( context->dim, coord, normal, NULL, length); */
+
 }
 
 void lucSwarmSquares_UpdateVariables( void* drawingObject ) {



More information about the CIG-COMMITS mailing list