Проблема в том что текстура не так ложиться а именно то что я вырезал ложиться непонятно как. в чем причина? код обрабатывающий вершины текстуры и индексы.
private void load(List<Integer> indicesList, int[] indices, int[] indicesUV, List<Float> verticesList, double[] vertices,
List<Float> normalsList, double[] normals, List<Float> uvList, double[] uvVertices)
{
for (int i = 0; i < indices.length; i++)
{
int index;
if (indices[i] < 0)
index = Math.abs(indices[i]) - 1;
else
index = indices[i];
Vector3f vertex = new Vector3f();
vertex.x = (float) vertices[index * 3];
vertex.y = (float) vertices[index * 3 + 1];
vertex.z = (float) vertices[index * 3 + 2];
Vector3f normal = new Vector3f();
normal.x = (float) normals[i * 3];
normal.y = (float) normals[i * 3 + 1];
normal.z = (float) normals[i * 3 + 2];
Vector2f texture = new Vector2f();
texture.x = (float) uvVertices[indicesUV[i] * 2];
texture.y = (float) uvVertices[indicesUV[i] * 2 + 1];
indicesList.add(i);
verticesList.add(vertex.x);
verticesList.add(vertex.y);
verticesList.add(vertex.z);
normalsList.add(normal.x);
normalsList.add(normal.y);
normalsList.add(normal.z);
uvList.add(texture.x);
uvList.add(texture.y);
}
}
Современные инструменты для криптотрейдинга: как технологии помогают принимать решения
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости