Revision 45b6b6b5
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
308 | 308 |
private void createMultigon() |
309 | 309 |
{ |
310 | 310 |
float A = 0.5f; |
311 |
int extraIndex = 1;
|
|
312 |
int extraVertices = 1;
|
|
311 |
int extraIndex = 0;
|
|
312 |
int extraVertices = 0;
|
|
313 | 313 |
|
314 | 314 |
float[] v1 = new float[] { -A,-A, A,-A, A,A, -A,A }; |
315 | 315 |
float[] v2 = new float[] { A,-A,2*A,-A,2*A,A, A,A }; |
... | ... | |
318 | 318 |
float[] c1 = new float[] { 0,0 }; |
319 | 319 |
float[] c2 = new float[] { 1.5f*A,0 }; |
320 | 320 |
float[][] centers = new float[][] { c1,c2 }; |
321 |
|
|
321 |
/* |
|
322 | 322 |
float C = 0.5f; |
323 | 323 |
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}; |
324 |
*/ |
|
324 | 325 |
|
325 |
/* |
|
326 |
float B = 0.04f; |
|
327 |
int numBands = 5; |
|
326 |
float B = 0.05f; |
|
327 |
int numBands = 2; |
|
328 | 328 |
float[] bands = new float[2*numBands]; |
329 | 329 |
|
330 | 330 |
for(int i=0; i<numBands; i++) |
... | ... | |
332 | 332 |
bands[2*i ] = 1 + i/(1.0f-numBands); |
333 | 333 |
bands[2*i+1] = B/(numBands-1)*i; |
334 | 334 |
} |
335 |
*/ |
|
335 |
|
|
336 | 336 |
mMesh = new MeshMultigon(vertices,bands,extraIndex,extraVertices,centers); |
337 |
mMesh.setEffectAssociation(0,0,0); |
|
337 |
|
|
338 |
int numEff = mMesh.getNumEffComponents(); |
|
339 |
|
|
340 |
for(int i=0; i<numEff; i++) |
|
341 |
{ |
|
342 |
mMesh.setEffectAssociation(i, 0, i); |
|
343 |
} |
|
344 |
|
|
338 | 345 |
mMesh.setShowNormals(true); |
339 | 346 |
} |
340 | 347 |
|
Also available in: Unified diff
Progress with MeshMultigon. Still auto-computation of 'up' edges does not work.