Changeset 19727 for issm/trunk-jpl/src/m/plot/plot_unit.js
- Timestamp:
- 11/16/15 16:55:06 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_unit.js
r19724 r19727 9 9 //edgecolor 10 10 edgecolor=options.getfieldvalue('edgecolor','none'); 11 12 /*First initialize webgl for the corresponding canvas: */ 13 var canvas=document.getElementById(options.getfieldvalue('canvasid')); 14 15 //Initialize the GL context: 16 var gl=initWebGL(canvas); 17 18 // Only continue if WebGL is available and working 19 20 if (gl) { 21 // Set clear color to black, fully opaque 22 gl.clearColor(0.0, 0.0, 0.0, 1.0); 23 // Enable depth testing 24 gl.enable(gl.DEPTH_TEST); 25 // Near things obscure far things 26 gl.depthFunc(gl.LEQUAL); 27 // Clear the color as well as the depth buffer. 28 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); 29 } 11 30 12 31 switch(datatype){ … … 42 61 case 2: 43 62 44 45 46 63 if (elements[0].length==6){ //prisms 47 64 /*A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6); … … 60 77 } 61 78 else{ 62 63 var canvas=document.getElementById(options.getfieldvalue('canvasid'));64 65 //Initialize the GL context:66 var gl=initWebGL(canvas);67 68 // Only continue if WebGL is available and working69 70 if (gl) {71 // Set clear color to black, fully opaque72 gl.clearColor(0.0, 0.0, 0.0, 1.0);73 // Enable depth testing74 gl.enable(gl.DEPTH_TEST);75 // Near things obscure far things76 gl.depthFunc(gl.LEQUAL);77 // Clear the color as well as the depth buffer.78 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);79 }80 79 81 80 /*A=elements(:,1); B=elements(:,2); C=elements(:,3);
Note:
See TracChangeset
for help on using the changeset viewer.