Help finding uv coordinates of a specific point.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Help finding uv coordinates of a specific point.

Post 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: )
cederron
Posts: 53
Joined: Thu Jul 13, 2006 11:35 pm

Post by cederron »

no replies to my answer... :cry:

Anyway I have it working! :lol:

I just did a simple linear interpolation.
ProSoft
Posts: 59
Joined: Thu Sep 08, 2005 10:55 am
Location: Brasil

Post 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?
Post Reply