Git Product home page Git Product logo

Comments (8)

doyubkim avatar doyubkim commented on May 25, 2024 1

@utilForever: to be fair, I do understand the confusion since I'm actually mixing row major matrix with column vector in Jet framework. Typically you would interpret a vector as a flat matrix when matrix system is row major. (See this post: https://fgiesen.wordpress.com/2012/02/12/row-major-vs-column-major-row-vectors-vs-column-vectors/)

Anyhow, that's how Jet framework defines matrix and vector at the moment. I was thinking of moving to column major once, but decided that it's not worth the effort.

from fluid-engine-dev.

doyubkim avatar doyubkim commented on May 25, 2024

Wait, are you sure? Matrix's ij convension is different than array -- ij and xy is in different order.

from fluid-engine-dev.

doyubkim avatar doyubkim commented on May 25, 2024

4 * i + j is correct. It points to ith row and jth column. So in a flat memory, column index moves faster.

from fluid-engine-dev.

utilForever avatar utilForever commented on May 25, 2024

Agree. I think that 4 * i + j is correct, too. I'm confusing this logic:

template <typename T>
Matrix<T, 4, 4> Matrix<T, 4, 4>::makeTranslationMatrix(const Vector<T, 3>& t) {
    return Matrix(
        1, 0, 0, t.x,
        0, 1, 0, t.y,
        0, 0, 1, t.z,
        0, 0, 0, 1);
}

from fluid-engine-dev.

doyubkim avatar doyubkim commented on May 25, 2024

Hmm that's what a translation matrix should be when you perform matrix-vector multiplication in MV order. Some libraries use VM order, and then the matrix should be transposed.

from fluid-engine-dev.

utilForever avatar utilForever commented on May 25, 2024

I totally understand. It's been a long time since I learned, so I think I was confused with the concept. It was my mistake. Thank you for your explanation and I'll close this issue.

from fluid-engine-dev.

doyubkim avatar doyubkim commented on May 25, 2024

No worries. Thanks for opening up the issue regardless.

from fluid-engine-dev.

yangfengzzz avatar yangfengzzz commented on May 25, 2024

Ok, I got it. With row major matrix and column vector, the code is correct. But I think it is better to use row major matrix and row vector.

from fluid-engine-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.