Revision 96a6db6c
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
253 | 253 |
|
254 | 254 |
private void createMesh() |
255 | 255 |
{ |
256 |
int mode = 8;
|
|
256 |
int mode = 10;
|
|
257 | 257 |
int numComponents = 0; |
258 | 258 |
double[][] vertices = null; |
259 | 259 |
int[][] vertIndexes = null; |
... | ... | |
803 | 803 |
numComponents = 8; |
804 | 804 |
} |
805 | 805 |
|
806 |
///// SQUARE-1 MIDDLE /////////////////////////////////////////////////////////////// |
|
807 |
|
|
808 |
else if( mode==9 ) |
|
809 |
{ |
|
810 |
final float X = 3*(2-SQ3)/2; |
|
811 |
|
|
812 |
vertices = new double[][] |
|
813 |
{ |
|
814 |
{ -1.5-X, 0.5, 1.5 }, |
|
815 |
{ 0.0, 0.5, 1.5 }, |
|
816 |
{ 0.0, 0.5,-1.5 }, |
|
817 |
{ -1.5+X, 0.5,-1.5 }, |
|
818 |
{ -1.5-X,-0.5, 1.5 }, |
|
819 |
{ 0.0,-0.5, 1.5 }, |
|
820 |
{ 0.0,-0.5,-1.5 }, |
|
821 |
{ -1.5+X,-0.5,-1.5 } |
|
822 |
}; |
|
823 |
|
|
824 |
vertIndexes = new int[][] |
|
825 |
{ |
|
826 |
{0,1,2,3}, // counterclockwise! |
|
827 |
{4,5,6,7}, |
|
828 |
{4,5,1,0}, |
|
829 |
{5,6,2,1}, |
|
830 |
{6,7,3,2}, |
|
831 |
{7,4,0,3} |
|
832 |
}; |
|
833 |
|
|
834 |
bands = new float[][] |
|
835 |
{ |
|
836 |
{0.040f,35,0.8f,1.0f,5,2,1}, |
|
837 |
{0.020f,35,0.8f,1.0f,5,2,1}, |
|
838 |
{0.001f,35,0.8f,1.0f,5,2,1} |
|
839 |
}; |
|
840 |
|
|
841 |
bandIndexes = new int[] { 2,2,1,1,0,2 }; |
|
842 |
|
|
843 |
corners = new float[][] |
|
844 |
{ |
|
845 |
{0.04f,0.05f} |
|
846 |
}; |
|
847 |
|
|
848 |
cornerIndexes = new int[] { 0,0,0,0,0,0,0,0 }; |
|
849 |
|
|
850 |
centers = new float[][] |
|
851 |
{ |
|
852 |
{ -0.75f, 0.0f, 0.0f} |
|
853 |
}; |
|
854 |
|
|
855 |
centerIndexes = new int[] { 0,0,0,0,0,0,0,0 }; |
|
856 |
|
|
857 |
numComponents = 6; |
|
858 |
} |
|
859 |
|
|
860 |
///// SQUARE-1 EDGE /////////////////////////////////////////////////////////////// |
|
861 |
|
|
862 |
else if( mode==10 ) |
|
863 |
{ |
|
864 |
final float X = 3*(2-SQ3)/2; |
|
865 |
|
|
866 |
vertices = new double[][] |
|
867 |
{ |
|
868 |
{ -X, 0.5, 0.0 }, |
|
869 |
{ +X, 0.5, 0.0 }, |
|
870 |
{0.0, 0.5,-1.5 }, |
|
871 |
{ -X,-0.5, 0.0 }, |
|
872 |
{ +X,-0.5, 0.0 }, |
|
873 |
{0.0,-0.5,-1.5 }, |
|
874 |
}; |
|
875 |
|
|
876 |
vertIndexes = new int[][] |
|
877 |
{ |
|
878 |
{0,1,2}, // counterclockwise! |
|
879 |
{3,4,5}, |
|
880 |
{3,4,1,0}, |
|
881 |
{4,5,2,1}, |
|
882 |
{5,3,0,2} |
|
883 |
}; |
|
884 |
|
|
885 |
bands = new float[][] |
|
886 |
{ |
|
887 |
{0.038f,35,0.5f,0.9f, 5,2,1}, |
|
888 |
{0.001f,35,0.5f,0.9f, 5,2,1} |
|
889 |
}; |
|
890 |
|
|
891 |
bandIndexes = new int[] { 0,1,0,1,1 }; |
|
892 |
|
|
893 |
corners = new float[][] |
|
894 |
{ |
|
895 |
{0.06f,0.20f} |
|
896 |
}; |
|
897 |
|
|
898 |
cornerIndexes = new int[] { 0,0,-1,0,0,-1 }; |
|
899 |
|
|
900 |
centers = new float[][] |
|
901 |
{ |
|
902 |
{ 0.0f, 0.0f,-0.5f} |
|
903 |
}; |
|
904 |
|
|
905 |
centerIndexes = new int[] { 0,0,-1,0,0,-1 }; |
|
906 |
|
|
907 |
numComponents = 6; |
|
908 |
} |
|
909 |
|
|
910 |
///// SQUARE-1 CORNER /////////////////////////////////////////////////////////////// |
|
911 |
|
|
912 |
else if( mode==11 ) |
|
913 |
{ |
|
914 |
final float X = 3*(2-SQ3)/2; |
|
915 |
|
|
916 |
vertices = new double[][] |
|
917 |
{ |
|
918 |
{ X-1.5, 0.5, 0.0 }, |
|
919 |
{ 0.0, 0.5, 0.0 }, |
|
920 |
{ 0.0, 0.5,X-1.5 }, |
|
921 |
{ -1.5, 0.5, -1.5 }, |
|
922 |
{ X-1.5,-0.5, 0.0 }, |
|
923 |
{ 0.0,-0.5, 0.0 }, |
|
924 |
{ 0.0,-0.5,X-1.5 }, |
|
925 |
{ -1.5,-0.5, -1.5 } |
|
926 |
}; |
|
927 |
|
|
928 |
vertIndexes = new int[][] |
|
929 |
{ |
|
930 |
{0,1,2,3}, // counterclockwise! |
|
931 |
{4,5,6,7}, |
|
932 |
{4,5,1,0}, |
|
933 |
{5,6,2,1}, |
|
934 |
{7,4,0,3}, |
|
935 |
{6,7,3,2} |
|
936 |
}; |
|
937 |
|
|
938 |
bands = new float[][] |
|
939 |
{ |
|
940 |
{0.038f,35,0.9f,1.0f, 5,2,1}, |
|
941 |
{0.001f,35,0.9f,1.0f, 5,2,1} |
|
942 |
}; |
|
943 |
|
|
944 |
bandIndexes = new int[] { 0,1,0,0,1,1 }; |
|
945 |
|
|
946 |
corners = new float[][] |
|
947 |
{ |
|
948 |
{0.08f,0.20f} |
|
949 |
}; |
|
950 |
|
|
951 |
cornerIndexes = new int[] { 0,0,0,-1,0,0,0,-1 }; |
|
952 |
|
|
953 |
centers = new float[][] |
|
954 |
{ |
|
955 |
{ -0.5f, 0.0f,-0.5f} |
|
956 |
}; |
|
957 |
|
|
958 |
centerIndexes = new int[] { -1,0,-1,-1,-1,0,-1,-1 }; |
|
959 |
|
|
960 |
numComponents = 6; |
|
961 |
} |
|
962 |
|
|
806 | 963 |
///// END DEFINITIONS ///////////////////////////////////////////////////////////////// |
807 | 964 |
|
808 | 965 |
FactoryCubit factory = FactoryCubit.getInstance(); |
Also available in: Unified diff
Progress with cubit shapes of the Square-1.