Changeset 19724


Ignore:
Timestamp:
11/16/15 16:26:18 (9 years ago)
Author:
Eric.Larour
Message:

CHG: starting web gl integration.

Location:
issm/trunk-jpl/src/m/plot
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/plot_manager.js

    r19721 r19724  
    99        //parse options and get a structure of options.
    1010        checkplotoptions(md,options);
    11 
    12         options.disp();
    1311
    1412        //get data to be displayed
     
    232230                }
    233231        }
    234         applyoptions(md,data2,options);
     232        //applyoptions(md,data2,options);
    235233}
  • issm/trunk-jpl/src/m/plot/plot_unit.js

    r19721 r19724  
    4242                case 2:
    4343
     44                       
     45
    4446                        if (elements[0].length==6){ //prisms
    4547                                /*A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
     
    5860                        }
    5961                        else{
    60                                 throw Error('Here we are, take it over Dan');
     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 working
     69
     70                                if (gl) {
     71                                        // Set clear color to black, fully opaque
     72                                        gl.clearColor(0.0, 0.0, 0.0, 1.0);
     73                                        // Enable depth testing
     74                                        gl.enable(gl.DEPTH_TEST);
     75                                        // Near things obscure far things
     76                                        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                               
    6181                                /*A=elements(:,1); B=elements(:,2); C=elements(:,3);
    6282                                  patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
Note: See TracChangeset for help on using the changeset viewer.