View Full Version : How to compute texture coordinates?

03-07-2001, 11:21 PM

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................

03-07-2001, 11:26 PM
What do you mean by

texture coordinates of a point on that triangle

03-07-2001, 11:36 PM
if there is a point which falls within this triangle, is it possible to obtain the texture coordinates of this particular point?

03-08-2001, 12:47 AM
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

03-08-2001, 01:01 AM
u want barycentric coordinate i think my friend