arrange bamboo around center

This commit is contained in:
ethan merchant 2024-12-21 09:46:50 -05:00
parent 724bc153be
commit c434d7f866

View file

@ -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