Registriert: Di Nov 26, 2002 22:12 Beiträge: 259 Wohnort: Dresden
So I’ll try to explain it step by step:
Zitat:
The code generates a four-component tangent in which the handedness of the local coordinate system is stored as ±1 in the w-coordinate. The bitangent vector B is then given by B = (N × T)Tw
Your’re looking for the sTangent and the tTangent.
N is the normal of your vertex. It’s very easy to calculate N, because you know every vertex of your mesh.
N=(Polygon[0] - Polygon[1]) x (Polygon[1], Polygon[2]);
N=VectorNormalize(N);
Polygon is a List of Vertices, which form your current meshface.
Now you know the normals of your meshfaces. To calculate the normals per vertex you have to add all facenormals of these faces, which share the same vertices. Then you have to normalize your resulting normal again.
The first three components of T are the components of your tangent you are looking for. The last component of the 4D-Vector lets you know if you’ve to invert the bitangent.
The bitangent itself (the other tangent you're looking for) is given by the crossproduct of your normal and the tangent at the same vertex.
_________________ Nichts auf der Welt ist so gerecht verteilt wie der Verstand. Denn jederman ist überzeugt, dass er genug davon habe.
Rene Descartes, frz. Mathematiker u. Philosoph, 1596-1650
But with no knowlage on vertex or fragment programs, i can't make or modify the bumpmap v2 demo ones to handle a 4d tangnet insted of 2 3d ones.
If you make it so the model is in the center (0,0,0) would't you just need to normalize the vertex positions? Since they would then form a sphere around 0,0,0.
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.