GithubHelp home page GithubHelp logo

Comments (4)

rokups avatar rokups commented on July 17, 2024 1

After some thought it occurred to me that there may be several different matrix conventions and actually that is the case. ImGuizmo is using row convention where opengl uses column convention. So matrix has to be converted using these:

    void ToImGuizmo(float* dest, const Matrix4& src)
    {
        for (auto row = 0; row < 4; row++)
        {
            for (auto col = 0; col < 4; col++)
                dest[row * 4 + col] = src.Data()[col * 4 + row];
        }
    }

    void FromImGuizmo(Matrix4& dest, float* src)
    {
        for (auto row = 0; row < 4; row++)
        {
            for (auto col = 0; col < 4; col++)
                (&dest.m00_)[col * 4 + row] = src[row * 4 + col];
        }
    }

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on July 17, 2024

from imguizmo.

rokups avatar rokups commented on July 17, 2024

Hey @CedricGuillemet, i am also facing same issue trying to integrate ImGuizmo into AtomicGameEngine. Engine uses following coordinate system:

Left-handed coordinates. Positive X, Y & Z axes point to the right, up, and forward, and positive rotation is clockwise.

I have a self-contained testcase, although it is pretty fat as repository pulls in entire engine. If offer still stands you may take a look: https://github.com/rokups/CSGBoolOpsTest (do not forget to clone submodules). Engine has all dependencies bundled and you should not need to do anything else than running plain cmake && make on cloned folder.

In "Debug" window try adjusting z component of translation. Gizmo can be visible right in the center although it looks weird. Holding right mouse button and moving camera tiny bit makes gizmo move to opposite direction. Besides, shouldnt gizmo be always visible as long as ImGuizmo::Manipulate() is called?

from imguizmo.

shadeMe avatar shadeMe commented on July 17, 2024

@rokups Thanks for the code. Unfortunately, switching between row-major and column-major matrices doesn't help in my setup.
@CedricGuillemet Sorry about not getting back to you until now. I'm afraid my application has multiple dependencies, some of which I'm not at the liberty to distribute.

from imguizmo.

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.