I currently have vertices with position, texture coordinate and normal data. How do I determine the tangent and binormal data for each vertex?
Some easy to read C# code would be very helpful.
Thanks!
[XNA] [HLSL] Tangents and Binormals
This link has a good explanation of how to compute the TBN matrix. It has C++ code, but it can easily be converted to C#.
http://www.terathon.com/code/tangent.html
http://www.terathon.com/code/tangent.html
Ok thanks for that link.... I got it working with some experimenting. The math is kinda hard for me.
Your vertices are real time created? or can be created with a DCC tool? Because the XNA content pipeline calculates automatically the models' tangents if the developer wants it.
If not, maybe (but I doubt it) the XNA team has the tangent method accessor set to public.
If not, maybe (but I doubt it) the XNA team has the tangent method accessor set to public.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement