Computing Tangent Space Basis Vectors promblem

Started by
0 comments, last by JohnnyCode 9 years, 8 months ago

Hello,

I am trying to export Blender's model data for DirectX.

The tangent is need to compute.

The Algorithm is from http://www.terathon.com/code/tangent.html

But in this step: float r = 1.0F / (s1 * t2 - s2 * t1);

It appears an error: float division by zero

I found the reason is one triangle face has two same uv. ?the uv mapping in DirectX is seems OK?

Is it regular?

How can I get the tangent In this case?

Update: Perhaps uv mapping is wrong, I am not familiar with the principles of uv mapping.

Thanks.

Advertisement

if any of two (or three) verticies of a triangle has identical mapping coordinates, then it is a bogus mapping. It never happens for texture mapping attribute across any triangle, you do not need to secure this possibility at all.

This topic is closed to new replies.

Advertisement