Changeset 19874
- Timestamp:
- 12/10/15 21:23:40 (9 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_overlay.js
r19873 r19874 48 48 node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)]; 49 49 node["modelMatrix"] = recalculateModelMatrix(node); 50 node["texture"] = initTexture(gl,options.getfieldvalue('image','images/ penguin.png'));50 node["texture"] = initTexture(gl,options.getfieldvalue('image','images/checker.gif')); 51 51 //node["alpha"] = options.getfieldvalue('alpha',1.0); 52 52 node["overlay"] = false; … … 57 57 vertices.itemSize = 3; 58 58 59 var xrange = xmax - xmin;60 var yrange = ymax - ymin;59 var xrange = modelxlim[1] - modelxlim[0]; 60 var yrange = modelylim[1] - modelylim[0]; 61 61 62 62 //redefine overlay as square plane 63 //x = [ xmin, xmax, xmin, xmax];64 //y = [ ymin, ymin, ymax, ymax];65 //z = [ zmin, zmin, zmin, zmin];63 //x = [modelxlim[0], modelxlim[1], modelxlim[0], modelxlim[1]]; 64 //y = [modelylim[0], modelylim[0], modelylim[1], modelylim[1]]; 65 //z = [modelzlim[0], modelzlim[0], modelzlim[0], modelzlim[0]]; 66 66 //elements = [[1,2,3],[2,4,3]]; 67 67 … … 72 72 vertices[vertices.length] = z[i]; 73 73 74 texcoords[texcoords.length] = (x[i] - xmin) / xrange;75 texcoords[texcoords.length] = (y[i] - ymin) / yrange;74 texcoords[texcoords.length] = (x[i] - modelxlim[0]) / xrange; 75 texcoords[texcoords.length] = (y[i] - modelylim[0]) / yrange; 76 76 } 77 77 … … 82 82 83 83 /*Initalize buffers: */ 84 node["buffers"] = initBuffers(gl,[vertices, texcoords, indices]); 84 node["arrays"] = [vertices, texcoords, indices]; 85 node["buffers"] = initBuffers(gl,node["arrays"]); 85 86 } -
issm/trunk-jpl/src/m/plot/plot_unit.js
r19873 r19874 33 33 34 34 //Compute coordinates and data range: 35 var xlim = options.getfieldvalue('xlim',[ArrayMin(x),ArrayMax(x)]); 36 var ylim = options.getfieldvalue('ylim',[ArrayMin(y),ArrayMax(y)]); 37 var zlim = options.getfieldvalue('zlim',[ArrayMin(z),ArrayMax(z)]); 35 var modelxlim = [ArrayMin(x),ArrayMax(x)]; 36 var modelylim = [ArrayMin(y),ArrayMax(y)]; 37 var modelzlim = [ArrayMin(z),ArrayMax(z)]; 38 var xlim = options.getfieldvalue('xlim',modelxlim); 39 var ylim = options.getfieldvalue('ylim',modelylim); 40 var zlim = options.getfieldvalue('zlim',modelzlim); 38 41 xmin = xlim[0]; 39 42 xmax = xlim[1]; … … 146 149 147 150 /*Initalize buffers: */ 148 node[" buffers"] = initBuffers(gl,[vertices, texcoords, indices]);149 node[" overlay"] = false;151 node["arrays"] = [vertices, texcoords, indices]; 152 node["buffers"] = initBuffers(gl,node["arrays"]); 150 153 }
Note:
See TracChangeset
for help on using the changeset viewer.