Index: /issm/trunk-jpl/src/m/plot/plot_mesh.js
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_mesh.js	(revision 19872)
+++ /issm/trunk-jpl/src/m/plot/plot_mesh.js	(revision 19873)
@@ -43,4 +43,7 @@
 	node["modelMatrix"] = recalculateModelMatrix(node);
 	node["drawMode"] = gl.LINES;
+	//node["alpha"] = options.getfieldvalue('alpha',1.0);
+	node["overlay"] = false;
+	node["drawOrder"] = 0;
 				
 	//some defaults:
Index: /issm/trunk-jpl/src/m/plot/plot_overlay.js
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_overlay.js	(revision 19872)
+++ /issm/trunk-jpl/src/m/plot/plot_overlay.js	(revision 19873)
@@ -27,7 +27,10 @@
 
 	//Compute coordinates and data range:
-	var xlim = options.getfieldvalue('xlim',[ArrayMin(x),ArrayMax(x)]);
-	var ylim = options.getfieldvalue('ylim',[ArrayMin(y),ArrayMax(y)]);
-	var zlim = options.getfieldvalue('zlim',[ArrayMin(z),ArrayMax(z)]);
+	var modelxlim = [ArrayMin(x),ArrayMax(x)];
+	var modelylim = [ArrayMin(y),ArrayMax(y)];
+	var modelzlim = [ArrayMin(z),ArrayMax(z)];
+	var xlim = options.getfieldvalue('xlim',modelxlim);
+	var ylim = options.getfieldvalue('ylim',modelylim);
+	var zlim = options.getfieldvalue('zlim',modelzlim);
 	xmin = xlim[0];
 	xmax = xlim[1];
@@ -46,6 +49,7 @@
 	node["modelMatrix"] = recalculateModelMatrix(node);
 	node["texture"] = initTexture(gl,options.getfieldvalue('image','images/penguin.png'));
-	node["alpha"] = options.getfieldvalue('alpha',1.0);
-	node["overlay"] = true;
+	//node["alpha"] = options.getfieldvalue('alpha',1.0);
+	node["overlay"] = false;
+	node["drawOrder"] = 1;
 				
 	//some defaults:
Index: /issm/trunk-jpl/src/m/plot/plot_unit.js
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_unit.js	(revision 19872)
+++ /issm/trunk-jpl/src/m/plot/plot_unit.js	(revision 19873)
@@ -54,4 +54,8 @@
 	node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)];
 	node["modelMatrix"] = recalculateModelMatrix(node);
+	node["alpha"] = options.getfieldvalue('alpha',1.0);
+	node["overlay"] = true;
+	node["drawOrder"] = 0;
+		
 	//some defaults:
 	texcoords.itemSize = 2;
Index: /issm/trunk-jpl/src/m/plot/webgl.js
===================================================================
--- /issm/trunk-jpl/src/m/plot/webgl.js	(revision 19872)
+++ /issm/trunk-jpl/src/m/plot/webgl.js	(revision 19873)
@@ -121,4 +121,5 @@
 		shaderName:"colored",
 		overlay:false,
+		drawOrder:0,
 	};
 } //}}}
@@ -369,6 +370,11 @@
 	window.requestAnimationFrame(function(time) {draw(gl,options,canvas,nodes)});
 	updateCameraMatrix(canvas);
-	for (var node in nodes) {
-		drawSceneGraphNode(gl, canvas, nodes[node]);
+	var drawPassNumber = 2;
+	for (var i = drawPassNumber - 1; i >= 0; i--) {
+		for (var node in nodes) {
+			if (nodes[node]["drawOrder"] == i) {
+				drawSceneGraphNode(gl, canvas, nodes[node]);
+			}
+		}
 	}
 } //}}}
