Skip to content

Three Viewport Gizmo is a highly customizable standalone interactive three.js view helper controls, allowing effortless integration with popular camera libraries.

License

Notifications You must be signed in to change notification settings

Fennec-hub/three-viewport-gizmo

Repository files navigation

Three Viewport Gizmo

Three Viewport Gizmo is a highly customizable standalone interactive version of the official three.js viewport helper, it can be used alone or in conjuncture with OrbitControls or custom camera controllers like @yomotsu/camera-controls.

📚 Documentation - 🚀 Quickstart - 🛠️ API - ⚡️ Examples


Quick Start

Try it Online

You can try ViewportGizmo directly in your browser on jsFiddle.

Installation

npm install three-viewport-gizmo

Usage

import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
import { ViewportGizmo } from "three-viewport-gizmo";

//... Initialize your Scene

const controls = new OrbitControls(camera, renderer.domElement);
const gizmo = new ViewportGizmo(camera, renderer);

gizmo.attachControls(controls);

// Render
function animation(time) {
  //... Scene's animations and render

  gizmo.render();
}

// Resize
window.onresize = () => {
  //... Scene's resize logic

  gizmo.update();
};

Acknowledgments

License

This project is licensed under the MIT License

Contribution and Support

If you have any questions or need support, feel free to open an issue.

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

About

Three Viewport Gizmo is a highly customizable standalone interactive three.js view helper controls, allowing effortless integration with popular camera libraries.

Resources

License

Stars

Watchers

Forks

Packages

No packages published