Project

General

Profile

« Previous | Next » 

Revision b379da66

Added by Leszek Koltunski 8 months ago

fix the 'band' problem in the TwistyBandagedMegaminx.

View differences:

src/main/java/org/distorted/library/mesh/MeshMultigon.java
645 645
    return ret;
646 646
    }
647 647

  
648
///////////////////////////////////////////////////////////////////////////////////////////////////
649

  
650
  private void printVertices(float[][][] vertices)
651
    {
652
    StringBuilder sb = new StringBuilder();
653
    int loop=0;
654

  
655
    for(float[][] vert : vertices)
656
      {
657
      sb.append("Loop ");
658
      sb.append(loop);
659
      sb.append(" : { ");
660

  
661
      loop++;
662
      int num=0;
663

  
664
      for( float[] v : vert)
665
        {
666
        if( num>=0 ) sb.append(", ");
667
        num++;
668

  
669
        sb.append(v[0]);
670
        sb.append(", ");
671
        sb.append(v[1]);
672
        }
673

  
674
      sb.append(" }\n");
675
      }
676

  
677
    android.util.Log.e("D", "vertices: \n"+sb);
678
    }
679

  
680
///////////////////////////////////////////////////////////////////////////////////////////////////
681

  
682
  private void printBand(float[] band)
683
    {
684
    StringBuilder sb = new StringBuilder();
685

  
686
    for(float v : band)
687
      {
688
      sb.append(v);
689
      sb.append("f, ");
690
      }
691

  
692
    android.util.Log.e("D", "band: \n"+sb);
693
    }
694

  
648 695
///////////////////////////////////////////////////////////////////////////////////////////////////
649 696
/**
650 697
 * Specify several lists of vertices. Each list defines one polygon. (@see MeshPolygon).
......
659 706
  public MeshMultigon(float[][][] vertices, float[] band, int exBands, int exVertices)
660 707
    {
661 708
    super();
662

  
709
/*
710
    if( debug )
711
      {
712
      printVertices(vertices);
713
      printBand(band);
714
      android.util.Log.e("D", "exBands="+exBands+" exVertices="+exVertices);
715
      android.util.Log.e("D", "-");
716
      }
717
*/
663 718
    int numTriangles=0;
664 719
    for(float[][] vertex : vertices) numTriangles+=vertex.length;
665 720
    MeshBandedTriangle[] triangles = new MeshBandedTriangle[numTriangles];

Also available in: Unified diff