WIP. shapes to etherdream/dac

This commit is contained in:
Ruben van de Ven 2025-04-08 16:22:52 +02:00
parent 655f64c913
commit a0e5a6777d
5 changed files with 83 additions and 43 deletions

93
Cargo.lock generated
View file

@ -152,7 +152,7 @@ dependencies = [
"ndk-context",
"ndk-sys 0.6.0+11769913",
"num_enum",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -1462,7 +1462,7 @@ dependencies = [
"polling",
"rustix",
"slab",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -1993,7 +1993,7 @@ dependencies = [
"const_panic",
"encase_derive",
"glam",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -2423,7 +2423,7 @@ checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd"
dependencies = [
"log",
"presser",
"thiserror 1.0.69",
"thiserror",
"windows 0.58.0",
]
@ -2495,6 +2495,16 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "helios-dac"
version = "0.1.1"
source = "git+https://github.com/seem-less/helios-dac-rs.git?branch=nannou-integration#b0a2c2a3666255bf311ba11374075d86866d94d1"
dependencies = [
"bitflags 1.3.2",
"rusb",
"thiserror",
]
[[package]]
name = "hermit-abi"
version = "0.3.9"
@ -2664,7 +2674,7 @@ dependencies = [
"combine",
"jni-sys",
"log",
"thiserror 1.0.69",
"thiserror",
"walkdir",
"windows-sys 0.45.0",
]
@ -2800,6 +2810,18 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "libusb1-sys"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e22e89d08bbe6816c6c5d446203b859eba35b8fa94bf1b7edb2f6d25d43f023f"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
@ -2992,7 +3014,7 @@ dependencies = [
"rustc-hash",
"spirv",
"termcolor",
"thiserror 1.0.69",
"thiserror",
"unicode-xid",
]
@ -3011,7 +3033,7 @@ dependencies = [
"regex",
"regex-syntax 0.8.5",
"rustc-hash",
"thiserror 1.0.69",
"thiserror",
"tracing",
"unicode-ident",
]
@ -3028,12 +3050,13 @@ dependencies = [
[[package]]
name = "nannou_laser"
version = "0.19.0"
source = "git+https://github.com/nannou-org/nannou?branch=bevy-refactor#03135771b41944347a64ef385f299d89dbea45c1"
version = "0.18.0"
source = "git+https://github.com/seem-less/nannou?branch=helios_laser_DAC#b746e746f07eef00cc2eca56903d965a9690edbc"
dependencies = [
"ether-dream",
"helios-dac",
"lasy",
"thiserror 2.0.12",
"thiserror",
]
[[package]]
@ -3047,7 +3070,7 @@ dependencies = [
"log",
"ndk-sys 0.5.0+25.2.9519653",
"num_enum",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -3062,7 +3085,7 @@ dependencies = [
"ndk-sys 0.6.0+11769913",
"num_enum",
"raw-window-handle",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -3888,7 +3911,7 @@ checksum = "6006a627c1a38d37f3d3a85c6575418cfe34a5392d60a686d0071e1c8d427acb"
dependencies = [
"cpal",
"lewton",
"thiserror 1.0.69",
"thiserror",
]
[[package]]
@ -3909,6 +3932,16 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
[[package]]
name = "rusb"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c470dc7dc6e4710b6f85e9c4aa4650bc742260b39a36328180578db76fa258c1"
dependencies = [
"libc",
"libusb1-sys",
]
[[package]]
name = "rustc-hash"
version = "1.1.0"
@ -4138,7 +4171,7 @@ dependencies = [
"log",
"memmap2",
"rustix",
"thiserror 1.0.69",
"thiserror",
"wayland-backend",
"wayland-client",
"wayland-csd-frame",
@ -4302,16 +4335,7 @@ version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl 1.0.69",
]
[[package]]
name = "thiserror"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
dependencies = [
"thiserror-impl 2.0.12",
"thiserror-impl",
]
[[package]]
@ -4325,17 +4349,6 @@ dependencies = [
"syn 2.0.100",
]
[[package]]
name = "thiserror-impl"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]]
name = "thread_local"
version = "1.1.8"
@ -4639,6 +4652,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vec_map"
version = "0.8.2"
@ -4926,7 +4945,7 @@ dependencies = [
"raw-window-handle",
"rustc-hash",
"smallvec",
"thiserror 1.0.69",
"thiserror",
"wgpu-hal",
"wgpu-types",
]
@ -4968,7 +4987,7 @@ dependencies = [
"renderdoc-sys",
"rustc-hash",
"smallvec",
"thiserror 1.0.69",
"thiserror",
"wasm-bindgen",
"web-sys",
"wgpu-types",

View file

@ -7,7 +7,7 @@ edition = "2024"
bevy = "0.15.3"
bevy_nannou = { git = "https://github.com/nannou-org/nannou", branch = "bevy-refactor", version = "0.1.0", features = ["wayland"] }
iyes_perf_ui = "0.4.0"
nannou_laser = { git = "https://github.com/nannou-org/nannou", branch = "bevy-refactor", version = "0.19.0" }
nannou_laser = { git = "https://github.com/seem-less/nannou", branch = "helios_laser_DAC" }
serde = "1.0.219"
serde_json = "1.0.140"
zmq = "0.10.0"

View file

@ -1,6 +1,7 @@
use bevy::prelude::*;
use bevy::render::view::RenderLayers;
use bevy::window::WindowResolution;
use bevy_nannou::prelude::properties::spatial::position;
use bevy_nannou::prelude::*;
use bevy_nannou::NannouPlugin;
use iyes_perf_ui::prelude::*;
@ -87,18 +88,27 @@ fn setup(mut commands: Commands) {
}
pub fn laser_frame_producer(_laser: &mut LaserModel, frame: &mut laser::Frame){
// Simple constructors for white or blank points.
let lit_p = |position| laser::Point::new(position, [1.0; 3]);
fn text2points(position_and_intensity: [f32;3]) -> laser::Point{
let color = match position_and_intensity[2] {
1.0 => [1.0; 3],
0.0 => [0.0; 3],
_ => [1.0; 3] // TODO add provided color
};
// let p = &position_and_intensity[0..2];
let p = [position_and_intensity[0], -position_and_intensity[1]];
return laser::Point::new(p, color)
}
let positions = trap::shapes::YOU;
fn laser_frame_producer(_laser: &mut LaserModel, frame: &mut laser::Frame){
let positions = trap::shapes::YOUR_FUTURE;
// let tl = [-1.0, 1.0];
// let tr = [1.0, 1.0];
// let br = [1.0, -1.0];
// let bl = [-1.0, -1.0];
// let positions = [tl, tr, br, bl, tl];
let points = positions.iter().cloned().map(lit_p);
let points = positions.iter().cloned().map(text2points);
frame.add_lines(points);
}

4
src/trap/scenario.rs Normal file
View file

@ -0,0 +1,4 @@
enum Scene{
LEVEL,
TEST
}

File diff suppressed because one or more lines are too long