Revision 05403bba
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/MeshFlat.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
26 | 26 |
/** |
27 |
* Create a flat, rectangular Grid.
|
|
27 |
* Create a flat, rectangular grid.
|
|
28 | 28 |
* <p> |
29 | 29 |
* Perfect if you just want to display a flat Texture. If you are not planning to apply any VERTEX |
30 | 30 |
* effects to it, use MeshFlat(1,1), i.e. a Quad. Otherwise, create more vertices for more realistic effects! |
... | ... | |
184 | 184 |
if( remainingVert!=0 ) |
185 | 185 |
android.util.Log.d("BITMAP", "remainingVert " +remainingVert ); |
186 | 186 |
|
187 |
mGridPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
188 |
mGridPositions.put(positionData).position(0);
|
|
187 |
mMeshPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
188 |
mMeshPositions.put(positionData).position(0);
|
|
189 | 189 |
|
190 |
mGridNormals = ByteBuffer.allocateDirect(NORMAL_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
191 |
mGridNormals.put(normalData).position(0);
|
|
190 |
mMeshNormals = ByteBuffer.allocateDirect(NORMAL_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
191 |
mMeshNormals.put(normalData).position(0);
|
|
192 | 192 |
|
193 |
mGridTexture = ByteBuffer.allocateDirect(TEX_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
194 |
mGridTexture.put(textureData).position(0);
|
|
193 |
mMeshTexture = ByteBuffer.allocateDirect(TEX_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
194 |
mMeshTexture.put(textureData).position(0);
|
|
195 | 195 |
} |
196 | 196 |
} |
Also available in: Unified diff
rename all the 'grid' variables to 'mesh'.