Project

General

Profile

« Previous | Next » 

Revision 768149e8

Added by Leszek Koltunski about 1 year ago

Coin Tetrahedron: progress

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCoinTetrahedron.java
25 25
import org.distorted.objectlib.main.ObjectSignatures;
26 26
import org.distorted.objectlib.main.ObjectType;
27 27
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
28
import org.distorted.objectlib.shape.ShapeHexahedron;
28
import org.distorted.objectlib.shape.ShapeTetrahedron;
29 29
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron;
30 30

  
31 31
///////////////////////////////////////////////////////////////////////////////////////////////////
32 32

  
33
public class TwistyCoinTetrahedron extends ShapeHexahedron
33
public class TwistyCoinTetrahedron extends ShapeTetrahedron
34 34
{
35 35
  static final Static3D[] ROT_AXIS = new Static3D[]
36 36
         {
......
72 72
    {
73 73
    if( mCuts==null )
74 74
      {
75
      float[] cut = new float[] {-0.95f*(SQ6/4),SQ6/6};
75
      float[] cut = new float[] { 0,SQ6/6};
76 76
      mCuts = new float[][] { cut,cut,cut,cut };
77 77
      }
78 78

  
......
140 140
            {-1.5f, 0.75f*SQ2, 0.0f},
141 141
        };
142 142

  
143
    float A = 1.04f;
143
    float A = 1.06f;
144 144
    M = new float[4][3];
145 145

  
146 146
    for(int i=0; i<4; i++)
......
174 174
      {
175 175
      if( V==null ) initVertices();
176 176

  
177
      float A = -0.015f;
177
      float A = -0.016f;
178 178
      float[] r0 = new float[] { A*(V[0][0]-M[0][0]), A*(V[0][1]-M[0][1]), A*(V[0][2]-M[0][2]) };
179 179
      float[] r1 = new float[] { A*(V[1][0]-M[1][0]), A*(V[1][1]-M[1][1]), A*(V[1][2]-M[1][2]) };
180 180
      float[] r2 = new float[] { A*(V[2][0]-M[2][0]), A*(V[2][1]-M[2][1]), A*(V[2][2]-M[2][2]) };
......
253 253
    {
254 254
    float[][] ret = new float[5 + 3*(N+1) +3][];
255 255

  
256
    float C = 0.85f;
256
    float C = 0.97f;
257 257
    ret[0] = new float[] { 0.00f,   0.0f     ,   0.00f };
258 258
    ret[1] = new float[] { 0.00f,   0.0f     ,  -1.50f };
259 259
    ret[2] = new float[] { 0.75f,   0.75f*SQ2,  -0.75f };
......
504 504
    {
505 505
    if( variant==0 )
506 506
      {
507
      float h1 = isInIconMode() ? 0.001f : 0.02f;
507
      float h1 = isInIconMode() ? 0.001f : 0.03f;
508 508
      float h2 = isInIconMode() ? 0.001f : 0.01f;
509 509
      float[][] bands = { {h1,35,0.2f,0.4f,5,1,0}, {h2,35,0.2f,0.4f,2,0,0} };
510 510
      int num = 9+3*N+3;
......
526 526
      }
527 527
    else
528 528
      {
529
      float h1 = isInIconMode() ? 0.001f : 0.02f;
529
      float h1 = isInIconMode() ? 0.001f : 0.015f;
530 530
      float h2 = isInIconMode() ? 0.001f : 0.00f;
531 531
      float[][] bands = { {h1,15,0.250f,0.7f,5,0,0}, {h2,15,0.125f,0.2f,2,0,0} };
532 532
      int num = 2+2*(N-1)+1;
......
600 600
  @Override
601 601
  public void adjustStickerCoords()
602 602
    {
603
    float L = 0.02f;
604
    float Z = 0.06422593f - L;
603
    float L = 0.025f;
604
    float Z = 0.06422593f - 0.25f*L;
605 605
    float X = 0.5f - L;
606 606

  
607
    float K = 0.95f;
607
    float K = 1.48f;
608 608
    float A = K*0.50f;
609 609
    float B = K*0.25f;
610 610
    float C = K*0.43301257f;
......
627 627
  public float[][] getStickerAngles()
628 628
    {
629 629
    float D1 = (float)(Math.PI/3);
630
    float D2 = (float)(Math.PI/6);  // really 6, but with 8 it looks better
631
    return new float[][] { { 0,0,0,-D1,0 },{-D2,-D2,-D2},{D1,D2} };
630
    float D2 = (float)(Math.PI/5);
631
    float D3 = (float)(Math.PI/6);
632
    return new float[][] { { 0,0,0,-D1,0 },{D2,D2,D2},{D1,D3} };
632 633
    }
633 634

  
634 635
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff