Skip to content

Shubham18024/Anchor_Anim

Repository files navigation

⚓ AnchorAnim v1.0.0

Rust WGPU Rapier3D egui PyO3 Maturin UV FFMPEG Python NumPy Platform

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.


🚀 The Vision

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.


📽 Gallery (Samples)

🌌 The Cosmic Orrery

Cosmic Scenario Simulating celestial bodies with thousands of vertices.

Torus

Torus Rotating torus with dancing shadows.

🕺 Humanoid Choreography

Human Render Complex human primitives with dynamic bobbing and jumping.

🏠 The Room Play

Room Choreography A cinematic sequence featuring text-based storytelling and automated movement.

🎭 The Dance

Dance Scenario A choreographed interaction between multiple physics-based entities.


📂 Project Structure

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)

🛠 Tech Stack

  • 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)

⚙️ Quick Start (Using UV)

1. Clone & Setup

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/activate

2. Build the Engine

Compiling the Rust core into your environment:

maturin develop

3. Run a Scene

Try out the new Cinematic Room Choreography:

python examples/room_hello.py

🎮 How to Use (Python API)

Creating 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")

⚖️ License & Contributing

Licensed under the MIT License. We welcome all contributions! See CONTRIBUTING.md for details.


Build the future of animation with AnchorAnim.

Contributors

Languages