Nicer visuals

This commit is contained in:
numzero 2024-06-09 21:47:10 +03:00
parent 978138c780
commit 3362df4109

View File

@ -47,10 +47,12 @@ pub fn main() {
gc.canvas_height(1000.0); gc.canvas_height(1000.0);
tube.render(gc); tube.render(gc);
gc.line_width(0.5); gc.line_width(0.5);
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 0.5)); // gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 0.5));
draw_fan(gc, &tube, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0); // draw_fan(gc, &tube, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0)); gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0));
draw_fan_2(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0); draw_fan_2(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
gc.stroke_color(Color::Rgba(0.5, 1.0, 0.0, 1.0));
draw_fan_2(gc, &space, vec2(-2.5 * tube.outer_radius, 1.25 * tube.external_halflength), vec2(1.0, -1.0), 1.0);
draw_track(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.2)); draw_track(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.2));
draw_track(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.5)); draw_track(gc, &space, vec2(-500.0, 0.0), vec2(1.0, 0.5));
draw_track(gc, &space, vec2(-0.5 * tube.inner_radius, -1.25 * tube.external_halflength), vec2(0.1, 1.0)); draw_track(gc, &space, vec2(-0.5 * tube.inner_radius, -1.25 * tube.external_halflength), vec2(0.1, 1.0));
@ -198,7 +200,7 @@ fn draw_ray_2(gc: &mut Vec<Draw>, space: &Space, base: Vec2, dir: Vec2) {
} }
gc.stroke(); gc.stroke();
gc.new_dash_pattern(); gc.new_dash_pattern();
gc.dash_length(6.0); // gc.dash_length(6.0);
gc.new_path(); gc.new_path();
gc.move_to(ray.pos.x, ray.pos.y); gc.move_to(ray.pos.x, ray.pos.y);
match sub { match sub {