From e8bc993ed558e1b25a31e6a6fabac7853e1b1035 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 14 Dec 2022 14:58:57 -0500 Subject: GenRandom structs, scale, bias --- src/main.rs | 9 ++++----- src/sdf.rs | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index ab2aa40..d1afbce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ /* @TODO: - use 0..(sum of probs) for variant -- scale and bias - fullscreen key - mathematical analysis - options for: @@ -10,19 +9,19 @@ - AA quality - # iterations, distance cutoff - documentation +- GenRandom integers (+ gen_random_scale_bias) */ -extern crate nalgebra; extern crate gen_random; +extern crate nalgebra; pub mod sdf; mod sdl; pub mod win; +use gen_random::GenRandom; use nalgebra::{Matrix3, Matrix4, Rotation3, Vector3}; use std::time::Instant; -use gen_random::GenRandom; - type Vec3 = Vector3; type Mat3 = Matrix3; @@ -70,7 +69,7 @@ fn try_main() -> Result<(), String> { use sdf::{Constant, R3ToR, R3ToR3, RToR}; let _test = Constant::gen_thread_random(); println!("{_test:?}"); - + let funciton = R3ToR::compose( R3ToR3::InfiniteMirrors(Constant::from(2.0)), R3ToR::sphere_f32(0.2), diff --git a/src/sdf.rs b/src/sdf.rs index 61b070f..7456d25 100644 --- a/src/sdf.rs +++ b/src/sdf.rs @@ -1,10 +1,10 @@ #![allow(dead_code)] // @TODO @TEMPORARY -extern crate rand; extern crate gen_random_proc_macro; +extern crate rand; -use std::fmt::{self, Display, Formatter, Write}; -use gen_random_proc_macro::GenRandom; use gen_random::GenRandom; +use gen_random_proc_macro::GenRandom; +use std::fmt::{self, Display, Formatter, Write}; // we're only writing numbers and strings so write! should never fail. macro_rules! write_str { -- cgit v1.2.3