public static void DrawCloth(Graphics graphics, Cloth cloth) { graphics.Clear(Color.Black); foreach (var point in cloth.Points) { DrawPoint(graphics, point); } }
private void ClothForm_Load(object sender, EventArgs e) { _cloth = new Cloth(this.Width); _physicsTimer = new System.Timers.Timer(); _physicsTimer.Elapsed += PhysicsTimer_Tick; _physicsTimer.Interval = 10; //ms _physicsTimer.Start(); _paintTimer = new System.Timers.Timer(); _paintTimer.Elapsed += PaintTimer_Tick; _paintTimer.Interval = 5; //ms _paintTimer.AutoReset = false; _paintTimer.Start(); }