code: public void makeIndexDeltas(int[] indices) {
          assert indices.length % 3 == 0;
  
          for (int i = indices.length / 3 - 1; i >= 0; --i) {
              // Step 1: Calculate delta from second triangle index to the previous
              // second triangle index, if the previous triangle shares the same first
              // index, otherwise calculate the delta to the first triangle index
              if ((i >= 1) && (indices[i * 3] == indices[(i - 1) * 3])) {
                  indices[i * 3 + 1] -= indices[(i - 1) * 3 + 1];
              } else {
                  indices[i * 3 + 1] -= indices[i * 3];
              }
  
              // Step 2: Calculate delta from third triangle index to the first triangle
              // index
              indices[i * 3 + 2] -= indices[i * 3];
  
              // Step 3: Calculate derivative of the first triangle index
              if (i >= 1) {
                  indices[i * 3] -= indices[(i - 1) * 3];
              }
          }
      }
docs: Calculate various forms of derivatives in order to reduce data entropy.
  
  @param indices index data to encode in place