Project

General

Profile

« Previous | Next » 

Revision 16861599

Added by Leszek Koltunski over 3 years ago

Make Rex standard size (cube size=3, i.e. equal to numLayers so that DIST2D and DIST3D are standard)

View differences:

src/main/java/org/distorted/objects/MovementRex.java
25 25

  
26 26
class MovementRex extends Movement
27 27
{
28
  static final float DIST3D = 0.166f;
29
  static final float DIST2D = 0.166f;
28
  static final float DIST3D = 0.5f;
29
  static final float DIST2D = 0.5f;
30 30

  
31 31
  static final Static3D[] FACE_AXIS = new Static3D[]
32 32
         {
src/main/java/org/distorted/objects/TwistyRex.java
119 119

  
120 120
  float getScreenRatio()
121 121
    {
122
    return 1.5f;
122
    return 0.5f;
123 123
    }
124 124

  
125 125
///////////////////////////////////////////////////////////////////////////////////////////////////
......
162 162

  
163 163
  float[][] getCuts(int numLayers)
164 164
    {
165
    float C = SQ3*0.15f; // bit less than 1/6 of the length of the main diagonal
165
    float C = SQ3*0.45f; // bit less than 1/2 of the length of the main diagonal
166 166
    float[] cut = new float[] {-C,+C};
167 167
    return new float[][] { cut,cut,cut,cut };
168 168
    }
......
178 178

  
179 179
  float[][] getCubitPositions(int numLayers)
180 180
    {
181
    final float DIST1= 0.50f;
182
    final float DIST2= (1+2*REX_D)/6;
183
    final float DIST3= 0.51f;
181
    final float DIST1= 1.50f;
182
    final float DIST2= (1+2*REX_D)/2;
183
    final float DIST3= 1.53f;
184 184

  
185 185
    final float[][] CENTERS = new float[24+6+12][];
186 186

  
......
241 241
    if( variant==0 )
242 242
      {
243 243
      float G = (1-REX_D)*SQ2/2;
244

  
245
      double[][] vertices =
246
         {
247
             {  -0.033333f, 0.23333f, 0.0f },
248
             {  -0.233333f, 0.03333f, 0.0f },
249
             {  +0.216666f,-0.23666f, 0.0f },
250
             {  +0.236666f,-0.21666f, 0.0f }
251
         };
252

  
244
      double[][] vertices ={{-0.10f,0.70f,0},{-0.70f,0.10f,0},{+0.65f,-0.71f,0},{+0.71f,-0.65f,0}};
253 245
      int[][] vertIndexes = { {0,1,2,3},{3,2,1,0} };
254
      float[][] centers= new float[][] { {0.0f,0.0f,-G/3} };
255
      float[][] corners= new float[][] { {0.03f,0.10f} };
246
      float[][] centers= new float[][] { {0.0f,0.0f,-G} };
247
      float[][] corners= new float[][] { {0.03f,0.30f} };
256 248
      int[] indices= {-1,-1,0,0};
257 249
      int[] bandIndices= new int[] { 0,1 };
250
      float[][] bands = { {+0.016f,10,G/3,0.5f,5,1,1},{+0.230f,45,G/3,0.0f,2,0,0} };
258 251

  
259
      float[][] bands =
260
        {
261
            {+0.016f,10,G/3,0.5f,5,1,1},
262
            {+0.230f,45,G/3,0.0f,2,0,0}
263
        };
264 252
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
265 253
      }
266 254
    else if( variant==1 )
267 255
      {
268
      double[][] vertices =
269
        {
270
            { -REX_D,   0.0f, 0.0f },
271
            {   0.0f, -REX_D, 0.0f },
272
            { +REX_D,   0.0f, 0.0f },
273
            {   0.0f, +REX_D, 0.0f }
274
        };
275

  
256
      float G = 3*REX_D;
257
      double[][] vertices= { { -G, 0, 0 },{ 0, -G, 0 },{ +G, 0, 0 },{ 0,+G,0 } };
276 258
      int[][] vertIndexes= { {0,1,2,3},{3,2,1,0} };
277 259
      int[] indices= {-1,-1,-1,-1};
278 260
      int[] bandIndices= new int[] { 0,1 };
279

  
280
      float[][] bands =
281
        {
282
            {0.025f,10,REX_D/2,0.5f,5,0,0},
283
            {0.000f,45,REX_D/2,0.0f,2,0,0}
284
        };
261
      float[][] bands = { {0.025f,10,G/2,0.5f,5,0,0},{0.000f,45,G/2,0.0f,2,0,0} };
285 262

  
286 263
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null);
287 264
      }
288 265
    else
289 266
      {
290
      float E = 0.5f - REX_D;
291
      float F = 0.5f;
267
      float E = 1.5f - 3*REX_D;
268
      float F = 1.5f;
292 269
      float G = (float)Math.sqrt(E*E+F*F);
293

  
294
      double[][] vertices =
295
         {
296
             { -F, 0, 0 },
297
             {  0,-E, 0 },
298
             { +F, 0, 0 },
299
             {  0, 0,-E },
300
         };
301

  
270
      double[][] vertices = { { -F, 0, 0 },{  0,-E, 0 },{ +F, 0, 0 },{  0, 0,-E } };
302 271
      int[][] vertIndexes = { {0,1,2}, {0,2,3}, {0,3,1}, {1,3,2} };
303
      float[][] centers= new float[][] { {0.0f,-0.5f,-0.5f} };
304
      float[][] corners= new float[][] { {0.06f,0.10f} };
272
      float[][] centers= new float[][] { {0.0f,-1.5f,-1.5f} };
273
      float[][] corners= new float[][] { {0.06f,0.20f} };
305 274
      int[] indices= {0,-1,0,-1};
306 275
      int[] bandIndices= new int[] { 0,0,1,1 };
307

  
308
      float[][] bands =
309
        {
310
           {0.03f,27,F/3,0.8f,5,2,3},
311
           {0.01f,45,G/3,0.2f,3,1,2}
312
        };
276
      float[][] bands = { {0.03f,27,F/3,0.8f,5,2,3},{0.01f,45,G/3,0.2f,3,1,2} };
313 277

  
314 278
      return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
315 279
      }

Also available in: Unified diff