I have a TriMesh, a triangle (v1,v2,v3) in the mesh and a point (x).
If its possible to get the uv coordinate from that point?.
Searched in the forum and documentation, but doesnt find something.
This kind of stuff would not be in the documentation…
You need to multiply point x by the inverse tangent space matrix for the triangle, for translation/scaling you need to use something else.
Hm, never heard of the inverse tangent space matrix.
I thought that i can get the uv coordinate from the v1-v3 and then interpolate it
with barycentric coordinates.
But in both cases I need the uv coordinate from the vectors, or im wrong? So thats
my main problem, dont know how to get it.
You should already have the vertex indices of your three vertices, let's call them vi0, vi1, and vi2 such that the indices of the three x,y,z coordinates in the mesh's vertex FloatBuffer are vi0 * 3, vi03 + 1, vi03 + 2.
The two UV coordinates in the texture FloatBuffer just happen to be vi0 * 2, vi0 * 2 + 1.