Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Pure OpenGL 2D texture binding in processing 2.0

$
0
0
Sorry Makio,

I forgot about the second tab...

Here is the code to add:

  1. float[] projMatrix = new float[16];
  2. float[] mvMatrix = new float[16];
  3. void loadMatrix() {
  4.  
  5.   gl.glMatrixMode(GL2.GL_PROJECTION);
  6.   projMatrix[0] = pgl.projection.m00;
  7.   projMatrix[1] = pgl.projection.m10;
  8.   projMatrix[2] = pgl.projection.m20;
  9.   projMatrix[3] = pgl.projection.m30;
  10.  
  11.   projMatrix[4] = pgl.projection.m01;
  12.   projMatrix[5] = pgl.projection.m11;
  13.   projMatrix[6] = pgl.projection.m21;
  14.   projMatrix[7] = pgl.projection.m31;
  15.  
  16.   projMatrix[8] = pgl.projection.m02;
  17.   projMatrix[9] = pgl.projection.m12;
  18.   projMatrix[10] = pgl.projection.m22;
  19.   projMatrix[11] = pgl.projection.m32;
  20.  
  21.   projMatrix[12] = pgl.projection.m03;
  22.   projMatrix[13] = pgl.projection.m13;
  23.   projMatrix[14] = pgl.projection.m23;
  24.   projMatrix[15] = pgl.projection.m33;
  25.  
  26.   gl.glLoadMatrixf(projMatrix, 0);
  27.  
  28.   gl.glMatrixMode(GL2.GL_MODELVIEW);
  29.   mvMatrix[0] = pgl.modelview.m00;
  30.   mvMatrix[1] = pgl.modelview.m10;
  31.   mvMatrix[2] = pgl.modelview.m20;
  32.   mvMatrix[3] = pgl.modelview.m30;
  33.  
  34.   mvMatrix[4] = pgl.modelview.m01;
  35.   mvMatrix[5] = pgl.modelview.m11;
  36.   mvMatrix[6] = pgl.modelview.m21;
  37.   mvMatrix[7] = pgl.modelview.m31;
  38.  
  39.   mvMatrix[8] = pgl.modelview.m02;
  40.   mvMatrix[9] = pgl.modelview.m12;
  41.   mvMatrix[10] = pgl.modelview.m22;
  42.   mvMatrix[11] = pgl.modelview.m32;
  43.  
  44.   mvMatrix[12] = pgl.modelview.m03;
  45.   mvMatrix[13] = pgl.modelview.m13;
  46.   mvMatrix[14] = pgl.modelview.m23;
  47.   mvMatrix[15] = pgl.modelview.m33;
  48.   gl.glLoadMatrixf(mvMatrix, 0);
  49. }

Sorry about that


Viewing all articles
Browse latest Browse all 1768

Trending Articles