Revision 46a0999e
Added by Leszek Koltunski over 2 years ago
| src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
|---|---|---|
| 270 | 270 |
private void createPolygon() |
| 271 | 271 |
{
|
| 272 | 272 |
float A = 0.5f; |
| 273 |
float B = 0.5f; |
|
| 274 |
|
|
| 275 |
int extraIndex = 0; |
|
| 276 |
int extraVertices = 0; |
|
| 277 |
int numBands = 3; |
|
| 273 |
float B = 0.04f; |
|
| 278 | 274 |
|
| 275 |
int extraIndex = 1; |
|
| 276 |
int extraVertices = 1; |
|
| 279 | 277 |
float[] vertices = new float[] { -A,-A, A,-A, A,A, -A,A };
|
| 278 |
|
|
| 279 |
float C = 0.5f; |
|
| 280 |
float[] bands = new float[] { 1.0f, 0.00f*C, 0.9f, 0.04f*C, 0.8f, 0.07f*C, 0.5f, 0.09f*C, 0.0f, 0.10f*C};
|
|
| 281 |
|
|
| 282 |
/* |
|
| 283 |
int numBands = 5; |
|
| 280 | 284 |
float[] bands = new float[2*numBands]; |
| 281 | 285 |
|
| 282 | 286 |
for(int i=0; i<numBands; i++) |
| ... | ... | |
| 284 | 288 |
bands[2*i ] = 1 + i/(1.0f-numBands); |
| 285 | 289 |
bands[2*i+1] = B/(numBands-1)*i; |
| 286 | 290 |
} |
| 291 |
*/ |
|
| 292 |
boolean[] up = new boolean[] {true,false,false,false};
|
|
| 287 | 293 |
|
| 288 |
mMesh = new MeshPolygon(vertices,bands,extraIndex,extraVertices);
|
|
| 294 |
mMesh = new MeshPolygon(vertices,bands,up,extraIndex,extraVertices,0.0f,0.0f);
|
|
| 289 | 295 |
mMesh.setEffectAssociation(0,0,0); |
| 290 | 296 |
mMesh.setShowNormals(true); |
| 291 | 297 |
} |
Also available in: Unified diff
MeshPolygon: support for an arbitrary subset of edges being 'up' (i.e. buildup to MeshMultigon)