How to compute texture coordinates?


Given a triangle with its vertices and the texture coordinates at each vertex known, is there anyway of finding the texture coordinates of a point on that triangle?

pls help…

What do you mean by

texture coordinates of a point on that triangle

if there is a point which falls within this triangle, is it possible to obtain the texture coordinates of this particular point?

hmmm ok i think it should be possible,
your 3 triangle vertices are v1,v2,v3, your new point is p and your tex-coordinates are t1,t2,t3 (as glTexCoord2*) and your new tex coord is tp
now you can setup to equations in vector notation

with |v1-v2|=sqrt((x1-x2)(x1-x2)+(y1-y2)(y1-y2)+(z1-z2)(z1-z2))

with that ist should be possible to solve those equations for your new tex coord.

hope that helps

u want barycentric coordinate i think my friend