Archived

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

Vladimir

texture coordinates of point

Recommended Posts

Hi All, It''s about lightmap generation for indoor engine. Some triangles in my scene has opacity maps and I want to calculate correct shadows dropped by such triangles. (shadows dropped by tree leafs for example) So, after I detect that ray of light intersect triangle I need to calculate alpha value for intersection point. I know world coordinates of all points and texcoordinates of triangle vertices. How can I calculate texcoodinates of intersection point? Thanks Vladimir

Share this post


Link to post
Share on other sites

This can be done using the planar mapping technique described
at:


http://www.flipcode.com/tutorials/tut_lightmaps.shtml
http://www.voodoospotlight.com/devknowledge/articles/lightmapping/lightmaps.html


Basically what you do is determine the major axis the polygon
lies in (by figuring out the largest component of the normal)
and then project it onto one of six word-aligned cube faces.
Then, the texture coordinate you seek can be determined by
projecting the other two normal components onto the plane.
This description is probably not clear...so go read the articles
in the links and hopefully it''ll make sense

--
Dan Ginsburg
OpenGL Software Engineer, ATI Research

Share this post


Link to post
Share on other sites