2011 Software releases
Learn about the 2011 versions of some of Autodesk’s Digital Entertainment Creation tools.
  • 1/1
You are here:Forum Home / Autodesk® Softimage® / XSI SDK / Extracting Tangents
  RSS 2.0 ATOM  

Extracting Tangents
Rate this thread
 
36108
 
Subscribe to this thread
avatar
  • semler
  • Posted: 29 October 2009 07:21 AM
  • Total Posts: 2
  • Joined: 2009-02-06 14:59:47

Hi!

I’m trying to extract tangent information from a polymsh, but I seem to get the wrong values.
How I do it:

XSI::PolygonMesh mesh(X3DObject.GetActivePrimitive().GetGeometry())
XSI
::CGeometryAccessor in_ga=mesh.GetGeometryAccessor()
XSI
::ClusterProperty tangents in_ga.GetClusterProperty(XSI::siClusterPropertyVertexColorTypeL"Tangents")
XSI
::CFloatArray tangentValues;
tangents.GetValues(tangentValues)
int elementSize 
tangents.GetValueSize()
int elementCount 
tangentValues.GetCount() elementSize;
for(int i=0i<elementCounti++
{
  for(int j
=0j<elementSizej++
  {
    float value 
tangentValues[i elementSize j];
    
uprintf("Tangent %d - Element %d = %f"ijvalue)
  }
}

In XSI I create a grid polygon mesh. Apply texture projection Planar XZ. Add property Tangents (ok to default values).

Now the values I get with the above piece of code is:

Tangent 0 - Element 0 = 0.752941
Tangent 0 - Element 1 = 0.752941
Tangent 0 - Element 2 = 0.752941
Tangent 0 - Element 3 = 1.000000
Tangent 1 - Element 0 = 0.752941
Tangent 1 - Element 1 = 0.752941
Tangent 1 - Element 2 = 0.752941
Tangent 1 - Element 3 = 1.000000
Tangent 2 - Element 0 = 0.752941
Tangent 2 - Element 1 = 0.752941
Tangent 2 - Element 2 = 0.752941
Tangent 2 - Element 3 = 1.000000
Tangent 3 - Element 0 = 0.752941
Tangent 3 - Element 1 = 0.752941
Tangent 3 - Element 2 = 0.752941
Tangent 3 - Element 3 = 1.000000
..

I would expect the tangent to be 1,0,0,1 (Ie aligned with u tex coordinate)
If I select the material and choose OpenGL display - texture selection mode = No OGL texture I can see that the tangents are indeed 1,0,0,x (my mesh goes completely red), so I assume I somehow get the wrong values (looks like some default grey value - maybe default vertex color?)

Am I doing something wrong, or is this a bug?

BTW: I’m running XSI 2010 SP1 win32

Thanks,
Henning



Replies: 0




   
  Settings Choose Theme color: