Archived

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

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.


Thanks,

Phillip

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites