Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Fr Jul 18, 2025 00:13

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 18 Beiträge ]  Gehe zu Seite Vorherige  1, 2
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mo Nov 29, 2004 00:44 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
My demo has some keys to visualize the tangents. Just compare my tangents to your tangents and maybe you see what's wrong.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Nov 29, 2004 10:07 
Offline
DGL Member
Benutzeravatar

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.

Then you walk through the code presented at http://www.terathon.com/code/tangent.html and you get the resulting 4D-Vector T.

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Nov 29, 2004 16:40 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
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.

EDIT:
Images attached. Looks wrong...

Red = sTangent
Green = tTangent


Dateianhänge:
Model-NoTan.jpg [110.7 KiB]
28-mal heruntergeladen
Model-Tan.jpg [149.12 KiB]
28-mal heruntergeladen

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu
Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 18 Beiträge ]  Gehe zu Seite Vorherige  1, 2
Foren-Übersicht » English » English Programming Forum


Wer ist online?

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.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.017s | 15 Queries | GZIP : On ]