🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Calculating a 3D Point in a face when an UV coordinate is given

Started by
0 comments, last by Phillip Schuster 24 years, 10 months ago
Hi all !!

Ok, I have a problem. I have a face (Triangle, so with 3 vertices). Every vertex has of course UV coordinates. Now, what I basically want is :

Stepping through each pixel of the texture the face has assigned:

for (y=0;y for (x=0;x ....
}
}

and I want to calculate the 3D Point (World Space) that lies in the face and represants the UV coordinate (x,y in this example). How can I do that.


Thanks,

Phillip

Phillip Schuster
Advertisement
Hi

If I understand correctly you want to convert a UV in a texture (mapped on a poly) back to worldspace, right?

This is not really possible since the single texel is not just 1 wordspace coordinates.
Imagine a 4x4 texture mapped on a very large polygon. Now the texel at UV position 2,2 for example will be mapped on a big piece of the polygon, covering more then 1 worldspace coordinate.

Are you trying lightmaps or volumetric fog?
Then this is not the way to do it

Sorry if I understand your question wrong.

- John vd Burg
Programmer of Oxygen3D http://www.mysticgd.com/oxygen3d.htm

This topic is closed to new replies.

Advertisement