Can you embed the guizmos in the frame buffer directly? (i.e. not imgui windows)?
Makogan opened this issue · comments
I am trying to add some simple editing capabilities to a research tool. I integrated ImGuizmo and got this:
As you can see the guizmo is being rendered in an imgui window on top of the model I am rendering. I want just the cube to be rendered to the same FB without the imgui window decoration stuff.
Is this possible?
This is my function:
bool show_demo_window = true;
bool show_another_window = false;
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
int selected_vertex = 0;
bool hovering_imgui = false;
void Demo_GUI(NECamera::ArcballCamera& camera)
{
// Start the Dear ImGui frame
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
ImGuizmo::BeginFrame();
ImGuizmo::SetDrawlist();
ImGuizmo::SetRect(0, 0, 800, 800);
Eigen::Matrix4f view = camera.GetViewMatrix();
Eigen::Matrix4f proj = camera.GetProjectionMatrix();
Eigen::Matrix4f model = Eigen::Matrix4f::Identity();
ImGuizmo::DrawCubes(view.data(), proj.data(), model.data(), 1);
hovering_imgui = ImGui::GetIO().WantCaptureMouse;
ImGui::Render();
}
Imguizmo init is a bit different between a window and full screen. Check this code block :
Line 279 in 8afa1d7
Oh I see. Thank you lots. A small follow up, I don't see in the example how to render the rotation and translation widgets. (Thank you for the patience). NVM I see it is done implicitly through the use of the TRANSLATE and company enumerators, thank you.