Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
🎮 mingl
Agnostic graphics library providing abstract rendering backend utilities
A versatile graphics abstraction layer designed to work across different rendering backends. Provides essential utilities for camera controls, data conversion, and graphics primitives that can be used with WebGL, Metal, Vulkan, or other graphics APIs.
✨ Features
🔄 Data Conversion
- Type-Safe Conversions - Convert between graphics data types safely
- Vector Operations - Support for f32, i8/16/32, u8/16/32 numeric types
- Array Handling - 1D and 2D array processing with optimized layouts
- Byte Slice Utilities - Efficient conversion to GPU buffer formats
📷 Camera System
- Orbital Camera Controller - Smooth camera orbiting around target points
- Interactive Controls - Mouse and keyboard input handling
- Perspective & Orthographic - Multiple projection modes
- View Matrix Management - Optimized view transformation calculations
🛠️ Rendering Utilities
- Object Model Reporting - Analyze and report on 3D model properties
- Backend Abstraction - Work across different graphics APIs
- Performance Optimized - Minimal overhead abstractions
- Memory Management - Efficient buffer and data handling
📦 Installation
Add to your Cargo.toml:
= { = true, = ["camera_orbit_controls"] }
🚀 Quick Start
Camera Controls
use ;
Data Conversion
use ;
📖 API Reference
Core Components
| Component | Purpose | Key Methods |
|---|---|---|
Camera |
3D camera management | position(), look_at(), view_matrix() |
OrbitControls |
Interactive camera controls | update(), distance(), rotation_speed() |
ToVector |
Type conversion trait | to_vector() |
ToBytes |
Buffer conversion trait | to_bytes() |
Data Conversion Support
| Type | Vector Support | Bytes Support | Use Case |
|---|---|---|---|
f32 |
✅ | ✅ | Vertex positions, colors |
i8/i16/i32 |
✅ | ✅ | Signed integer data |
u8/u16/u32 |
✅ | ✅ | Indices, unsigned data |
[T; N] |
✅ | ✅ | Fixed-size arrays |
Vec<T> |
✅ | ✅ | Dynamic arrays |
Camera Configuration
use *;
// Configure orbital camera
let = ;
let = ;
let = ;
let camera = new
.position
.target
.up
.fov
.near
.far;
// Setup orbit controls
let controls = new
.distance // Distance from target
.rotation_speed // Rotation sensitivity
.zoom_speed // Zoom sensitivity
.min_distance // Closest zoom
.max_distance // Farthest zoom
.enable_damping; // Smooth movement
🎯 Use Cases
Game Development
- 3D Scene Navigation - Interactive camera controls for exploring scenes
- Asset Loading - Convert model data for GPU upload
- Input Handling - Abstract input processing across platforms
Graphics Applications
- CAD Viewers - Precise camera controls for technical drawings
- Data Visualization - Navigate complex 3D data sets
- Scientific Visualization - Examine 3D models and simulations
Cross-Platform Development
- Backend Abstraction - Write once, run on multiple graphics APIs
- Performance Optimization - Efficient data conversion and management
- Prototype Development - Rapid graphics application prototyping
🔧 Advanced Features
Custom Camera Controllers
use *;
Efficient Data Processing
use *;
// Batch convert vertex data efficiently
⚡ Performance Considerations
Memory Efficiency
- Minimize allocations with in-place conversions where possible
- Use appropriate buffer sizes for GPU upload
- Cache frequently accessed transformation matrices
CPU Optimization
- Batch data conversions to reduce function call overhead
- Use SIMD-friendly data layouts when possible
- Profile camera update frequency for optimal performance
🔧 Integration Examples
With WebGL
use *;
use *;
use ;
📚 Technical Architecture
Backend Agnostic Design
The library uses trait-based abstractions to ensure compatibility across different graphics backends while maintaining zero-cost abstractions where possible.
Type Safety
Strong typing prevents common graphics programming errors like incorrect buffer formats or incompatible data conversions.
Performance Focus
All conversions and operations are designed to minimize CPU overhead and memory allocations in performance-critical rendering loops.