How to get the 3D position for the point with (0,0) UV coordinates? I have a 3D triangular mesh(vertices, indices, uv coords) that I'm rendering to the screen. Let's assume that the UV mapping is one-to-one. I'm trying to find a way to find the 3D position of the point with UV coordinates equal to (0,0). I searched the internet but I only find answers that I don't find convincing. 
The solution that I found: 


Find, in UV space, the triangle that contains (0,0).. let's call it T 
Calculate barycentric coordinates for (0,0) with respect to T 
interpolate the 3D positions of T's vertices using barycentric coords to get the result. 


this seems wrong to me. Here's why: 
Let M be the mapping between 3D space and UV space that associates UV coords for every vertex. 
Let A,B and C be the vertices of T. 
Let P be the origin of UV space ( P = (0,0) ). 

We have P = alpha*A + beta * B + gamma*C (alpha,beta and gamma are the barycentric coords of P with respect to T). 
We assumed the UV mapping to be one-to-one, so let M° be the inverse of M. 
We have : 

M°(P) = M°(alpha*A + beta * B + gamma*C)

The solution in question assumes that M° is linear.. if that was the case you can have: 

M°(P) = alpha*M°(A) + beta * M°(B) + gamma*M°(C)

But that is not the case (correct me if I'm wrong). 

So is there a way to find the 3D position of a point with specific UV coords? 

Thanks in advance.
I realize that the solution I'm giving further below is basically the one you mentioned in your question. So let's begin by addressing this:


  The solution in question assumes that M° is linear.. if that was the case you can have:
  
  M°(P) = alpha*M°(A) + beta * M°(B) + gamma*M°(C)
  
  But that is not the case (correct me if I'm wrong). 


The solution in question works directly in UV space. I don't see where it would make any assumptions concerning the nature or even existence of a "mapping from 3D to UV space"!? All it does assume is that UV coordinates vary linearly across each triangle (note: each triangle, not the entire mesh)&hellip;

$$
\def\mvec#1{\begin{pmatrix}#1\end{pmatrix}}
\def\ivec#1{\left(\begin{smallmatrix}#1\end{smallmatrix}\right)}
\def\mmat#1{\begin{bmatrix}#1\end{bmatrix}}
\def\vec#1{\mathrm{\mathbf{#1}}}
\def\mat#1{\mathrm{\mathbf{#1}}}
$$

In general, the $u$ and $v$ coordinates at a point on a triangle's plane given by the affine coordinates $\lambda_1$ and $\lambda_2$ are
\begin{align}
  u &amp;= u_1 + \lambda_1 (u_2 - u_1) + \lambda_2 (u_3 - u_1) \\
  v &amp;= v_1 + \lambda_1 (v_2 - v_1) + \lambda_2 (v_3 - v_1)
\end{align}
where $u_i$, $v_i$ are the $u$, $v$ coordinates at vertex $i$. We can rewrite this as
\begin{equation}
  \mmat{
    u_2 - u_1 &amp; u_3 - u_1 \\
    v_2 - v_1 &amp; v_3 - v_1
  } \cdot \mvec{
    \lambda_1 \\
    \lambda_2
  } = \mvec{
    u - u_1 \\
    v - v_1
  }.
\end{equation}
Knowing $u_i$ and $v_i$ at each vertex of a given triangle, we can compute
\begin{equation}
  \mat M = \mmat{
    u_2 - u_1 &amp; u_3 - u_1 \\
    v_2 - v_1 &amp; v_3 - v_1
  }.
\end{equation}
We can then find the affine coordinates corresponding to the point with whatever $u$, $v$ coordinates we want:
\begin{equation}
  \mvec{
    \lambda_1 \\
    \lambda_2
  } = 
  \mat M^{-1} \cdot \mvec{
    u - u_1 \\
    v - v_1
  }.
\end{equation}
Note that these affine coordinates always exist as long as $\mat M^{-1}$ exists (which makes sense; there will always be exactly one point somewhere in the plane of the triangle where $u$ and $v$ reach whatever value you may be looking for as long as $u$ and $v$ vary independently). However, they will not necessarily fall inside the triangle.

So one way to find the point you're looking for would be to iterate over all triangles of the mesh and, for each triangle, compute $\mat M^{-1}$, and $\lambda_1$ and $\lambda_2$ for $u = 0$ and $v = 0$, and check whether
\begin{align}
  \lambda_1 &amp;\geq 0 &amp; &amp;\land &amp; \lambda_2 &amp;\geq 0 &amp; &amp;\land &amp; \lambda_1 + \lambda_2 &amp;\leq 1.
\end{align}
If this is the case, you have found a triangle that contains a point at which $u = 0$ and $v = 0$. You can then compute the coordinates of that point as
\begin{equation}
  \vec p = (1 - \lambda_1 - \lambda_2) \vec v_1 + \lambda_1 \vec v_2 + \lambda_2 \vec v_3
\end{equation}
where $\vec v_1$, $\vec v_2$, and $\vec v_3$ are the coordinates of the respective triangle vertices.

It may make sense to, for example, use an initial check against a given triangle's bounding rectangle in UV space and/or other methods to quickly rule out triangles that cannot contain the coordinates of interest to speed up the search&hellip;