From 48482197e1c4fb92adca4dcacab703ebf2cc2e75 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Wed, 10 Apr 2024 11:57:10 -0400 Subject: [PATCH] still no vertex cols? --- Cargo.lock | 4 +- res/{color_cube => raw}/color_cube.blend | Bin res/{color_cube => raw}/color_cube.blend1 | Bin src/main.rs | 341 +--------------------- 4 files changed, 9 insertions(+), 336 deletions(-) rename res/{color_cube => raw}/color_cube.blend (100%) rename res/{color_cube => raw}/color_cube.blend1 (100%) diff --git a/Cargo.lock b/Cargo.lock index f673070..a324280 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,9 +619,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] diff --git a/res/color_cube/color_cube.blend b/res/raw/color_cube.blend similarity index 100% rename from res/color_cube/color_cube.blend rename to res/raw/color_cube.blend diff --git a/res/color_cube/color_cube.blend1 b/res/raw/color_cube.blend1 similarity index 100% rename from res/color_cube/color_cube.blend1 rename to res/raw/color_cube.blend1 diff --git a/src/main.rs b/src/main.rs index c89fb50..2caebc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use manifest_dir_macros::directory_relative_path; use stardust_xr_fusion::{ - client::Client, core::values::Color, drawable::{Line, LinePoint, Lines}, spatial::Transform + client::Client, core::values::ResourceID, drawable::Model, spatial::Transform }; #[tokio::main] @@ -10,341 +10,14 @@ async fn main() { // stardust_xr_fusion::drawable::Model // pub fn create(spatial_parent: &impl SpatialAspect, transform: Transform, model: &ResourceID) -> NodeResult - // let _model = Model::create( - // client.get_root(), - // Transform::identity(), - // &ResourceID::new_namespaced( - // "color_cube", - // "color_cube" - // ), - // ).unwrap(); - - let thickness = 0.03; - // stardust_xr_fusion::drawable::Lines - // pub fn create(spatial_parent: &impl SpatialAspect, transform: Transform, lines: &[Line]) -> NodeResult - let back_points = vec![ - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x000000FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF0000FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFF00FF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FF00FF), - }, - ]; - let back_line = Line { - points: back_points, - cyclic: true, - }; - let _back_lines = Lines::create( + let _model = Model::create( client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } + Transform::identity(), + &ResourceID::new_namespaced( + "color_cube", + "color_cube" ), - &[back_line] - ).unwrap(); - - let front_points = vec![ - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x0000FFFF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF00FFFF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFFFFFF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FFFFFF), - }, - ]; - let front_line = Line { - points: front_points, - cyclic: true, - }; - let _front_lines = Lines::create( - client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } - ), - &[front_line] - ).unwrap(); - - let left_points = vec![ - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x000000FF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x0000FFFF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FFFFFF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FF00FF), - }, - ]; - let left_line = Line { - points: left_points, - cyclic: true, - }; - let _left_lines = Lines::create( - client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } - ), - &[left_line] - ).unwrap(); - - let right_points = vec![ - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF0000FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF00FFFF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFFFFFF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFF00FF), - }, - ]; - let right_line = Line { - points: right_points, - cyclic: true, - }; - let _right_lines = Lines::create( - client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } - ), - &[right_line] - ).unwrap(); - - let bottom_points = vec![ - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x000000FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF0000FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFF00FFFF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y:-1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x0000FFFF), - }, - ]; - let bottom_line = Line { - points: bottom_points, - cyclic: true, - }; - let _bottom_lines = Lines::create( - client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } - ), - &[bottom_line] - ).unwrap(); - - let top_points = vec![ - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FF00FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z:-1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFF00FF), - }, - LinePoint { - point: mint::Vector3 { - x: 1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0xFFFFFFFF), - }, - LinePoint { - point: mint::Vector3 { - x:-1.0, - y: 1.0, - z: 1.0, - }, - thickness: thickness, - color: Color::from_hex(0x00FFFFFF), - }, - ]; - let top_line = Line { - points: top_points, - cyclic: true, - }; - let _top_lines = Lines::create( - client.get_root(), - Transform::from_scale( - mint::Vector3 { - x: 0.1, - y: 0.1, - z: 0.1, - } - ), - &[top_line] - ).unwrap(); + ); tokio::select! { _ = tokio::signal::ctrl_c() => (),