-
Notifications
You must be signed in to change notification settings - Fork 913
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
Gizmo is misaligned with the model #354
Comments
grid rendering is part of the example and should not be used as a grid rendering in engine/app. |
for imguizmo, check the setrect call. the 3d mesh looks flatten. maybe the ratio is bad? do screenshot and count pixels, compare with calls to matrices creation. |
The 3D mesh looks stretched because I update camera aspect ratio here: if (currentPanelSize.x != prevSize.x || currentPanelSize.y != prevSize.y)
{
prevSize = currentPanelSize;
viewCamera.Reset(currentPanelSize.x, currentPanelSize.y);
frameBuffer->Update(currentPanelSize.x, currentPanelSize.y);
} I compared MVP matrices and they are identical in renderer and ImGuizmo calls. SetRect has the same dimensions as my framebuffer and ImGui::Image. |
Screen.Recording.2024-12-17.at.6.20.36.PM.mov |
I think it's the difference between corner of window vs corner of app. |
While integrating ImGuizmo into my engine, I've encountered an issue - my gizmo is not aligned on the model that i am rendering, even though I pass exactly the same MVP matrices in both ImGuizmo::Manipulate as I do in my renderer and shader. I render my scene as a framebuffer and then draw it as ImGui::Image and render gizmo in the same window.
As you can see, the gizmo is supposed to be aligned on the object, however it is shifted to the left. Furthermore, for some reason my ImGui::DrawGrid leaves gaps on the edge of my frustum, and the grid does not render properly.
The code below demonstrates how I render my ImGuizmo:
Maybe my issue is somehow related to my renderer so I will include it as well:
My full git repository is https://github.com/NazarAX/OpenRenderer/. Please let me know if you have any suggestions on what I'm doing wrong and how to fix my issue. Thank you for your time!
The text was updated successfully, but these errors were encountered: