View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006279 | The Dark Mod | Coding | public | 29.03.2023 20:37 | 29.03.2023 21:19 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | normal | Severity | text | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | TDM 2.11 | ||||
Target Version | TDM 2.12 | Fixed in Version | TDM 2.12 | ||
Summary | 0006279: Clarify matrix conventions in the code | ||||
Description | Recently I got confused by how various matrices are used. The goal is to understand it, and fix any wrong usage. | ||||
Additional Information | See also forum thread: https://forums.thedarkmod.com/index.php?/topic/21803-matrix-conventions/ | ||||
Tags | No tags attached. | ||||
I have written detailed investigation on forums: https://forums.thedarkmod.com/index.php?/topic/21803-matrix-conventions/ I copy the verdicts below. idRenderMatrix from Doom 3 BFG: row-major layout, indexed as A[row][column] transformed vector is column-vector on the right A then B composition is (B * A) idMat4, idMat2: row-major layout, indexed as A[row][column] transformed vector is column-vector on the right vector-matrix and matrix-vector multiplications yield same result A then B composition is (B * A) idMat3: column-major layout, indexed as A[column][row] vector-matrix and matrix-vector multiplications yield same result A then B composition is invoked like A * B in the C++ code In a sense, idMat3 just stores transposed matrix compared to idMat4... GLSL/OpenGL matrices: column-major layout, indexed as A[column][row] transformed vector is column-vector on the right vec * mat is same as transpose(mat) * vec A then B composition is (B * A) float[16] in Doom 3 renderer backend: column-major layout transformed vector is column-vector on the right A then B composition is myGlMultMatrix(A, B) |
|
Added a bit more docs to the code: r10334 Added some comments regarding matrix conventions. And fixed the mess with idMat4 in backend: r10337 Fixed confusion of passing idMat4 to GLSL without transpose. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
29.03.2023 20:37 | stgatilov | New Issue | |
29.03.2023 20:41 | stgatilov | Additional Information Updated | |
29.03.2023 20:48 | stgatilov | Note Added: 0015981 | |
29.03.2023 21:19 | stgatilov | Note Added: 0015982 | |
29.03.2023 21:19 | stgatilov | Assigned To | => stgatilov |
29.03.2023 21:19 | stgatilov | Status | new => resolved |
29.03.2023 21:19 | stgatilov | Resolution | open => fixed |
29.03.2023 21:19 | stgatilov | Fixed in Version | => TDM 2.12 |