Advertisement
CamolaZ

MyQuad

May 30th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * MyQuad
  3.  * @param gl {WebGLRenderingContext}
  4.  * @constructor
  5.  */
  6. function MyQuad(scene) {
  7.     CGFobject.call(this,scene);
  8.  
  9.     this.initBuffers();
  10. };
  11.  
  12. MyQuad.prototype = Object.create(CGFobject.prototype);
  13. MyQuad.prototype.constructor=MyQuad;
  14.  
  15. MyQuad.prototype.initBuffers = function () {
  16.     this.vertices = [
  17.             -0.5, -0.5, 0,
  18.              0.5, -0.5, 0,
  19.             -0.5,  0.5 , 0,
  20.              0.5,  0.5 , 0
  21.             ];
  22.  
  23.     this.indices =
  24.     [
  25.             0, 1 , 2,
  26.             3, 2 , 1,
  27.     ];
  28.        
  29.     this.primitiveType=this.scene.gl.TRIANGLES;
  30.     this.initGLBuffers();
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement