Comments (31)
from imguizmo.
Hi Khanldris, you have to call the method https://github.com/CedricGuillemet/ImGuizmo/blob/master/ImGuizmo.h#L172 to specify the view/projection and object matrices
from imguizmo.
I am having this issue too. I've passed in the view and projection matrices from the camera as well as the matrix of where I would like the gizmo to be drawn but nothing seems to draw on the ImGuizmo side.
from imguizmo.
from imguizmo.
It on an engine im working on, everything seems to work on the sample app provided. Excellent work on it by the way. It's very impressive! Here is the code I am calling ImGuizmo `// Start ImGui frame
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGuizmo::BeginFrame();
ImGuizmo::Enable(true);
//ImGuizmo::SetRect(0, 0, (float)windowWidth, (float)windowHeight);
ImGuizmo::SetDrawlist();
float * camview = editorCamera.GetViewMatAsFloatArr();
float * camProj = editorCamera.GetProjMatAsFloatArr();
ImGuizmo::Manipulate(camview, camProj, ImGuizmo::SCALE, ImGuizmo::LOCAL, pSelectedEntity->GetTransform().GetWorldMatAsFloatArr());`
from imguizmo.
from imguizmo.
It also in DirectX11 so the XMMATRIX need to be converted to a XMFLOAT4x4 thn to a float* to comply with the ImGuizmo::Minipulate()
`XMFLOAT4X4 temp;
XMStoreFloat4x4(&temp, GetViewMatrix());
float result[16] =
{
temp._11, temp._21, temp._31, temp._41,
temp._12, temp._22, temp._32, temp._42,
temp._13, temp._23, temp._33, temp._43,
temp._14, temp._24, temp._34, temp._44
};
return result;`
from imguizmo.
Also tried this as well and nothing
float result[16] = { temp._11, temp._12, temp._13, temp._14, temp._21, temp._22, temp._23, temp._24, temp._31, temp._32, temp._33, temp._34, temp._41, temp._42, temp._43, temp._44 };
from imguizmo.
Row and Column major didn't work is there something else I'm forgetting? Do I need to give the device context or anything? The first batch of code I posted was everything I have related to ImGuizmo calls.
from imguizmo.
Still nothing
from imguizmo.
from imguizmo.
from imguizmo.
from imguizmo.
from imguizmo.
from imguizmo.
from imguizmo.
Something must have gotten lost in the conversions?
from imguizmo.
When I go through line by line in the array assignments the data looks good though
from imguizmo.
from imguizmo.
I've moved all conversions to just before the ImGuizmo::Manipulate method and get this as a result. It looks like part of the translate tool but it can only be seen while the ImGui windows are over it and only at particular angles. I've also tried row major and column major forms for the camera view and projection as well as the model's world matrix
from imguizmo.
from imguizmo.
Did some more digging and using the IsOver will return true when I hover over an object that is supposed to have a guizmo. But it is not drawing.
from imguizmo.
from imguizmo.
It seems to be Here is an example of how I'm getting and storing them. It's done just before the Manipulate call and not in any other methods XMFLOAT4X4 camViewTemp; XMStoreFloat4x4(&camViewTemp, editorCamera.GetViewMatrix()); float camView[16] = { camViewTemp._11,camViewTemp._21, camViewTemp._31, camViewTemp._41, camViewTemp._12,camViewTemp._22, camViewTemp._32, camViewTemp._42, camViewTemp._13,camViewTemp._23, camViewTemp._33, camViewTemp._43, camViewTemp._14,camViewTemp._24, camViewTemp._34, camViewTemp._44 };
from imguizmo.
from imguizmo.
from imguizmo.
Hi, did you ever fix this, or even find out what the issue was @GCourtney27? I'm having the same problem with a DirectX11 renderer.
from imguizmo.
@DontBelieveMe I haven't taken a look at it in a while but I think it might have been a problem with the clear screen and draw order of ImGui and the rendering algorithm I was using. It also could have been I wasn't converting the XMMatrices to float* in the right way. I'll look at it again and get back to you.
from imguizmo.
@DontBelieveMe I finally had a chance to look at it and got it to show up on the screen. Using this code
That will give something like this notice the translate guizmo at the bottom :D
You can grab the object and move it around the scene but if you let go he will snap back to where he started. I'm still working on that.
I believe the problem I was having was a mixture of trying to pass in the wrong matrices with the wrong data sizes and making copies of them. Eventually they just got corrupted. I think another important note was I was using the viewports with docking enabled when it wasn't working. With it enabled I think it was covering up what little guizmo was there to see (because it was stretched and morphed by the corrupted matrices). In the code I shared, viewports are off but docking is enabled. Also worth mentioning, I have rewritten my renderer with DirectX 12 so this is also a proof of concept that it works on that platform. Since no API calls are made I think it's safe to say this code will also run on DirectX 11 though I haven't tested that.
from imguizmo.
Issue is you're using OpenGL coord system (+X right, +Y up, -Z forward).
DirectX tends to use +Z forward.
Also if I remember the clip spaces are different so the projection transforms are different.
If you have a version that works with DirectX, that'd be appreciated & would save me a job :)
from imguizmo.
@adv-sw I have fixed it now. The problem was not using an OpenGL coordinate system it was because of how I was handling the matrices and passing them to ImGuizmo. The code posted above in the screenshot will get you up and running using the DirectX math library.
from imguizmo.
Related Issues (20)
- ImGuizmo scaling issue when position is origin HOT 16
- How can modify the code to achieve this scaling gizmo HOT 4
- Example using ViewManipulate when game's view is represented with a Vector3 and a Quaternion? HOT 1
- Platform independent build system and example? HOT 3
- How to use ImGuizmo in UE5?
- Universal Operation Scale doesn't respect ImGuizmo::IsOver()
- ImGuizmo::IsOver() returns true when should not
- [question] How the mesh editing is implemented?
- Snap for universal transform
- Gizmo Flips Depending on View Angle HOT 1
- Support for Right-Handed Systems HOT 3
- Viewport changing when window is moved HOT 1
- adding the gizmo to a window that was just renamed leads to a crash with asan activated
- no guizmo rendered HOT 1
- Exposure of gContext.mbMouseOver
- Camera parented to Guizmo HOT 1
- Manipulate not working
- Updating operation during an active manipulation has unexpected behaviour.
- Gizmo not showing in custom window ( docking branch ) HOT 5
- Assertion fails for ImVector::operator[](int) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imguizmo.