Project

General

Profile

« Previous | Next » 

Revision c6f4bd1e

Added by Leszek Koltunski over 2 years ago

Trajber's Octahedron: first try.

View differences:

src/main/AndroidManifest.xml
12 12
        android:allowBackup="true"
13 13
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
14 14

  
15
        <activity android:name=".TableOfContents">
15
        <activity android:name=".TableOfContents" android:exported="true">
16 16
            <intent-filter>
17 17
                <action android:name="android.intent.action.MAIN" />
18 18
                <category android:name="android.intent.category.LAUNCHER" />
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
289 289

  
290 290
    private void createMesh()
291 291
      {
292
      int mode            =17;
292
      int mode            =20;
293 293
      int numComponents   = 0;
294 294
      float[][] vertices  = null;
295 295
      int[][] vertIndexes = null;
......
1293 1293
        numComponents = 5;
1294 1294
        }
1295 1295

  
1296
      ///// TRAJBER'S FACE ///////////////////////////////////////////////////////////////
1297

  
1298
      else if( mode==18 )
1299
        {
1300
        final float CUT = 1.0f/6;
1301
        final float LEN = 3*SQ2/2;
1302

  
1303
        final float A = CUT*LEN;
1304
        final float B = A-LEN;
1305

  
1306
        vertices = new float[][]
1307
          {
1308
             {    0,    0,    0},
1309
             {    0,    A,   -A},
1310
             {    0,   -A,   -A},
1311
             {    A,    0,   -A},
1312
             {   -A,    0,   -A},
1313
             {    A,    A, -2*A},
1314
             {    A,   -A, -2*A},
1315
             {   -A,    A, -2*A},
1316
             {   -A,   -A, -2*A},
1317
             {    A,    A,    B},
1318
             {    A,   -A,    B},
1319
             {   -A,    A,    B},
1320
             {   -A,   -A,    B}
1321
          };
1322

  
1323
        vertIndexes = new int[][]
1324
          {
1325
             {0,3,5,1},
1326
             {0,2,6,3},
1327
             {0,4,8,2},
1328
             {0,1,7,4},
1329
             {3,6,10,9,5},
1330
             {2,8,12,10,6},
1331
             {4,7,11,12,8},
1332
             {1,5,9,11,7},
1333
             {9,10,12,11}
1334
          };
1335

  
1336
         bands         = new float[][] { {0.05f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,3,0,0} };
1337
         bandIndexes   = new int[] { 0,0,0,0,1,1,1,1,1 };
1338
         corners       = new float[][] { {0.03f,0.10f} };
1339
         cornerIndexes = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 };
1340
         centers       = new float[][] { {0.0f, 0.0f, -LEN/2} };
1341
         centerIndexes = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 };
1342

  
1343
         numComponents = 9;
1344
         }
1345

  
1346
      ///// TRAJBER'S EDGE ///////////////////////////////////////////////////////////////
1347

  
1348
      else if( mode==19 )
1349
        {
1350
        final float CUT = 1.0f/6;
1351
        final float LEN = 3*SQ2/2;
1352

  
1353
        final float A = CUT*LEN;
1354
        final float B = A-LEN;
1355

  
1356
        vertices = new float[][]
1357
          {
1358
             {    A-LEN/2,    0,   -A+LEN/2},
1359
             {    A-LEN/2,    A, -2*A+LEN/2},
1360
             {    A-LEN/2,   -A, -2*A+LEN/2},
1361
             {   -B-LEN/2,    0,    B+LEN/2},
1362
             { -B-A-LEN/2,    A,    B+LEN/2},
1363
             { -B-A-LEN/2,   -A,    B+LEN/2},
1364
             {    A-LEN/2,    A,    B+LEN/2},
1365
             {    A-LEN/2,   -A,    B+LEN/2},
1366
          };
1367

  
1368
        vertIndexes = new int[][]
1369
          {
1370
             {0,3,4,1},
1371
             {0,2,5,3},
1372
             {1,4,6},
1373
             {2,7,5},
1374
             {0,1,6,7,2},
1375
             {3,5,7,6,4}
1376
          };
1377

  
1378
        bands        = new float[][] { {0.03f,35,0.15f,0.3f,3,1,1},{0.00f,35,0.15f,0.3f,3,0,0} };
1379
        bandIndexes  = new int[] { 0,0,1,1,1,1 };
1380
        corners      = new float[][] { {0.02f,0.10f} };
1381
        cornerIndexes= new int[] { 0,0,0,0,0,0,-1,-1 };
1382
        centers      = new float[][] { {-LEN/4, 0, -LEN/4} };
1383
        centerIndexes= new int[] { 0,0,0,0,0,0,-1,-1 };
1384

  
1385
        numComponents = 9;
1386
        }
1387

  
1388
      ///// TRAJBER'S CORNER ///////////////////////////////////////////////////////////////
1389

  
1390
      else if( mode==20 )
1391
        {
1392
        final float CUT = 1.0f/6;
1393
        final float LEN = 3*SQ2/2;
1394

  
1395
        final float A = CUT*LEN;
1396
        final float B = A-LEN;
1397

  
1398
        vertices = new float[][]
1399
          {
1400
             {   A-LEN/3,   A-LEN/3, -2*A+2*LEN/3},
1401
             {-B-A-LEN/3,   A-LEN/3,    B+2*LEN/3},
1402
             {   A-LEN/3,-B-A-LEN/3,    B+2*LEN/3},
1403
             {   A-LEN/3,   A-LEN/3,    B+2*LEN/3},
1404
          };
1405

  
1406
        vertIndexes = new int[][]
1407
          {
1408
             {0,1,2},
1409
             {0,1,3},
1410
             {0,2,3},
1411
             {1,3,2},
1412
          };
1413

  
1414
        bands        = new float[][] { {0.05f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} };
1415
        bandIndexes  = new int[] { 0,1,1,1 };
1416
        corners      = new float[][] { {0.02f,0.10f} };
1417
        cornerIndexes= new int[] { 0,0,0,-1 };
1418
        centers      = new float[][] { {(A-LEN/3)/2 , (A-LEN/3)/2 , (B-LEN/3)/2} };
1419
        centerIndexes= new int[] { 0,0,0,-1 };
1420

  
1421
        numComponents = 9;
1422
        }
1423

  
1296 1424
      ///// END DEFINITIONS /////////////////////////////////////////////////////////////////
1297 1425

  
1298 1426
      FactoryCubit factory = FactoryCubit.getInstance();

Also available in: Unified diff