Calculating a 3D Point in a face when an UV coordinate is given
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.
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 ?
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 ?
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
Take a look at the lightmap code from Genesis3D (www.genesis3d.com).
Or wait until I get an example made up.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement