Giter Club home page Giter Club logo

Comments (10)

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

Hi,

To draw the gizmo in the window, you have to call ImGuizmo::Manipulate when rendering that window with ImGuizmo::SetRect(windowposx, windowposy, windowsizex, windowsizey);

your call to ImGuizmo::Manipulate uses a matrix built on the stack. It will be deleted after }. do the conversion back from matrix to TRS using the matrix decomposition function. and put the values your transform.

from imguizmo.

ExQDev avatar ExQDev commented on August 23, 2024

Ok, with window, I'm rendering the gizmo inside the window, but it renders behind it. As I understood, it must overlap it. But.. it went to back.
Thank you for advice!

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

instead of calling beginFrame use that function: https://github.com/CedricGuillemet/ImGuizmo/blob/master/ImGuizmo.cpp#L733
it will use the drawlist for the current window instead of creating a new window

from imguizmo.

ExQDev avatar ExQDev commented on August 23, 2024

Oh, thank you very much, it helped with window, but something with model/view/projection matrices, what I should do for correct displaying of them?
I have object transform, camera transform and some other camera parameters(fov, width, height, near, far).
image
image

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

The grid display is for debug/sample purpose only. The clipping is not handled correctly. you should use you own.

from imguizmo.

ExQDev avatar ExQDev commented on August 23, 2024

No, no, I'm asking for gizmo positioning. It flew out of object. I want to snap it to object, but I don't know how to get right matrices (model, view and projection).

Look:
image
image
image
image
image

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

You can try with glGetFloatv(GL_MODELVIEW_MATRIX / GL_PROJECTION_MATRIX, m);
And then, when it works substitute with your own matrix computation

from imguizmo.

ExQDev avatar ExQDev commented on August 23, 2024

Oh, thank you very much, I've just mixed up camera view matrix and model matrix.
Everything is resolved.

from imguizmo.

CedricGuillemet avatar CedricGuillemet commented on August 23, 2024

That's good news! Closing issue.

from imguizmo.

jjiangweilan avatar jjiangweilan commented on August 23, 2024

instead of calling beginFrame use that function: https://github.com/CedricGuillemet/ImGuizmo/blob/master/ImGuizmo.cpp#L733 it will use the drawlist for the current window instead of creating a new window

the function being referenced is SetDrawlist().
And this should be documented somewhere in the main README.

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.