mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
wip: integrate 3d renderer components
This commit is contained in:
parent
742f150eb3
commit
5791e49700
4 changed files with 42 additions and 0 deletions
|
@ -5,6 +5,7 @@ members = [
|
|||
"packages/core",
|
||||
"packages/web",
|
||||
"packages/liveview",
|
||||
"packages/3d",
|
||||
]
|
||||
|
||||
# Built-in
|
||||
|
|
9
packages/3d/Cargo.toml
Normal file
9
packages/3d/Cargo.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "dioxus3d"
|
||||
version = "0.0.0"
|
||||
authors = ["Jonathan Kelley <jkelleyrtp@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
25
packages/3d/README.md
Normal file
25
packages/3d/README.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Dioxus3d: declarative framework for using the `Canvas`
|
||||
|
||||
Declarative wrapper over wgpu for creating interactive gpu-enabled visualizations in the browser with Dioxus. This crate's analog is ThreeJS and react-three-fiber. Here, we expose a set of hooks for using the `Canvas` imperatively, and then provide a set of components that interact with this canvas context. From there, declaring scenes is as easy as:
|
||||
|
||||
```rust
|
||||
use dioxus3d::{Canvas};
|
||||
use dioxus::prelude::*;
|
||||
|
||||
static HelloWorld = |ctx, props| {
|
||||
ctx.render(rsx! {
|
||||
Canvas {
|
||||
Text {
|
||||
"Hello world"
|
||||
rel_pos: (0,0,1)
|
||||
size: (1,1,1)
|
||||
}
|
||||
Cube {
|
||||
size: (1,1,1)
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
```
|
||||
|
||||
// dioxus bevy: wrap a bevy instance with reactive controls.
|
7
packages/3d/src/lib.rs
Normal file
7
packages/3d/src/lib.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue