Changeset 19871
- Timestamp:
- 12/09/15 21:07:37 (9 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/applyoptions.js
r19858 r19871 277 277 var cmap = options.getfieldvalue('cmap','jet'); 278 278 var colorbar = colorbars[cmap]; 279 console.log(cmap, colorbar); 279 280 for (var i = 0; i < colorbar.length; i++) { 280 281 color = colorbar[colorbar.length-i-1]; … … 327 328 tURL = tcanvashtml.toDataURL(); 328 329 node["texture"] = initTexture(gl,tURL); 330 console.log(node["texture"]); 329 331 /* //{{{ 330 332 if exist(options,'wrapping') -
issm/trunk-jpl/src/m/plot/plot_mesh.js
r19870 r19871 38 38 var scale = 1 / (xmax - xmin); 39 39 node["shaderName"] = "colored"; 40 node["shader"] = gl["shaders"][node["shaderName"]]["program"]; 40 41 node["scale"] = [scale, scale, scale]; 41 42 node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)]; -
issm/trunk-jpl/src/m/plot/plot_overlay.js
r19870 r19871 40 40 var scale = 1 / (xmax - xmin); 41 41 node["shaderName"] = "unlit_textured"; 42 node["shader"] = gl["shaders"][node["shaderName"]]["program"]; 42 43 node["scale"] = [scale, scale, scale]; 43 44 node["rotation"] = options.getfieldvalue('view',[0,0,0]); -
issm/trunk-jpl/src/m/plot/plot_unit.js
r19870 r19871 49 49 var scale = 1 / (xmax - xmin); 50 50 node["shaderName"] = "unlit_textured"; 51 node["shader"] = gl["shaders"][node["shaderName"]]["program"]; 52 console.log(gl["shaders"]); 51 53 node["scale"] = [scale, scale, scale]; 52 54 node["rotation"] = options.getfieldvalue('view',[0,0,0]); 53 55 node["translation"] = [(xmin + xmax) / (-2 / scale), (ymin + ymax) / (-2 / scale), (zmin + zmax) / (-2 / scale)]; 54 56 node["modelMatrix"] = recalculateModelMatrix(node); 55 57 console.log(node); 56 58 //some defaults: 57 59 texcoords.itemSize = 2; … … 109 111 vertices.itemSize = 3; 110 112 var cmap=options.getfieldvalue('cmap','jet'); 111 113 console.log(datamin,datamax,data); 112 114 for(var i = 0; i < x.length; i++){ 113 115 vertices[vertices.length] = x[i]; -
issm/trunk-jpl/src/m/plot/webgl.js
r19870 r19871 92 92 gl.bindTexture(gl.TEXTURE_2D, texture); 93 93 gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); 94 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, texture.image); 95 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); 96 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); 94 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.image); 95 gl.generateMipmap(gl.TEXTURE_2D); 96 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR); 97 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); 98 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); 99 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); 97 100 gl.bindTexture(gl.TEXTURE_2D, null); 98 101 } //}}}
Note:
See TracChangeset
for help on using the changeset viewer.