private void OnTimerTick(object sender, ElapsedEventArgs e) { lock (_timer) { Random r = new Random(); // First load, fill with some random values if (_xyzData.Count == 0) { for (int i = 0; i < _pointCount; i++) { double x = DataManager.Instance.GetGaussianRandomNumber(50, 15); double y = DataManager.Instance.GetGaussianRandomNumber(50, 15); double z = DataManager.Instance.GetGaussianRandomNumber(50, 15); _xyzData.Append(x, y, z); } return; } // Subsequent load, update point positions using a sort of brownian motion by using random // numbers between -0.5, +0.5 using (_xyzData.SuspendUpdates()) { for (int i = 0; i < _xyzData.Count; i++) { double currentX = _xyzData.XValues[i]; double currentY = _xyzData.YValues[i]; double currentZ = _xyzData.ZValues[i]; currentX += r.NextDouble() - 0.5; currentY += r.NextDouble() - 0.5; currentZ += r.NextDouble() - 0.5; _xyzData.Update(i, currentX, currentY, currentZ); } } } }