From c434d7f866bcefacbdfc411b8cbc82f8ceac1165 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Sat, 21 Dec 2024 09:46:50 -0500 Subject: [PATCH] arrange bamboo around center --- src/Arts.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Arts.cs b/src/Arts.cs index 3a64e8d..d3242bc 100644 --- a/src/Arts.cs +++ b/src/Arts.cs @@ -96,17 +96,21 @@ static class Arts ); // bamboo - for (int i = -12; i <= 12; i++) + offset = 0; + int s_len = 24; + for (int i = -s_len; i <= s_len; i++) { - float z_offset = Noise.s_scalar_x(i) * 2.0f; - float x_offset = Noise.s_scalar_x(i + 32) * 0.2f; - float x_wind = Maths.smooth_stop(Maths.u_scalar(SKMath.Sin((i * 0.16f) - Time.Totalf))); + Quat q = Quat.FromAngles(0, i * 3, 0); + Vec3 pos = q * V.XYZ(0, 0, -10 + (Maths.smooth_stop(Noise.u_scalar_x(i + s_len * 2)) * 5)); + // float z_offset = Noise.s_scalar_x(i + 32) * 2.0f; + float x_offset = Noise.s_scalar_x(i + s_len * 4) * 0.2f; + float x_wind = Maths.smooth_stop(Maths.u_scalar(SKMath.Sin((pos.x * 0.5f) - Time.Totalf))); Vec3[] p = new Vec3[] { - V.XYZ(i * 0.3f, 0, -10 + z_offset), - V.XYZ(i * 0.3f, 1, -10 + z_offset), + pos + V.XYZ(0, 0, 0), + pos + V.XYZ(0, 1, 0), - V.XYZ(i * 0.3f, 4, -10 + z_offset), - V.XYZ(i * 0.3f + x_offset + x_wind, 5, -10 + z_offset), + pos + V.XYZ(0, 4, 0), + pos + V.XYZ(x_offset + x_wind, 5, 0), }; // debug bezier points