Revision 52336e82
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/objects/RubikPyraminx.java | ||
---|---|---|
257 | 257 |
int association = 1; |
258 | 258 |
MeshBase[] meshes; |
259 | 259 |
|
260 |
float D = 0.01f;
|
|
260 |
float D = 0.005f;
|
|
261 | 261 |
float E = 0.5f - D*SQ2; |
262 | 262 |
float F = 0.5f - D*SQ2*SQ3; |
263 |
float G = 0.006f; |
|
263 | 264 |
float[] bands; |
264 | 265 |
int extraI, extraV; |
265 | 266 |
|
... | ... | |
267 | 268 |
|
268 | 269 |
switch(size) |
269 | 270 |
{ |
270 |
case 3 : bands = new float[] { 1.0f ,-D,
|
|
271 |
1.0f-D/2,-D*0.55f,
|
|
272 |
1.0f-D ,-D*0.25f,
|
|
273 |
1.0f-2*D,+D*0.25f,
|
|
271 |
case 3 : bands = new float[] { 1.0f ,-G,
|
|
272 |
1.0f-G/2,-G*0.55f,
|
|
273 |
1.0f-G ,-G*0.25f,
|
|
274 |
1.0f-2*G,+G*0.25f,
|
|
274 | 275 |
0.50f, 0.050f, |
275 | 276 |
0.0f, 0.055f }; |
276 | 277 |
extraI = 2; |
277 | 278 |
extraV = 2; |
278 | 279 |
break; |
279 |
case 4 : bands = new float[] { 1.0f ,-D,
|
|
280 |
1.0f-D*1.2f,-D*0.55f,
|
|
281 |
1.0f-2*D, +D*0.25f,
|
|
280 |
case 4 : bands = new float[] { 1.0f ,-G,
|
|
281 |
1.0f-G*1.2f,-G*0.55f,
|
|
282 |
1.0f-2*G, +G*0.25f,
|
|
282 | 283 |
0.50f, 0.050f, |
283 | 284 |
0.0f, 0.055f }; |
284 | 285 |
extraI = 2; |
285 | 286 |
extraV = 2; |
286 | 287 |
break; |
287 |
default: bands = new float[] { 1.0f ,-D,
|
|
288 |
1.0f-D*1.2f,-D*0.55f,
|
|
289 |
1.0f-2*D, +D*0.25f,
|
|
288 |
default: bands = new float[] { 1.0f ,-G,
|
|
289 |
1.0f-G*1.2f,-G*0.55f,
|
|
290 |
1.0f-2*G, +G*0.25f,
|
|
290 | 291 |
0.50f, 0.050f, |
291 | 292 |
0.0f, 0.055f }; |
292 | 293 |
extraI = 2; |
... | ... | |
313 | 314 |
Static3D a3 = new Static3D( SQ2*SQ3/3, -1.0f/3, -SQ2/3 ); |
314 | 315 |
|
315 | 316 |
float tetraHeight = SQ2*SQ3/3; |
316 |
float d1 = 0.75f*tetraHeight;
|
|
317 |
float d1 = (0.75f-2*SQ2*D)*tetraHeight;
|
|
317 | 318 |
float d2 =-0.10f*tetraHeight; |
318 | 319 |
float d3 = 0.20f*tetraHeight; |
319 | 320 |
|
... | ... | |
399 | 400 |
|
400 | 401 |
void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side) |
401 | 402 |
{ |
402 |
float STROKE = 0.06f*side;
|
|
403 |
float STROKE = 0.044f*side;
|
|
403 | 404 |
float OFF = STROKE/2 -1; |
404 | 405 |
float OFF2 = 0.5f*side + OFF; |
405 | 406 |
float HEIGHT = side - OFF; |
Also available in: Unified diff
Tweaks for the new RubikPyraminx mesh so it looks better.