+
Skip to content

An immediate-mode 3D view gizmo for Dear ImGui, inspired by the navigation widgets found in Blender and Godot.

License

Notifications You must be signed in to change notification settings

Ka1serM/ImViewGuizmo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

ImViewGuizmo

An immediate-mode 3D view gizmo for Dear ImGui, inspired by the navigation widgets found in Blender and Godot.
It provides an interactive axis widget you can click, drag, and snap to, making it easy to control camera orientation in 3D viewports.

✨ Features

  • Immediate-mode API, following the same principles as Dear ImGui.
  • Axis-aligned snapping with smooth animation.
  • Camera orbit controls by dragging the gizmo.
  • Fully customizable styles (colors, sizes, labels, highlight effects).
  • Single-header implementation.

🚀 Usage

These examples assume you have your camera's position (glm::vec3) and rotation (glm::quat) available. You start the interaction with

ImViewGuizmo::BeginFrame();

Rotate

Renders the main orbit gizmo. Drag it to rotate the camera or click an axis to snap to a view.

if (ImViewGuizmo::Rotate(camera_position, camera_rotation, gizmoPos))
    // Apply the updated state to your camera

Zoom

Renders a zoom button. Click and drag it vertically to move the camera forward and backward.

if (ImViewGuizmo::Zoom(camera_position, camera_rotation, zoomButtonPos))
    // Apply the updated state to your camera

Pan

Renders a pan button. Click and drag it to move (pan) the camera parallel to the view plane.

if (ImViewGuizmo::Pan(camera_position, camera_rotation, panButtonPos))
    // Apply the updated state to your camera

🔧 Requirements

This library requires the GLM (OpenGL Mathematics) library for its vector and matrix operations.

📦 Installation

ImViewGuizmo is a single-header library. Simply add the header to your project:

// In exactly one source file:
#define IMVIEWGUIZMO_IMPLEMENTATION
#include "ImViewGuizmo.h"

// In all other places:
#include "ImViewGuizmo.h"

📜 License

ImViewGuizmo is licensed under the MIT License, see LICENSE for more information.

About

An immediate-mode 3D view gizmo for Dear ImGui, inspired by the navigation widgets found in Blender and Godot.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载