some comments and minor changes in A3D

This commit is contained in:
codeanticode
2010-04-17 02:56:43 +00:00
parent 7776abfdaf
commit 80f0da63e6
2 changed files with 8 additions and 6 deletions

View File

@@ -110,10 +110,12 @@ import android.graphics.Color;
*/
public class PGraphics extends PImage implements PConstants {
public int VERTEXCOUNT = 0; // Just for debugging purposes, I'll remove soon. Andres
// These three are only for debugging/benchmarking purposes. I will remove soon (Andres):
public int VERTEXCOUNT = 0;
public int TRIANGLECOUNT = 0;
public int FACECOUNT = 0;
// ........................................................
// width and height are already inherited from PImage

View File

@@ -380,7 +380,7 @@ public class PGraphicsAndroid3D extends PGraphics {
colorArray = new int[DEFAULT_BUFFER_SIZE * 4];
texCoordArray = new int[DEFAULT_BUFFER_SIZE * 2];
normalArray = new int[DEFAULT_BUFFER_SIZE * 3];
buffersAllocated = true;
}
}
@@ -492,8 +492,8 @@ public class PGraphicsAndroid3D extends PGraphics {
vertexBuffer.rewind();
colorBuffer.rewind();
texCoordBuffer.rewind();
normalBuffer.rewind();
normalBuffer.rewind();
textureImage = null;
textureImagePrev = null;
@@ -1535,7 +1535,7 @@ public class PGraphicsAndroid3D extends PGraphics {
normalArray[3 * n + 1] = toFixed32(a[NY]);
normalArray[3 * n + 2] = toFixed32(a[NZ]);
texCoordArray[2 * n + 0] = toFixed32((cx + sx * a[U]) * uscale);
texCoordArray[2 * n + 1] = toFixed32((cy + sy * a[V]) * vscale);
texCoordArray[2 * n + 1] = toFixed32((cy + sy * a[V]) * vscale);
n++;
VERTEXCOUNT++;
@@ -1583,7 +1583,7 @@ public class PGraphicsAndroid3D extends PGraphics {
normalArray[3 * n + 1] = toFixed32(c[NY]);
normalArray[3 * n + 2] = toFixed32(c[NZ]);
texCoordArray[2 * n + 0] = toFixed32((cx + sx * c[U]) * uscale);
texCoordArray[2 * n + 1] = toFixed32((cy + sy * c[V]) * vscale);
texCoordArray[2 * n + 1] = toFixed32((cy + sy * c[V]) * vscale);
n++;
VERTEXCOUNT++;