Revision 05403bba
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/MeshObject.java | ||
---|---|---|
39 | 39 |
protected static final int TEX_DATA_SIZE = 2; // Size of the texture coordinate data in elements. |
40 | 40 |
|
41 | 41 |
protected int dataLength; |
42 |
protected FloatBuffer mGridPositions,mGridNormals,mGridTexture;
|
|
42 |
protected FloatBuffer mMeshPositions, mMeshNormals, mMeshTexture;
|
|
43 | 43 |
|
44 | 44 |
final float zFactor; // strange workaround for the fact that we need to somehow store the 'depth' |
45 | 45 |
// of the Mesh. Used in DistortedEffects. See DistortedTexture.getDepth(). |
... | ... | |
55 | 55 |
|
56 | 56 |
void draw() |
57 | 57 |
{ |
58 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[0], POSITION_DATA_SIZE, GLES20.GL_FLOAT, false, 0, mGridPositions);
|
|
59 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[1], NORMAL_DATA_SIZE , GLES20.GL_FLOAT, false, 0, mGridNormals );
|
|
60 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[2], TEX_DATA_SIZE , GLES20.GL_FLOAT, false, 0, mGridTexture );
|
|
58 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[0], POSITION_DATA_SIZE, GLES20.GL_FLOAT, false, 0, mMeshPositions);
|
|
59 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[1], NORMAL_DATA_SIZE , GLES20.GL_FLOAT, false, 0, mMeshNormals);
|
|
60 |
GLES20.glVertexAttribPointer(Distorted.mMainProgramAttributes[2], TEX_DATA_SIZE , GLES20.GL_FLOAT, false, 0, mMeshTexture);
|
|
61 | 61 |
|
62 | 62 |
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, dataLength); |
63 | 63 |
} |
Also available in: Unified diff
rename all the 'grid' variables to 'mesh'.