Skip to main content

Crate dioxus_three

Crate dioxus_three 

Source
Expand description

Dioxus Three - A Three.js component for Dioxus

Provides a simple component for embedding interactive 3D scenes using Three.js within Dioxus applications.

§Platform Support

  • Desktop (Windows, macOS, Linux): Uses WebView with iframe
  • Web (WASM): Renders directly to canvas element
  • Mobile (iOS, Android): Uses WebView (similar to desktop)

Supports multiple 3D formats: OBJ, FBX, GLTF, GLB, STL, PLY, and more. Also supports custom GLSL shaders for advanced visual effects.

Re-exports§

pub use gizmos::Gizmo;
pub use gizmos::GizmoEvent;
pub use gizmos::GizmoMode;
pub use gizmos::GizmoSpace;
pub use gizmos::GizmoTransform;
pub use input::Camera;
pub use input::CursorStyle;
pub use input::EntityId;
pub use input::GestureEvent;
pub use input::HitInfo;
pub use input::MouseButton;
pub use input::PointerDragEvent;
pub use input::PointerEvent;
pub use input::RaycastConfig;
pub use input::Raycaster;
pub use input::Vector2;
pub use input::Vector3;
pub use selection::Selection;
pub use selection::SelectionMode;
pub use selection::SelectionStyle;

Modules§

gizmos
Gizmos and transform manipulators for Dioxus Three
input
Input handling and raycasting support for Dioxus Three
selection
Selection management for Dioxus Three

Structs§

ModelConfig
Configuration for a single model in a multi-model scene
ShaderConfig
Custom shader configuration
ThreeViewProps
Properties for the ThreeView component

Enums§

ModelFormat
3D model format types
ShaderPreset
Built-in shader presets

Functions§

ThreeView
A Three.js 3D viewer component for Dioxus Desktop
build_loader_scripts_for_models
Build loader scripts for multiple models
build_loader_scripts_single
Build loader scripts for single model
build_multi_model_loading_interactive
Build JavaScript code for loading multiple models (interactive version with entity IDs)
build_shader_code
Build shader code for the Three.js scene
build_single_model_loading_interactive
Build JavaScript code for loading a single model (interactive version with entity ID)
generate_three_js_html
Generate the HTML with embedded Three.js Includes full raycasting, selection, and gizmo interaction support
models_to_json
Serialize model configs to JSON for postMessage updates (desktop iframe)