Changeset 20579 for issm/trunk-jpl/src/m/plot/plot_unit.js
- Timestamp:
- 04/28/16 22:58:29 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_unit.js
r20565 r20579 1 function plot_unit(md,data, options,canvas,gl,node) {1 function plot_unit(md,data,datatype,options,canvas,gl,node) { 2 2 //PLOT_UNIT - unit plot, display data 3 3 // … … 26 26 var is2d = meshresults[4]; 27 27 var isplanet = meshresults[5]; 28 29 var dataresults = processdata(md,data,options);30 var data2 = dataresults[0];31 var datatype = dataresults[1];32 28 33 29 //Compue scaling through matrices for 2d meshes and vertices for 3d meshes … … 112 108 for(var i = 0; i < x.length; i++){ 113 109 //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing 114 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) ) {110 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i])) { 115 111 nanindices[i] = i; 116 112 vertices[vertices.length] = vertex[0]; 117 113 vertices[vertices.length] = vertex[1]; 118 114 vertices[vertices.length] = vertex[2]; 115 116 texcoords[texcoords.length] = 0.0; 117 texcoords[texcoords.length] = 0.0; 119 118 continue; 120 119 } … … 144 143 145 144 } 145 146 146 //Initalize buffers 147 147 node["arrays"] = [vertices, texcoords, indices]; … … 175 175 for(var i = 0; i < x.length; i++){ 176 176 //Check for NaN values and remove from indices array as necessary, but preserve vertex array spacing 177 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) ) {177 if (isNaN(x[i]) || isNaN(y[i]) || isNaN(z[i]) || isNaN(data[i])) { 178 178 nanindices[i] = i; 179 179 vertices[vertices.length] = vertex[0]; 180 180 vertices[vertices.length] = vertex[1]; 181 181 vertices[vertices.length] = vertex[2]; 182 183 texcoords[texcoords.length] = 0.0; 184 texcoords[texcoords.length] = 0.0; 182 185 continue; 183 186 } … … 191 194 vertices[vertices.length] = vertex[2]; 192 195 } 193 194 196 //Transpose data to obtain column addressable data matrix 195 197 data = data[0].map(function(col, i) { … … 271 273 throw Error(sprintf("%s%i%s\n",'case ',datatype,' not supported')); 272 274 } 275 273 276 if (canvas.requestDrawing) draw(gl,options,canvas); 274 277 }
Note:
See TracChangeset
for help on using the changeset viewer.