Page 1 of 1

Help finding uv coordinates of a specific point.

Posted: Thu Jul 20, 2006 12:26 am
by cederron
Hello all,

I want to find uv coordinates of a specific point in a mesh, I don't want uv coordinates of a vertex, i can do that already, so if I have a triangle and i click in the middle i want uv coordinates of that point.

What I do at the moment is :

-Get the point where the user clicked and the triangle selected using ISceneCollisionManager::getCollisionPoint()

-Then I traverse the mesh vertices comparing the vertices returned by getCollisionPoint, when a vertex matches i get the uv coordinates.

This is what I have at the moment, the collision point, and the three vertices of the triangle collided including uv coordinates.

Now I don't how to continue with the problem :?: Also the mesh has transformations applied so i think it's more difficult. I need to find the uv coordinate of that exact point but i really don't know much about 3dgfx, so i dont know if i have to work with the matrices or apply some formula.

Sorry for the crappy english, I hope it's 'understandable' (is that a word? :roll: )

Posted: Sat Jul 22, 2006 1:47 am
by cederron
no replies to my answer... :cry:

Anyway I have it working! :lol:

I just did a simple linear interpolation.

Posted: Wed Jul 26, 2006 2:36 pm
by ProSoft
I have tryed this some time ago, and finished at same problem... I must use this do draw over terrain texture (3ds map). Too bad, im unable to solve this. can you explain better how do you solved it?