Page 1 of 1

Re: UV Sub-coordinate in polygon

Posted: Sat Jan 11, 2014 8:50 pm
by STARGÅTE
In 3D you need the position of the tiangle (especially the z-depth) and the projection mode, to get you correct u-v-position.
You have it ?

Re: UV Sub-coordinate in polygon

Posted: Sat Jan 11, 2014 10:48 pm
by STARGÅTE
your "coef"s are wrong (so I think).

try this:

Code: Select all

det.f = 1.0 / ( (*B\y-*C\y)*(*A\x-*C\x) - (*B\x-*C\x)*(*A\y-*C\y) )
coefA = ( (*B\y-*C\y)*(*P\x-*C\x) - (*B\x-*C\x)*(*P\y-*C\y) ) * det
coefB = ( (*C\y-*A\y)*(*P\x-*C\x) - (*C\x-*A\x)*(*P\y-*C\y) ) * det
coefC = 1.0 - coefA - coefB