Project

General

Profile

« Previous | Next » 

Revision d84768fe

Added by Leszek Koltunski about 3 years ago

Make Jing standard size (tetra size=2, i.e. equal to numLayers so that DIST2D and DIST3D are standard)

View differences:

src/main/java/org/distorted/objects/MovementJing.java
27 27

  
28 28
class MovementJing extends Movement
29 29
{
30
  static final float DIST3D = SQ6/24;
31
  static final float DIST2D = SQ3/12;
30
  static final float DIST3D = SQ6/12;
31
  static final float DIST2D = SQ3/6;
32 32

  
33 33
  static final Static3D[] FACE_AXIS = new Static3D[]
34 34
         {
src/main/java/org/distorted/objects/TwistyJing.java
49 49
           COLOR_BLUE  , COLOR_RED
50 50
         };
51 51

  
52
  static final float F = 0.24f;  // length of the edge of the corner cubit divided by
53
                                 // the length of the edge of the whole tetrahedron.
54
                                 // keep < 0.25.
52
  static final float F = 0.48f;  // length of the edge of the corner cubit. Keep<0.5
53
                                 // Assuming the length of the edge of the whole
54
                                 // tetrahedron is 2.0 (ie standard, equal to numLayers
55 55

  
56 56
  private ScrambleState[] mStates;
57 57
  private int[] mBasicAngle;
......
124 124
      {
125 125
      mCenters = new float[][]
126 126
         {
127
           { 0.000f, -SQ2/4, 0.500f },
128
           { 0.000f, -SQ2/4,-0.500f },
129
           {-0.500f,  SQ2/4, 0.000f },
130
           { 0.500f,  SQ2/4, 0.000f },
131

  
132
           { 0.000f, -SQ2/4, 0.000f },
133
           {-0.250f, 0.000f, 0.250f },
134
           { 0.250f, 0.000f, 0.250f },
135
           {-0.250f, 0.000f,-0.250f },
136
           { 0.250f, 0.000f,-0.250f },
137
           { 0.000f,  SQ2/4, 0.000f },
138

  
139
           { 0.000f, SQ2/12, 1.0f/6 },
140
           { 0.000f, SQ2/12,-1.0f/6 },
141
           {-1.0f/6,-SQ2/12, 0.000f },
142
           { 1.0f/6,-SQ2/12, 0.000f },
127
           { 0.000f, -SQ2/2, 1.000f },
128
           { 0.000f, -SQ2/2,-1.000f },
129
           {-1.000f,  SQ2/2, 0.000f },
130
           { 1.000f,  SQ2/2, 0.000f },
131

  
132
           { 0.000f, -SQ2/2, 0.000f },
133
           {-0.500f, 0.000f, 0.500f },
134
           { 0.500f, 0.000f, 0.500f },
135
           {-0.500f, 0.000f,-0.500f },
136
           { 0.500f, 0.000f,-0.500f },
137
           { 0.000f,  SQ2/2, 0.000f },
138

  
139
           { 0.000f,  SQ2/6, 1.0f/3 },
140
           { 0.000f,  SQ2/6,-1.0f/3 },
141
           {-1.0f/3, -SQ2/6, 0.000f },
142
           { 1.0f/3, -SQ2/6, 0.000f },
143 143
         };
144 144
      }
145 145

  
......
179 179

  
180 180
  float[][] getCuts(int size)
181 181
    {
182
    float[] cut = { (F-0.25f)*(SQ6/3) };
182
    float[] cut = { (F-0.5f)*(SQ6/3) };
183 183
    return new float[][] { cut,cut,cut,cut };
184 184
    }
185 185

  
......
194 194

  
195 195
  float getScreenRatio()
196 196
    {
197
    return 1.76f;
197
    return 0.88f;
198 198
    }
199 199

  
200 200
///////////////////////////////////////////////////////////////////////////////////////////////////
......
247 247
    final float X = F/2;
248 248
    final float Y = F*SQ2/2;
249 249
    final float Z =-F/2;
250
    final float L = (1-3*F);
250
    final float L = (2.0f-3*F);
251 251
    final float X2= L/2;
252 252
    final float Y2= L*SQ2/2;
253 253
    final float Z2=-L/2;
254 254
    final float D = F/L;
255
    final float G = 1.0f-F;
255 256

  
256 257
    if( variant==0 )
257 258
      {
......
288 289
      {
289 290
      double[][] vertices = new double[][]
290 291
          {
291
             { 0.0, 0.0,     0.5-F },
292
             {   X,   Y,   Z+0.5-F },
293
             { 0.0, 2*Y, 2*Z+0.5-F },
294
             {  -X,   Y,   Z+0.5-F },
295
             { 0.0, 0.0,    -0.5+F },
296
             {   X,   Y,  -Z-0.5+F },
297
             { 0.0, 2*Y,-2*Z-0.5+F },
298
             {  -X,   Y,  -Z-0.5+F },
292
             { 0.0, 0.0,     G },
293
             {   X,   Y,   Z+G },
294
             { 0.0, 2*Y, 2*Z+G },
295
             {  -X,   Y,   Z+G },
296
             { 0.0, 0.0,    -G },
297
             {   X,   Y,  -Z-G },
298
             { 0.0, 2*Y,-2*Z-G },
299
             {  -X,   Y,  -Z-G },
299 300
          };
300 301
      int[][] vert_indices = new int[][]
301 302
          {
......
335 336
             {4,5,2,1}
336 337
          };
337 338

  
338
      float[][] bands     = new float[][] { {0.020f,35,0.20f*(1-3*F),0.6f*(1-3*F),5,1,1}, {0.001f,35,0.05f*(1-3*F),0.1f*(1-3*F),5,1,1} };
339
      float[][] bands     = new float[][] { {0.020f,35,0.20f*L,0.6f*L,5,1,1}, {0.001f,35,0.05f*L,0.1f*L,5,1,1} };
339 340
      int[] bandIndices   = new int[] { 0,1,1,1,1,1 };
340
      float[][] corners   = new float[][] { {0.04f,0.15f} };
341
      float[][] corners   = new float[][] { {0.04f,0.6f*F} };
341 342
      int[] cornerIndices = new int[] { 0,0,0,-1,-1,-1 };
342 343
      float[][] centers   = new float[][] { { 0, -2*Y/3, 4*Z/3 } };
343 344
      int[] centerIndices = new int[] { 0,0,0,-1,-1,-1 };

Also available in: Unified diff