Project

General

Profile

« Previous | Next » 

Revision a4af26c1

Added by Leszek Koltunski about 2 years ago

Progress with cubit quaternions.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCrystal.java
75 75

  
76 76
  public Static4D getCubitQuats(int cubit, int[] numLayers)
77 77
    {
78
    if( mQuatIndex==null ) mQuatIndex = new int[] { 17,12,13,20, 0, 4,25, 5,24,16,
78
    if( mQuatIndex==null ) mQuatIndex = new int[] {  0,17,12,13,20, 4,25, 5,24,16,
79 79
                                                     9,21, 1,34, 8,11,30,43,26,14,
80 80
                                                    15,45,33,28,10, 2,29, 6, 7, 3,
81 81

  
......
88 88

  
89 89
  public ObjectShape getObjectShape(int variant)
90 90
    {
91
    float[] blueCenter = mCenterCoords[0];
92
    float[] greeCenter = mCenterCoords[1];
93
    float[] pinkCenter = mCenterCoords[2];
94

  
91 95
    if( variant==0 )
92 96
      {
93
      float B = mCenterCoords[0][2]-mCorners[0][2];
97
      float B = greeCenter[2]-mCorners[0][2];
94 98
      float C = A*mCorners[0][1]+(1.0f-A)*mCorners[2][1];
95
      float D = mCenterCoords[0][0];
99
      float D = greeCenter[0];
96 100

  
97 101
      float[][] vertices =
98 102
         {
......
133 137
             {X1-X, Y1-Y, Z1-Z},
134 138
             {X2-X, Y2-Y, Z2-Z},
135 139
             {X3-X, Y3-Y, Z3-Z},
136
             { mCenterCoords[0][0]-X, mCenterCoords[0][1]-Y, mCenterCoords[0][2]-Z },
137
             { mCenterCoords[1][0]-X, mCenterCoords[1][1]-Y, mCenterCoords[1][2]-Z },
138
             { mCenterCoords[8][0]-X, mCenterCoords[8][1]-Y, mCenterCoords[8][2]-Z }
140
             { greeCenter[0]-X, greeCenter[1]-Y, greeCenter[2]-Z },
141
             { pinkCenter[0]-X, pinkCenter[1]-Y, pinkCenter[2]-Z },
142
             { blueCenter[0]-X, blueCenter[1]-Y, blueCenter[2]-Z }
139 143
         };
140 144
      int[][] indices =
141 145
         {

Also available in: Unified diff