Skip to content

Commit

Permalink
voronoi
Browse files Browse the repository at this point in the history
  • Loading branch information
altunenes committed Sep 9, 2023
1 parent 09901ff commit e0d0b7f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/voronoi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ fn update(_app: &App, model: &mut Model, _update: Update) {
ui.add(egui::Slider::new(&mut settings.min_radius, 0.01f32..=10.0f32).text("min radius"));
ui.add(egui::Slider::new(&mut settings.max_radius, 0.01f32..=10.0f32).text("max radius"));
});
model.counter += 1;
if model.counter % 60 == 0 {
model.counter += 100;
let mut rng = rand::thread_rng();
let new_points: Vec<Point> = (0..50)
.map(|_| Point {
Expand All @@ -99,7 +98,6 @@ fn update(_app: &App, model: &mut Model, _update: Update) {
})
.collect();
model.points.extend(new_points);
}
for (current, target) in model.current_points.iter_mut().zip(&model.target_points) {
current.x += (target.x - current.x) * model.lerp_factor;
current.y += (target.y - current.y) * model.lerp_factor;
Expand Down

0 comments on commit e0d0b7f

Please sign in to comment.