Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Phillip Schuster

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

This topic is 7008 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.



Share this post

Link to post
Share on other sites
Guest Anonymous Poster

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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!