[20498] | 1 | Index: ../trunk-jpl/src/m/plot/plot_unit.js
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/plot/plot_unit.js (revision 19872)
|
---|
| 4 | +++ ../trunk-jpl/src/m/plot/plot_unit.js (revision 19873)
|
---|
| 5 | @@ -53,6 +53,10 @@
|
---|
| 6 | node["rotation"] = options.getfieldvalue('view',[0,0,0]);
|
---|
| 7 | node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)];
|
---|
| 8 | node["modelMatrix"] = recalculateModelMatrix(node);
|
---|
| 9 | + node["alpha"] = options.getfieldvalue('alpha',1.0);
|
---|
| 10 | + node["overlay"] = true;
|
---|
| 11 | + node["drawOrder"] = 0;
|
---|
| 12 | +
|
---|
| 13 | //some defaults:
|
---|
| 14 | texcoords.itemSize = 2;
|
---|
| 15 |
|
---|
| 16 | Index: ../trunk-jpl/src/m/plot/plot_overlay.js
|
---|
| 17 | ===================================================================
|
---|
| 18 | --- ../trunk-jpl/src/m/plot/plot_overlay.js (revision 19872)
|
---|
| 19 | +++ ../trunk-jpl/src/m/plot/plot_overlay.js (revision 19873)
|
---|
| 20 | @@ -26,9 +26,12 @@
|
---|
| 21 | //}}}
|
---|
| 22 |
|
---|
| 23 | //Compute coordinates and data range:
|
---|
| 24 | - var xlim = options.getfieldvalue('xlim',[ArrayMin(x),ArrayMax(x)]);
|
---|
| 25 | - var ylim = options.getfieldvalue('ylim',[ArrayMin(y),ArrayMax(y)]);
|
---|
| 26 | - var zlim = options.getfieldvalue('zlim',[ArrayMin(z),ArrayMax(z)]);
|
---|
| 27 | + var modelxlim = [ArrayMin(x),ArrayMax(x)];
|
---|
| 28 | + var modelylim = [ArrayMin(y),ArrayMax(y)];
|
---|
| 29 | + var modelzlim = [ArrayMin(z),ArrayMax(z)];
|
---|
| 30 | + var xlim = options.getfieldvalue('xlim',modelxlim);
|
---|
| 31 | + var ylim = options.getfieldvalue('ylim',modelylim);
|
---|
| 32 | + var zlim = options.getfieldvalue('zlim',modelzlim);
|
---|
| 33 | xmin = xlim[0];
|
---|
| 34 | xmax = xlim[1];
|
---|
| 35 | ymin = ylim[0];
|
---|
| 36 | @@ -45,8 +48,9 @@
|
---|
| 37 | node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)];
|
---|
| 38 | node["modelMatrix"] = recalculateModelMatrix(node);
|
---|
| 39 | node["texture"] = initTexture(gl,options.getfieldvalue('image','images/penguin.png'));
|
---|
| 40 | - node["alpha"] = options.getfieldvalue('alpha',1.0);
|
---|
| 41 | - node["overlay"] = true;
|
---|
| 42 | + //node["alpha"] = options.getfieldvalue('alpha',1.0);
|
---|
| 43 | + node["overlay"] = false;
|
---|
| 44 | + node["drawOrder"] = 1;
|
---|
| 45 |
|
---|
| 46 | //some defaults:
|
---|
| 47 | texcoords.itemSize = 2;
|
---|
| 48 | Index: ../trunk-jpl/src/m/plot/plot_mesh.js
|
---|
| 49 | ===================================================================
|
---|
| 50 | --- ../trunk-jpl/src/m/plot/plot_mesh.js (revision 19872)
|
---|
| 51 | +++ ../trunk-jpl/src/m/plot/plot_mesh.js (revision 19873)
|
---|
| 52 | @@ -42,6 +42,9 @@
|
---|
| 53 | node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)];
|
---|
| 54 | node["modelMatrix"] = recalculateModelMatrix(node);
|
---|
| 55 | node["drawMode"] = gl.LINES;
|
---|
| 56 | + //node["alpha"] = options.getfieldvalue('alpha',1.0);
|
---|
| 57 | + node["overlay"] = false;
|
---|
| 58 | + node["drawOrder"] = 0;
|
---|
| 59 |
|
---|
| 60 | //some defaults:
|
---|
| 61 | colors.itemSize = 4;
|
---|
| 62 | Index: ../trunk-jpl/src/m/plot/webgl.js
|
---|
| 63 | ===================================================================
|
---|
| 64 | --- ../trunk-jpl/src/m/plot/webgl.js (revision 19872)
|
---|
| 65 | +++ ../trunk-jpl/src/m/plot/webgl.js (revision 19873)
|
---|
| 66 | @@ -120,6 +120,7 @@
|
---|
| 67 | modelMatrix:mat4.create(),
|
---|
| 68 | shaderName:"colored",
|
---|
| 69 | overlay:false,
|
---|
| 70 | + drawOrder:0,
|
---|
| 71 | };
|
---|
| 72 | } //}}}
|
---|
| 73 | function recalculateModelMatrix(node) { //{{{
|
---|
| 74 | @@ -368,8 +369,13 @@
|
---|
| 75 |
|
---|
| 76 | window.requestAnimationFrame(function(time) {draw(gl,options,canvas,nodes)});
|
---|
| 77 | updateCameraMatrix(canvas);
|
---|
| 78 | - for (var node in nodes) {
|
---|
| 79 | - drawSceneGraphNode(gl, canvas, nodes[node]);
|
---|
| 80 | + var drawPassNumber = 2;
|
---|
| 81 | + for (var i = drawPassNumber - 1; i >= 0; i--) {
|
---|
| 82 | + for (var node in nodes) {
|
---|
| 83 | + if (nodes[node]["drawOrder"] == i) {
|
---|
| 84 | + drawSceneGraphNode(gl, canvas, nodes[node]);
|
---|
| 85 | + }
|
---|
| 86 | + }
|
---|
| 87 | }
|
---|
| 88 | } //}}}
|
---|
| 89 | //}}}
|
---|