Skip to content

Commit

Permalink
Fix bug with texture coordinate import from PLY / Metashape projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelt919 committed Jun 24, 2024
1 parent b53146b commit ae8d48c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/kintsugi3d/gl/geometry/VertexGeometry.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
import java.util.Map.Entry;

import javafx.util.Pair;
import org.jengineering.sjmply.PLY;
import org.jengineering.sjmply.PLYElementList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import kintsugi3d.gl.core.Context;
import kintsugi3d.gl.material.Material;
import kintsugi3d.gl.nativebuffer.NativeDataType;
Expand All @@ -33,6 +29,10 @@
import kintsugi3d.gl.vecmath.Vector2;
import kintsugi3d.gl.vecmath.Vector3;
import kintsugi3d.gl.vecmath.Vector4;
import org.jengineering.sjmply.PLY;
import org.jengineering.sjmply.PLYElementList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.jengineering.sjmply.PLYType.*;

Expand Down Expand Up @@ -443,9 +443,12 @@ private static VertexGeometry createFromPLY(File file, PLY ply) throws IOExcepti
if (facialTexCoords)
{
texCoordList.add(new Vector2(faceCoords[i][v*2], faceCoords[i][(v*2)+1]));
texCoordIndexList.add(i * 3 + v); // facial texCoords are already in order
}
else
{
texCoordIndexList.add(vertexIndex);
}

texCoordIndexList.add(vertexIndex);
}
}
}
Expand Down

0 comments on commit ae8d48c

Please sign in to comment.