Project

General

Profile

« Previous | Next » 

Revision e0838536

Added by Leszek Koltunski over 3 years ago

Progress with the Kilominx - rotations.

View differences:

src/main/java/org/distorted/examples/meshfile/FactoryCubit.java
749 749
    float[] vertices0 = { -X1, Y2, 0, -Y1, X1, Y2, 0, Y1 };
750 750
    float[] bands0 = computeBands(0.03f,39,0.3f,0.2f,5);
751 751
    float[] vertices1 = { -X2, Y4, 0, -Y3, X2, Y4, 0, Y3 };
752
    float[] bands1 = computeBands(0.00f,27,0.25f,0.5f,2);
752
    float[] bands1 = computeBands(0.00f,27,0.25f,0.5f,5);
753 753

  
754 754
    meshes[0] = new MeshPolygon(vertices0, bands0, 1, 1);
755 755
    meshes[0].setEffectAssociation(0, 1,0);
......
757 757
    meshes[1].setEffectAssociation(0, 2,0);
758 758
    meshes[2] = meshes[0].copy(true);
759 759
    meshes[2].setEffectAssociation(0, 4,0);
760
    meshes[3] = new MeshPolygon(vertices1, bands1, 0, 0);
760
    meshes[3] = new MeshPolygon(vertices1, bands1, 1, 1);
761 761
    meshes[3].setEffectAssociation(0, 8,0);
762 762
    meshes[4] = meshes[3].copy(true);
763 763
    meshes[4].setEffectAssociation(0,16,0);
......
1672 1672
    MeshBase mesh = createFacesMinxCorner();
1673 1673
    VertexEffect[] effects = createVertexEffectsMinxCorner();
1674 1674
    for( VertexEffect effect : effects ) mesh.apply(effect);
1675
/*
1676
    Static3D center = new Static3D(0.0f,-0.5f,-0.5f);
1677
    Static3D[] vertices = new Static3D[2];
1678
    vertices[0] = new Static3D(+0.5f,+0.0f,+0.0f);
1679
    vertices[1] = new Static3D(-0.5f,+0.0f,+0.0f);
1680
    roundCorners(mesh,center,vertices,0.06f,0.10f);
1681
*/
1675

  
1676
    float A = (2*SQ3/3)*MINX_C1;
1677
    float B = 0.4f;
1678
    float X = MINX_C5*MINX_C1*MINX_C3;
1679
    float Y = MINX_C1*MINX_C1 - 0.5f;
1680
    float Z = MINX_C4*MINX_C1*MINX_C3;
1681

  
1682
    Static3D center = new Static3D(0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B);
1683

  
1684
    Static3D[] vertices = new Static3D[4];
1685
    vertices[0] = new Static3D( 0.0f, 0.0f, 0.0f);
1686
    vertices[1] = new Static3D( 0.0f,-0.5f, 0.0f);
1687
    vertices[2] = new Static3D(-X   , Y   ,-Z   );
1688
    vertices[3] = new Static3D(+X   , Y   ,-Z   );
1689

  
1690
    roundCorners(mesh,center,vertices,0.03f,0.10f);
1691

  
1682 1692
    //mesh.mergeEffComponents();
1683 1693

  
1684 1694
    return mesh;

Also available in: Unified diff