That will work only in a (common) special case: The upper left part of your modelViewMatrix needs to be orthonormal. The NormalMatrix is the transpose of the inverse of modelViewMatrix. So, if modelViewMatrix is orthonormal, you can invert it just by transposing it. The transpose of the transpose is again the matrix you started with. The upper left part of your modelViewMatrix is orthonormal, if modelViewMatrix does ONLY contain rotation and/or translation, NO scaling or shearing.
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
both m_normalmatrix and tmat give wrong results making some faces of my cube black.
while looking at your java example i discovered at typo in my determinant code. The last 8 should have been a 6. But as it turned out that was not the solution. Ok then further with the java example and compare that with the normalmapmatrix calculation itself. A quick comparision tells met that there are differences, so on with the hard job of renumbering the indices. Now i have the following source:
Code:
function determinant(amatrix: GLmatrix3): GLFloat;
begin
result := amatrix[0]*(amatrix[8]*amatrix[4]-amatrix[5]*amatrix[7])
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.