This commit is contained in:
2026-01-22 16:24:29 +01:00
parent 452cc87a57
commit a699022812
9 changed files with 973 additions and 14 deletions

View File

@@ -153,10 +153,10 @@ impl eframe::App for MyApp {
let trail_points: Vec<[f64;2]> = self.trail.iter().map(|p| p.1).collect();
Plot::new("scatter_plot").show(ui, |plot_ui| {
// plot_ui.points(trail_scatter);
if !trail_points.is_empty() {
for idx in 0..trail_points.len() - 1 {
let alpha = (255.0 * (idx as f32) / trail_points.len() as f32).round() as u8;
let alpha = 255 - ((time - self.trail[idx].0) / self.period * 255.0).round() as u8;
// let alpha = (255.0 * (idx as f32) / trail_points.len() as f32).round() as u8;
plot_ui.add(Line::new("trace", vec![trail_points[idx], trail_points[idx+1]]).width(2.0).color(Color32::from_rgba_unmultiplied(240, 100, 100, alpha)));
}