PDA

View Full Version : Getting tangent space from mesh node


nessus
02-13-2008, 10:08 AM
I need to find a way to get tangent vector on each vertex of a ploy mesh. I looked up the nodes, and found out that under mesh node, there is an attribute called tangentSpace. However I dont know in what way to get this value returned as per vertex, or can it be done in MEL?

I am almost 100% positive maya has this vector, because if i turn on tangent display (displayTangent), it shows tangent (and also binormal) vectors on each vertex. Maybe I am not using the correct syntax?

visualfx
02-13-2008, 05:33 PM
Hi, the tangentSpace attribute is simply an enum that determines how to the tangent and binormals are calculated. It is not going to tell you what you want to know. Look up the node reference under "mesh" for a more detailed explaination.
Your best bet for accessing these values per vertex is via the api, MFnMesh has getTangents() and getBinormals() methods.
It is also useful to note that the tangents and binormals are dependant on the meshes UVs.

tbaypaul
02-14-2008, 01:59 AM
It is more for interest...but, the procedure maya uses is listed in the maya docs.....search this string.

Appendix A: Tangent and binormal vectors

CGTalk Moderation
02-14-2008, 01:59 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.