Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////
- ///////CIRCULO ///////////////////////////
- /////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- // a e b sao o centro
- var a = 0;
- var b = 0;
- //coordenadas
- var z =0;
- //angulo
- var teta = 30; //angulos
- var angulo = (teta*2*Math.PI)/360; //radianos
- //raio
- var r = 1.0;
- this.vertices = [];
- this.indices = [];
- this.vertices.push(r);
- this.vertices.push(0);
- this.vertices.push(z);
- while(angulo < 2*Math.PI){
- this.vertices.push(a+r*Math.cos(angulo));
- this.vertices.push(b+r*Math.sin(angulo));
- this.vertices.push(z);
- angulo = angulo + (teta*2*Math.PI)/360;
- }
- // adicionar o centro
- this.vertices.push(a);
- this.vertices.push(b);
- this.vertices.push(z);
- var tamanho = (this.vertices.lengh-1);
- for(i=1, j=0;i < tamanho ; j=0, i++){
- this.indices.push(j);
- this.indices.push(i);
- this.indices.push(tamanho);
- }
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
- /////////////////////////////////////////
- ///////DODECAEDRO REGULAR //////////////
- ////////////////////////////////////////
- //////// MAAAAAAAAAAAAAAALLL////////////
- ////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- var y = 0.5;
- var e = 2.0;
- var h = 0.125;
- var a = 0.35;
- this.vertices = [
- e-y, e/2,e+h, //0
- e,0,e, //1
- e+h,y,e/2, //2
- e+h,y+a, e/2, //3
- e,e,e, //4
- y,e/2,e+h, //5
- 0,0,e, //6
- e/2,e+h, //7
- e/2,-h,y, //8
- e, 0, 0, //9
- e-y,e/2,-h, //10
- e, e, 0, //11
- e/2, e+h, y, //12
- e/2,e+h,y+1, //13
- 0, e,e, //14
- -h,y,e/2, //15
- 0, 0, 0, //16
- y,e/2,-h, //17
- 0, e, 0, //18
- -h,y+a,e/2, //19
- ];
- this.indices = [
- 0,1,2,
- 2,3,4,
- 4,0,1,
- 9,2,3
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
- /////////////////////////////////////////
- ///////PIRAMIDE TRIANGULAR //////////////
- /////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- this.vertices = [
- 0, 0, 0, //0
- 0.5, 0, 0, //1
- 0.5, 0.5, 0, //2
- 0, 0.5, 0, //3
- 0.25,0.25,1.0, //4
- ];
- this.indices = [
- 0,1,2,
- 0,1,4,
- 2,4,1,
- 1,0,3,
- 3,2,1,
- 0,4,2
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
- ///////////////////////////////////////////
- ///////PIRAMIDE QUADRANGULAR //////////////
- /////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- this.vertices = [
- 0, 0, 0, //0
- 0.5, 0, 0, //1
- 0.5, 0.5, 0, //2
- 0, 0.5, 0, //3
- 0.25,0.25,1.0, //4
- ];
- this.indices = [
- 0,1,2,
- 2,3,0,
- 0,1,4,
- 2,4,1,
- 3,4,2,
- 0,4,3,
- 1,0,3,
- 3,2,1
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
- ///////////////////////////////////////////
- /////// CUBO ////////////////////////////
- /////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- this.vertices = [
- -0.5, -0.5, 0, //0
- 0.5, -0.5, 0, //1
- -0.5, 0.5, 0, //2
- 0.5, 0.5, 0, //3
- 0.5,-0.5,0.5, //4
- 0.5,0.5,0.5, //5
- -0.5,0.5,0.5, //6
- -0.5,-0.5,0.5, //7
- ];
- this.indices = [
- 2,3,1,
- 1,0,2,
- 4,5,6,
- 6,7,4,
- 5,4,1,
- 1,3,5,
- 0,7,6,
- 6,2,0,
- 5,3,2,
- 2,6,5,
- 4,7,0,
- 0,1,4,
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
- ///////////////////////////////////////////
- /////// ORGINAL //////////////////////////
- /////////////////////////////////////////
- MyObject.prototype.initBuffers = function () {
- this.vertices = [
- -0.5, -0.5, 0, //0
- 0.5, -0.5, 0, //1
- -0.5, 0.5, 0, //2
- 0.5, 0.5, 0, //3
- 0,1.0,0, //4
- 1.0,0.5,0 //5
- -1.0,0.5,0 //6
- ];
- this.indices = [
- 0,1,3,
- 3,2,0,
- 5,4,6
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- ///////////////////////////////////////////
- /////// PRIMEIRO //////////////////////////
- /////////////////////////////////////////
- /*
- MyObject.prototype.initBuffers = function () {
- this.vertices = [
- -0.5, -0.5, 0, //0
- 0.5, -0.5, 0, //1
- -0.5, 0.5, 0, //2
- 0.5, 0.5, 0, //3
- 0,1.5, 0, //4
- 1.0,0.5,0, //5
- -1.0,0.5,0 //6
- ];
- this.indices = [
- 0,1,3,
- 3,2,0,
- 5,4,6
- ];
- this.primitiveType=this.scene.gl.TRIANGLES;
- this.initGLBuffers();
- };
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement