{"id":13731973,"url":"https://github.com/CedricGuillemet/ImGuizmo","last_synced_at":"2025-05-08T06:30:52.605Z","repository":{"id":39346574,"uuid":"65806293","full_name":"CedricGuillemet/ImGuizmo","owner":"CedricGuillemet","description":"Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui","archived":false,"fork":false,"pushed_at":"2024-10-31T08:52:34.000Z","size":4357,"stargazers_count":3205,"open_issues_count":111,"forks_count":902,"subscribers_count":91,"default_branch":"master","last_synced_at":"2024-11-11T14:21:21.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CedricGuillemet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-16T09:24:05.000Z","updated_at":"2024-11-11T11:25:54.000Z","dependencies_parsed_at":"2023-02-01T08:46:39.746Z","dependency_job_id":"07a16f94-140a-49c5-84ed-bd8d23ebef35","html_url":"https://github.com/CedricGuillemet/ImGuizmo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedricGuillemet%2FImGuizmo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedricGuillemet%2FImGuizmo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedricGuillemet%2FImGuizmo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedricGuillemet%2FImGuizmo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CedricGuillemet","download_url":"https://codeload.github.com/CedricGuillemet/ImGuizmo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224707570,"owners_count":17356357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:42.922Z","updated_at":"2024-11-14T23:30:40.784Z","avatar_url":"https://github.com/CedricGuillemet.png","language":"C++","funding_links":[],"categories":["UI","C++","Uncategorized","Graphics"],"sub_categories":["Uncategorized"],"readme":"# ImGuizmo\n\nLatest stable tagged version is 1.83. Current master version is 1.84 WIP.\n\nWhat started with the gizmo is now a collection of dear imgui widgets and more advanced controls.\n\n## Guizmos\n\n### ImViewGizmo\n\nManipulate view orientation with 1 single line of code\n\n![Image of ImViewGizmo](http://i.imgur.com/7UVcyDd.gif)\n\n### ImGuizmo\n\nImGizmo is a small (.h and .cpp) library built ontop of Dear ImGui that allow you to manipulate(Rotate \u0026 translate at the moment) 4x4 float matrices. No other dependancies. Coded with Immediate Mode (IM) philosophy in mind.\n\nBuilt against DearImgui 1.53WIP\n\n![Image of Rotation](http://i.imgur.com/y4mcVoT.gif)\n![Image of Translation](http://i.imgur.com/o8q8iHq.gif)\n![Image of Bounds](http://i.imgur.com/3Ez5LBr.gif)\n\nThere is now a sample for Win32/OpenGL ! With a binary in bin directory.\n![Image of Sample](https://i.imgur.com/nXlzyqD.png)\n\n### ImSequencer\n\nA WIP little sequencer used to edit frame start/end for different events in a timeline.\n![Image of Rotation](http://i.imgur.com/BeyNwCn.png)\nCheck the sample for the documentation. More to come...\n\n### Graph Editor\n\nNodes + connections. Custom draw inside nodes is possible with the delegate system in place.\n![Image of GraphEditor](Images/nodeeditor.jpg)\n\n### API doc\n\nCall BeginFrame right after ImGui_XXXX_NewFrame();\n\n```C++\nvoid BeginFrame();\n```\n\nreturn true if mouse cursor is over any gizmo control (axis, plan or screen component)\n\n```C++\nbool IsOver();**\n```\n\nreturn true if mouse IsOver or if the gizmo is in moving state\n\n```C++\nbool IsUsing();**\n```\n\nenable/disable the gizmo. Stay in the state until next call to Enable. gizmo is rendered with gray half transparent color when disabled\n\n```C++\nvoid Enable(bool enable);**\n```\n\nhelper functions for manualy editing translation/rotation/scale with an input float\ntranslation, rotation and scale float points to 3 floats each\nAngles are in degrees (more suitable for human editing)\nexample:\n\n```C++\n float matrixTranslation[3], matrixRotation[3], matrixScale[3];\n ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);\n ImGui::InputFloat3(\"Tr\", matrixTranslation, 3);\n ImGui::InputFloat3(\"Rt\", matrixRotation, 3);\n ImGui::InputFloat3(\"Sc\", matrixScale, 3);\n ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);\n```\n\nThese functions have some numerical stability issues for now. Use with caution.\n\n```C++\nvoid DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale);\nvoid RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix);**\n```\n\nRender a cube with face color corresponding to face normal. Usefull for debug/test\n\n```C++\nvoid DrawCube(const float *view, const float *projection, float *matrix);**\n```\n\nCall it when you want a gizmo\nNeeds view and projection matrices.\nMatrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional. snap points to a float[3] for translation and to a single float for scale or rotation. Snap angle is in Euler Degrees.\n\n```C++\n    enum OPERATION\n    {\n        TRANSLATE,\n        ROTATE,\n        SCALE\n    };\n\n    enum MODE\n    {\n        LOCAL,\n        WORLD\n    };\n\nvoid Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix = 0, float *snap = 0);**\n```\n\n### ImGui Example\n\nCode for :\n\n![Image of dialog](http://i.imgur.com/GL5flN1.png)\n\n```C++\nvoid EditTransform(const Camera\u0026 camera, matrix_t\u0026 matrix)\n{\n    static ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);\n    static ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);\n    if (ImGui::IsKeyPressed(90))\n        mCurrentGizmoOperation = ImGuizmo::TRANSLATE;\n    if (ImGui::IsKeyPressed(69))\n        mCurrentGizmoOperation = ImGuizmo::ROTATE;\n    if (ImGui::IsKeyPressed(82)) // r Key\n        mCurrentGizmoOperation = ImGuizmo::SCALE;\n    if (ImGui::RadioButton(\"Translate\", mCurrentGizmoOperation == ImGuizmo::TRANSLATE))\n        mCurrentGizmoOperation = ImGuizmo::TRANSLATE;\n    ImGui::SameLine();\n    if (ImGui::RadioButton(\"Rotate\", mCurrentGizmoOperation == ImGuizmo::ROTATE))\n        mCurrentGizmoOperation = ImGuizmo::ROTATE;\n    ImGui::SameLine();\n    if (ImGui::RadioButton(\"Scale\", mCurrentGizmoOperation == ImGuizmo::SCALE))\n        mCurrentGizmoOperation = ImGuizmo::SCALE;\n    float matrixTranslation[3], matrixRotation[3], matrixScale[3];\n    ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);\n    ImGui::InputFloat3(\"Tr\", matrixTranslation, 3);\n    ImGui::InputFloat3(\"Rt\", matrixRotation, 3);\n    ImGui::InputFloat3(\"Sc\", matrixScale, 3);\n    ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);\n\n    if (mCurrentGizmoOperation != ImGuizmo::SCALE)\n    {\n        if (ImGui::RadioButton(\"Local\", mCurrentGizmoMode == ImGuizmo::LOCAL))\n            mCurrentGizmoMode = ImGuizmo::LOCAL;\n        ImGui::SameLine();\n        if (ImGui::RadioButton(\"World\", mCurrentGizmoMode == ImGuizmo::WORLD))\n            mCurrentGizmoMode = ImGuizmo::WORLD;\n    }\n    static bool useSnap(false);\n    if (ImGui::IsKeyPressed(83))\n        useSnap = !useSnap;\n    ImGui::Checkbox(\"\", \u0026useSnap);\n    ImGui::SameLine();\n    vec_t snap;\n    switch (mCurrentGizmoOperation)\n    {\n    case ImGuizmo::TRANSLATE:\n        snap = config.mSnapTranslation;\n        ImGui::InputFloat3(\"Snap\", \u0026snap.x);\n        break;\n    case ImGuizmo::ROTATE:\n        snap = config.mSnapRotation;\n        ImGui::InputFloat(\"Angle Snap\", \u0026snap.x);\n        break;\n    case ImGuizmo::SCALE:\n        snap = config.mSnapScale;\n        ImGui::InputFloat(\"Scale Snap\", \u0026snap.x);\n        break;\n    }\n    ImGuiIO\u0026 io = ImGui::GetIO();\n    ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);\n    ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? \u0026snap.x : NULL);\n}\n```\n\n## Install\n\nImGuizmo can be installed via [vcpkg](https://github.com/microsoft/vcpkg) and used cmake\n\n```bash\nvcpkg install imguizmo\n```\n\nSee the [vcpkg example](/vcpkg-example) for more details\n\n## License\n\nImGuizmo is licensed under the MIT License, see [LICENSE](/LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCedricGuillemet%2FImGuizmo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCedricGuillemet%2FImGuizmo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCedricGuillemet%2FImGuizmo/lists"}