A collection of mathematical choreography and physics-based animations powered by a high-performance Rust core. AnchorAnim blends the raw power of Rust (WGPU) with the creative flexibility of Python. Designed for mathematicians, physicists, and developers, it allows you to choreograph complex 3D simulations with real-time feedback and visually lossless asynchronous recording.
AnchorAnim was born from a simple idea: Why should 3D engines be hard to use? We've built a bridge that lets you write your scene logic in easy-to-understand Python, while our specialized Rust core handles the heavy lifting—physics, GPU rendering, and zero-lag asynchronous video encoding.
Simulating celestial bodies with thousands of vertices.
Rotating torus with dancing shadows.
Complex human primitives with dynamic bobbing and jumping.
A cinematic sequence featuring text-based storytelling and automated movement.
A choreographed interaction between multiple physics-based entities.
AnchorAnim/
├── src/
│ └── lib.rs # The High-Performance Rust Core
├── examples/
│ ├── room_hello.py # NEW: Cinematic Room Choreography
│ ├── complex_scenario.py # Cosmic Orrery Stress Test
│ ├── human.py # Humanoid Primitive Rendering
│ ├── test.py # Geometry Test
│ └── assets/ # Exported GIFs & Snapshots
├── Cargo.toml # Rust Dependencies
└── pyproject.toml # Python Build System (Maturin + UV)
- Core Engine: Rust (for memory safety and raw speed)
- Graphics API: WGPU (Native performance on Vulkan/Metal/DX12)
- Physics: Rapier3D (Industrial-grade physics)
- UI: egui (Real-time dashboarding)
- Bridge: PyO3 + Maturin (Seamless Python-to-Rust communication)
- Package Manager: UV (Extremely fast Python environment management)
- Encoding: FFMPEG (Async pipelined 1080p recording)
AnchorAnim uses UV for ultra-fast dependency management. No requirements.txt needed!
git clone https://github.com/Shubham18024/Anchor_Anim.git
cd Anchor_Anim
uv venv
source .venv/bin/activateCompiling the Rust core into your environment:
maturin developTry out the new Cinematic Room Choreography:
python examples/room_hello.pyCreating a scene is as simple as defining an update function:
import anchor_anim
class MyScene:
def __init__(self):
self.time = 0.0
def update(self, params):
self.time += 0.02
# Return positions, colors, forces, and text labels
return positions, colors, force1, force2, labels, is_recording
# Start the engine!
anchor_anim.start_physics_engine(my_scene.update, initial_ui, "my_video")Licensed under the MIT License. We welcome all contributions! See CONTRIBUTING.md for details.
Build the future of animation with AnchorAnim. ⚓