Revision 99571baa
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java | ||
---|---|---|
1073 | 1073 |
else if( mode==14 ) |
1074 | 1074 |
{ |
1075 | 1075 |
final float F = 0.2f; |
1076 |
final float X = F/2; |
|
1077 |
final float Y = F*SQ2/2; |
|
1078 |
final float Z =-F/2; |
|
1076 | 1079 |
|
1077 | 1080 |
vertices = new double[][] |
1078 | 1081 |
{ |
1079 |
{ 0.0 , 0.0, 0.0},
|
|
1080 |
{ -F , 0.0, 0.0},
|
|
1081 |
{ -F/2 , 0.0, -F*SQ3/2},
|
|
1082 |
{ -3*F/2, 0.0, -F*SQ3/2},
|
|
1083 |
{ -F/2 , F*SQ6/3, -F*SQ3/6},
|
|
1084 |
{ -3*F/2, F*SQ6/3, -F*SQ3/6},
|
|
1085 |
{ -F , F*SQ6/3, -F*2*SQ3/3},
|
|
1086 |
{ -2*F , F*SQ6/3, -F*2*SQ3/3}
|
|
1082 |
{ 0.0, 0.0, 0.0 },
|
|
1083 |
{ X, Y, Z },
|
|
1084 |
{ 0.0, 2*Y, 2*Z },
|
|
1085 |
{ -X, Y, Z },
|
|
1086 |
{ 0.0, 0.0, -F },
|
|
1087 |
{ X, Y, Z-F },
|
|
1088 |
{ 0.0, 2*Y, 2*Z-F },
|
|
1089 |
{ -X, Y, Z-F },
|
|
1087 | 1090 |
}; |
1088 | 1091 |
|
1089 | 1092 |
vertIndexes = new int[][] |
1090 | 1093 |
{ |
1091 |
{3,2,0,1},
|
|
1094 |
{0,1,2,3},
|
|
1092 | 1095 |
{1,0,4,5}, |
1093 |
{0,2,6,4},
|
|
1094 |
{5,4,6,7},
|
|
1095 |
{3,1,5,7},
|
|
1096 |
{2,3,7,6}
|
|
1096 |
{7,4,0,3},
|
|
1097 |
{1,5,6,2},
|
|
1098 |
{7,3,2,6},
|
|
1099 |
{4,7,6,5}
|
|
1097 | 1100 |
}; |
1098 | 1101 |
|
1099 | 1102 |
bands = new float[][] |
... | ... | |
1114 | 1117 |
|
1115 | 1118 |
centers = new float[][] |
1116 | 1119 |
{ |
1117 |
{ -2*F/3 , F*SQ6/9, -F*2*SQ3/9}
|
|
1120 |
{ 0.0f, Y, Z-F/2}
|
|
1118 | 1121 |
}; |
1119 | 1122 |
|
1120 | 1123 |
centerIndexes = new int[] { 0,0,0,-1,0,-1,-1,-1 }; |
... | ... | |
1127 | 1130 |
else if( mode==15 ) |
1128 | 1131 |
{ |
1129 | 1132 |
final float F = 0.2f; |
1133 |
final float X = F/2; |
|
1134 |
final float Y = F*SQ2/2; |
|
1135 |
final float Z =-F/2; |
|
1130 | 1136 |
|
1131 | 1137 |
vertices = new double[][] |
1132 | 1138 |
{ |
1133 |
{ 0.5-3*F/2, 0.0, -F*SQ3/2 },
|
|
1134 |
{ 0.5-F , 0.0, 0.0},
|
|
1135 |
{ 0.5-3*F/2, F*SQ6/3, -F*SQ3/6 },
|
|
1136 |
{ 0.5-2*F , F*SQ6/3, -F*2*SQ3/3},
|
|
1137 |
{-0.5+3*F/2, 0.0, -F*SQ3/2 },
|
|
1138 |
{-0.5+F , 0.0, 0.0},
|
|
1139 |
{-0.5+3*F/2, F*SQ6/3, -F*SQ3/6 },
|
|
1140 |
{-0.5+2*F , F*SQ6/3, -F*2*SQ3/3}
|
|
1139 |
{ 0.0, 0.0, 0.5-F },
|
|
1140 |
{ X, Y, Z+0.5-F },
|
|
1141 |
{ 0.0, 2*Y, 2*Z+0.5-F },
|
|
1142 |
{ -X, Y, Z+0.5-F },
|
|
1143 |
{ 0.0, 0.0, -0.5+F },
|
|
1144 |
{ X, Y, -Z-0.5+F },
|
|
1145 |
{ 0.0, 2*Y,-2*Z-0.5+F },
|
|
1146 |
{ -X, Y, -Z-0.5+F },
|
|
1141 | 1147 |
}; |
1142 | 1148 |
|
1143 | 1149 |
vertIndexes = new int[][] |
1144 | 1150 |
{ |
1145 |
{5,1,2,6},
|
|
1146 |
{4,0,1,5},
|
|
1147 |
{6,2,3,7},
|
|
1148 |
{7,3,0,4},
|
|
1149 |
{3,2,1,0},
|
|
1150 |
{4,5,6,7}
|
|
1151 |
{0,4,5,1},
|
|
1152 |
{3,7,4,0},
|
|
1153 |
{0,1,2,3},
|
|
1154 |
{4,7,6,5},
|
|
1155 |
{1,5,6,2},
|
|
1156 |
{2,6,7,3}
|
|
1151 | 1157 |
}; |
1152 | 1158 |
|
1153 | 1159 |
bands = new float[][] |
... | ... | |
1163 | 1169 |
{0.07f,0.20f*F} |
1164 | 1170 |
}; |
1165 | 1171 |
|
1166 |
cornerIndexes = new int[] { 0,0,0,-1,0,0,0,-1 };
|
|
1172 |
cornerIndexes = new int[] { 0,0,-1,0,0,0,-1,0 };
|
|
1167 | 1173 |
|
1168 | 1174 |
centers = new float[][] |
1169 | 1175 |
{ |
1170 |
{ 0, F*SQ6/6, -F*SQ3/3 }
|
|
1176 |
{ 0, F*SQ2/2, 0 }
|
|
1171 | 1177 |
}; |
1172 | 1178 |
|
1173 |
centerIndexes = new int[] { 0,0,0,-1,0,0,0,-1 };
|
|
1179 |
centerIndexes = new int[] { 0,0,-1,0,0,0,-1,0 };
|
|
1174 | 1180 |
|
1175 | 1181 |
numComponents = 6; |
1176 | 1182 |
} |
... | ... | |
1179 | 1185 |
|
1180 | 1186 |
else if( mode==16 ) |
1181 | 1187 |
{ |
1182 |
final float F = 0.2f; |
|
1188 |
final float F = 0.1f; |
|
1189 |
final float L = (1-3*F); |
|
1190 |
final float X = L/2; |
|
1191 |
final float Y = L*SQ2/2; |
|
1192 |
final float Z =-L/2; |
|
1193 |
final float D = F/L; |
|
1183 | 1194 |
|
1184 | 1195 |
vertices = new double[][] |
1185 | 1196 |
{ |
1186 |
{ -0.5*(1-3*F), 0.0, (SQ3/6)*(1-3*F) },
|
|
1187 |
{ 0.5*(1-3*F), 0.0, (SQ3/6)*(1-3*F) },
|
|
1188 |
{ 0.0, 0.0,-(SQ3/3)*(1-3*F) },
|
|
1189 |
{ F/2-0.5*(1-3*F), F*SQ6/3, (SQ3/6)*(1-3*F) - F*SQ3/6 },
|
|
1190 |
{-F/2+0.5*(1-3*F), F*SQ6/3, (SQ3/6)*(1-3*F) - F*SQ3/6 },
|
|
1191 |
{ 0.0, F*SQ6/3,-(SQ3/3)*(1-3*F) + F*SQ3/3 },
|
|
1197 |
{ 0.0, -2*Y/3, -2*Z/3 },
|
|
1198 |
{ X, Y/3, Z/3 },
|
|
1199 |
{ -X, Y/3, Z/3 },
|
|
1200 |
{ 0.0, -2*Y/3, -2*Z/3+2*D*Z },
|
|
1201 |
{ X-D*X, Y/3-D*Y, Z/3+D*Z },
|
|
1202 |
{ -X+D*X, Y/3-D*Y, Z/3+D*Z },
|
|
1192 | 1203 |
}; |
1193 | 1204 |
|
1194 | 1205 |
vertIndexes = new int[][] |
1195 | 1206 |
{ |
1196 |
{2,1,0},
|
|
1197 |
{3,4,5},
|
|
1198 |
{0,1,4,3},
|
|
1199 |
{1,2,5,4},
|
|
1200 |
{2,0,3,5}
|
|
1207 |
{0,1,2},
|
|
1208 |
{3,5,4},
|
|
1209 |
{0,3,4,1},
|
|
1210 |
{5,3,0,2},
|
|
1211 |
{4,5,2,1}
|
|
1201 | 1212 |
}; |
1202 | 1213 |
|
1203 | 1214 |
bands = new float[][] |
1204 | 1215 |
{ |
1205 |
{0.025f,35,0.2f*(1-3*F),0.6f*(1-3*F),5,1,1}, |
|
1206 |
{0.001f,35,0.2f*(1-3*F),0.6f*(1-3*F),5,1,1}
|
|
1216 |
{0.025f,35,0.20f*(1-3*F),0.6f*(1-3*F),5,1,1},
|
|
1217 |
{0.001f,35,0.05f*(1-3*F),0.1f*(1-3*F),5,1,1}
|
|
1207 | 1218 |
}; |
1208 | 1219 |
|
1209 | 1220 |
bandIndexes = new int[] { 0,1,1,1,1,1 }; |
1210 | 1221 |
|
1211 | 1222 |
corners = new float[][] |
1212 | 1223 |
{ |
1213 |
{0.05f,0.20f*F}
|
|
1224 |
{0.04f,0.15f}
|
|
1214 | 1225 |
}; |
1215 | 1226 |
|
1216 | 1227 |
cornerIndexes = new int[] { 0,0,0,-1,-1,-1 }; |
1217 | 1228 |
|
1218 | 1229 |
centers = new float[][] |
1219 | 1230 |
{ |
1220 |
{0.0f, (1-3*F)*SQ6/3, 0.0f}
|
|
1231 |
{ 0, -2*Y/3, 4*Z/3 }
|
|
1221 | 1232 |
}; |
1222 | 1233 |
|
1223 | 1234 |
centerIndexes = new int[] { 0,0,0,-1,-1,-1 }; |
Also available in: Unified diff
New 'Jing' cubit shapes: corrections.