View Full Version : Tangent Mapper: gets tangent vector on poly
zhang 09202005, 06:38 AM http://zjprogramming.com/img/tmap_graph.jpg
Description:
TangentMapper is a node returns tangent and normal vector on the input mesh. It is useful to generate tangent space for normal mapping. Current version is developed for MTOR user to output pervertex primitive variables on Tangent and Normal.
File:
http://zjprogramming.com/bin/tangentMapper_210905.zip
Usage:
1.Load the plugin.
2.Source the mel.
3.Execute command:
mtorMapPolyTangent meshShapeName


sporadic
09202005, 01:57 PM
There's more than one tangent to a surface at a specific point (any vector 90 degrees from the normal is tangent). Which does it pick? Is the tangent it picks consistent during deformation?
I currently use two point on mesh objects to calculate approximate, but consistent during deformation, tangents. An exact method would be nice, though, so if you can give a bit more information, I'd appreciate it.
zhang
09202005, 02:20 PM
The plugin defines tangent vector by the direction where points on mesh grows along Udirection. UV coordinate will not change during deformation.
You can find the algorithm here:
http://www.terathon.com/code/tangent.html
The limitation is the mesh must have UV texture coordinate, and no overlapping UV or zeroarea traingles are allowed.
When the tangent vector is found, you can easiily crossproduct with normal to find the binormal, and construct the tangent space by:
 tangent.x binormal.x normal.x 0 
 tangent.y binormal.y normal.y 0 
 tangent.z binormal.z normal.z 0 
 0 0 0 1 
That will be helpful to use normal map on a skinned model.
sporadic
09202005, 11:55 PM
Oh, good. That's really nice. The setup I'm, currently using only uses built in Maya nodes (one of them only in Unlimited) and also bases the tangent on the UV space, so that's not a problem. I've got it scripted, but even so is a bit of a pain to set up. Having the tangent and normal come out of the same node would be much cleaner.
I'll have to try it out.
JulianJohnson
09222005, 10:23 AM
Keep up the Great work Dr zhang :thumbsup:
Iconoklast
03082006, 09:13 AM
On the topic of Tangents and so on, (as I'm not very good with this kind of thing), is a face tangent (or vertex tangent) not available through MEL and math, without the use of nodes?
Robert Bateman
03082006, 11:48 AM
On the topic of Tangents and so on, (as I'm not very good with this kind of thing), is a face tangent (or vertex tangent) not available through MEL and math, without the use of nodes?
you can calculate them in mel, though it may be unpleasant. In the API though, MFnMesh can provide you with the tangents and binormals.
CGTalk Moderation
03082006, 11:48 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.
vBulletin v3.0.5, Copyright ©20002014, Jelsoft Enterprises Ltd.