Revision ab8b600b
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/objects/FactoryCubit.java | ||
---|---|---|
39 | 39 |
private static final float SQ3 = (float)Math.sqrt(3); |
40 | 40 |
private static final float SQ6 = (float)Math.sqrt(6); |
41 | 41 |
|
42 |
private static final float IVY_D = 0.12f;
|
|
42 |
private static final float IVY_D = 0.02f;
|
|
43 | 43 |
private static final int IVY_N = 8; |
44 | 44 |
|
45 | 45 |
private static final Static1D RADIUS = new Static1D(1); |
... | ... | |
507 | 507 |
final float angle = (float)Math.PI/(2*IVY_N); |
508 | 508 |
final float CORR = 1.0f - IVY_D*SQ2; |
509 | 509 |
final float DIST = 0.4f; |
510 |
final float DIST2 = -0.5f*CORR; |
|
510 | 511 |
final float CORR2 = 0.5f; |
511 | 512 |
float[] vertices = new float[2*(IVY_N+1)+6]; |
512 | 513 |
|
513 |
vertices[0] = ( 0.5f -DIST)*CORR2;
|
|
514 |
vertices[1] = (-0.5f+IVY_D-DIST)*CORR2;
|
|
515 |
vertices[2] = ( 0.5f -DIST)*CORR2;
|
|
516 |
vertices[3] = ( 0.5f -DIST)*CORR2;
|
|
517 |
vertices[4] = (-0.5f+IVY_D-DIST)*CORR2;
|
|
518 |
vertices[5] = ( 0.5f -DIST)*CORR2;
|
|
514 |
vertices[0] = (0.5f -DIST) * CORR2;
|
|
515 |
vertices[1] = (DIST2-DIST) * CORR2;
|
|
516 |
vertices[2] = (0.5f -DIST) * CORR2;
|
|
517 |
vertices[3] = (0.5f -DIST) * CORR2;
|
|
518 |
vertices[4] = (DIST2-DIST) * CORR2;
|
|
519 |
vertices[5] = (0.5f -DIST) * CORR2;
|
|
519 | 520 |
|
520 | 521 |
for(int i=0; i<=IVY_N; i++) |
521 | 522 |
{ |
... | ... | |
1268 | 1269 |
for( VertexEffect effect : effects ) mesh.apply(effect); |
1269 | 1270 |
|
1270 | 1271 |
Static3D center = new Static3D(-0.5f,-0.5f,-0.5f); |
1271 |
Static3D[] vertices = new Static3D[4]; |
|
1272 |
float DIST = IVY_D-0.5f; |
|
1273 |
vertices[0] = new Static3D(+0.5f,+0.5f,+0.5f); |
|
1274 |
vertices[1] = new Static3D( DIST,+0.5f,+0.5f); |
|
1275 |
vertices[2] = new Static3D(+0.5f, DIST,+0.5f); |
|
1276 |
vertices[3] = new Static3D(+0.5f,+0.5f, DIST); |
|
1272 |
Static3D[] vertices1 = new Static3D[1]; |
|
1273 |
vertices1[0] = new Static3D(+0.0f,+0.0f,+0.0f); |
|
1277 | 1274 |
|
1278 |
roundCorners(mesh,center,vertices,0.06f,0.12f); |
|
1275 |
Static3D[] vertices2 = new Static3D[3]; |
|
1276 |
float DIST = IVY_D-1.0f; |
|
1277 |
vertices2[0] = new Static3D( DIST,+0.0f,+0.0f); |
|
1278 |
vertices2[1] = new Static3D(+0.0f, DIST,+0.0f); |
|
1279 |
vertices2[2] = new Static3D(+0.0f,+0.0f, DIST); |
|
1280 |
|
|
1281 |
roundCorners(mesh,center,vertices1,0.04f,0.20f); |
|
1282 |
// roundCorners(mesh,center,vertices2,0.02f,0.20f); |
|
1279 | 1283 |
|
1280 | 1284 |
mesh.mergeEffComponents(); |
1281 | 1285 |
|
... | ... | |
1294 | 1298 |
vertices[0] = new Static3D(+DIST,-DIST,+0.0f); |
1295 | 1299 |
vertices[1] = new Static3D(-DIST,+DIST,+0.0f); |
1296 | 1300 |
|
1297 |
roundCorners(mesh,center,vertices,0.10f,0.30f);
|
|
1301 |
roundCorners(mesh,center,vertices,0.05f,0.30f);
|
|
1298 | 1302 |
|
1299 | 1303 |
mesh.mergeEffComponents(); |
1300 | 1304 |
mesh.addEmptyTexComponent(); |
Also available in: Unified diff
Progress with the Ivy.