From 1dbe8148b780cf6722d2fb03081aee2bc20dfe2a Mon Sep 17 00:00:00 2001 From: lat-murmeldjur Date: Sun, 24 Mar 2024 19:34:50 +0100 Subject: [PATCH] "Auto commit number 30" --- chronicl.dt | 2 +- featuring.dt | 2 +- ohio.note | 1 + src/magma_ocean.rs | 17 ++++++++++++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/chronicl.dt b/chronicl.dt index d99e90e..8580e7b 100644 --- a/chronicl.dt +++ b/chronicl.dt @@ -1 +1 @@ -29 \ No newline at end of file +30 \ No newline at end of file diff --git a/featuring.dt b/featuring.dt index d99e90e..8580e7b 100644 --- a/featuring.dt +++ b/featuring.dt @@ -1 +1 @@ -29 \ No newline at end of file +30 \ No newline at end of file diff --git a/ohio.note b/ohio.note index 40244aa..f1d8efb 100644 --- a/ohio.note +++ b/ohio.note @@ -28,3 +28,4 @@ Year::2024::|::Month::03::|::Day::20::|::Hour::17::|::Minute::16::|::Second::54: Year::2024::|::Month::03::|::Day::21::|::Hour::14::|::Minute::51::|::Second::35:: Year::2024::|::Month::03::|::Day::22::|::Hour::16::|::Minute::32::|::Second::41:: Year::2024::|::Month::03::|::Day::24::|::Hour::19::|::Minute::16::|::Second::53:: +Year::2024::|::Month::03::|::Day::24::|::Hour::19::|::Minute::34::|::Second::50:: diff --git a/src/magma_ocean.rs b/src/magma_ocean.rs index ffe97a7..518856a 100644 --- a/src/magma_ocean.rs +++ b/src/magma_ocean.rs @@ -84,7 +84,7 @@ pub fn petrify(flow: Magma) -> Stone { let mut rng = rand::thread_rng(); let points_diff = sbtr_f32_3(flow.positions[1].position, flow.positions[0].position); let planes_normal: [f32; 3] = nrmlz_f32_3(points_diff); - let planes_number = rng.gen_range(8..16); + let planes_number = rng.gen_range(64..128); let mut points_of_plane: u32 = 3; let reference_orthogonal = gen_rthgnl_f32_3(planes_normal, &mut rng); @@ -141,11 +141,21 @@ pub fn petrify(flow: Magma) -> Stone { &mut plane.positions, ); + let mut normal_origin = *plane_point; + if pln == 0 { + normal_origin = planes_points[1]; + } + if pln == planes_number - 1 { + normal_origin = planes_points[(planes_number - 2) as usize]; + } + for i in 0..points_of_plane { stone.positions.push(Position { position: plane.positions[(i as usize)].position, }); - let normal = find_points_normal(plane.positions[(i as usize)].position, *plane_point); + let normal = //nrmlz_f32_3(gen_f32_3(0.0, 1.0, &mut rng)); + // find_points_normal(plane.positions[(i as usize)].position, *plane_point); + find_points_normal(plane.positions[(i as usize)].position, normal_origin); stone.normals.push(Normal { normal: normal }); } @@ -197,7 +207,8 @@ pub fn petrify(flow: Magma) -> Stone { if previous_plane[0] == planes_number - 2 { points_of_plane = 3; } else { - points_of_plane = rng.gen_range(32..64); + points_of_plane = + 3 + spherical_progress(125.0, pln as f32, planes_number as f32 - 1.0) as u32; }; }