notes
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user