Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@thi.ng/arcball

npm version npm downloads Mastodon Follow

[!NOTE]

This is one of 216 standalone projects. LLM-free, human-made and cared for software, maintained as part of the @thi.ng/umbrella ecosystem and anti-framework.

🚀 Please help me to work full-time on these projects by sponsoring me. Thank you! ❤️

About

3D arcball controller for intuitive click & drag gesture-based camera view rotations. Quaternion-based..

Ported from: https://github.com/thi-ng/geom/blob/feature/no-org/src/thi/ng/geom/gl/arcball.cljc

Which itself is based on:

"ARCBALL: A User Interface for Specifying Three-Dimensional Orientation Using a Mouse" by Ken Shoemake https://www.talisman.org/~erlkonig/misc/shoemake92-arcball.pdf

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/arcball

ESM import:

import * as arc from "@thi.ng/arcball";

Browser ESM import:

<script type="module" src="https://esm.run/@thi.ng/arcball"></script>

JSDelivr documentation

For Node.js REPL:

const arc = await import("@thi.ng/arcball");

Package sizes (brotli'd, pre-treeshake): ESM: 812 bytes

Dependencies

Note: @thi.ng/api is in most cases a type-only import (not used at runtime)

The thi.ng/rstream-gestures dependency is only needed when using defArcballController().

Usage examples

Two projects in this repo's /examples directory are using this package:

Screenshot Description Live demo Source
3D arcball controller to rotate the camera view of a colored cube Demo Source
Basic 3D OBJ model loading & interactive arcball camera control Demo Source

API

Generated API docs

TODO

Authors

If this project contributes to an academic publication, please cite it as:

@misc{thing-arcball,
  title = "@thi.ng/arcball",
  author = "Karsten Schmidt",
  note = "https://thi.ng/arcball",
  year = 2025
}

License

© 2025 - 2026 Karsten Schmidt // Apache License 2.0