#### Archived

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

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

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

## Recommended Posts

Are you trying to do lightmaps? If so you should associate each face with the closest matching axis aligned plane, and then these calculations are trivial because you're dealing with 2D instead of 3D.

##### Share on other sites
Yes, exactely, I am trying to do lightmaps. And if I get Lightmaps up and running I want to do volumetric fog. My volumetric fog routine works very good and fast using vertices (See above Question : Alpha Gouraud Faces), but with textures it would render much smoother, because vertex count must be quite high in order to get nice Fog.
Well, I really put all my math knowledge out of my brain, then I took a piece of paper, but hours later I hadn't a solution ??
Well, How do I generate an axis aligned plane, and how do I calculate the 3D Point, I really can't even imagine how to do that.
I searched the internet hours and hours, but nowhere is just a bit of help on this ?

##### Share on other sites
Take a look at the lightmap code from Genesis3D (www.genesis3d.com).

Or wait until I get an example made up.

##### Share on other sites
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

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633654
• Total Posts
3013170
×