Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-canonical matrix-vector product #540

Open
VladislavShirinkinITEM opened this issue Nov 30, 2023 · 3 comments
Open

Non-canonical matrix-vector product #540

VladislavShirinkinITEM opened this issue Nov 30, 2023 · 3 comments
Assignees

Comments

@VladislavShirinkinITEM
Copy link

public static XbimVector3D Multiply(XbimVector3D vec, XbimMatrix3D m)

See for example https://mathinsight.org/matrix_vector_multiplication

@andyward
Copy link
Member

Can you be clear about what the issue relates to? If there's an issue it would help to see a failing test case

@VladislavShirinkinITEM
Copy link
Author

This relates to integration with other projects, which uses canonical matrix operations. OpenGL and DirectX shaders for example.
If we have many transforms we should know that multiplication order is different
The case:

  1. M1 - element transform
  2. M2 - model transform
  3. M3 - world transform

multiplication order in GLSL to get screen coords from 3d-space:

$$u_1 = M_3 \times M_2 \times M_1 \times v$$

using xBim matrices we'll write

$$u_2 = v \times M_1 \times M_2 \times M_3$$

that because of

$$(M_1 \times M_2)^T = M_2^T \times M_1^T$$

Difference between u1 and u2 is transposition, but vector is just list of numbers we can't see difference.

@andyward
Copy link
Member

andyward commented Dec 1, 2023

Any thoughts @martin1cerny ? This is above my pay grade

I'm unsure of the implications. i.e. what is broken? what is this solution? what will break if we apply a solution? What test cases do we have around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants