Exemple #1
0
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            EventLog.WriteEntry(MyEventSource, "WaveSim start simulation", EventLogEntryType.Information);
            _eventCounter = 0;

            _grid = new WaveGrid(10);        // 10x10 grid
            _grid.SetCenterPeak(3.0);
            meshMain.Positions = _grid.Points;

            _timer          = new DispatcherTimer();
            _timer.Tick    += new EventHandler(timer_Tick);
            _timer.Interval = TimeSpan.FromMilliseconds(200);
            _timer.Start();
        }
Exemple #2
0
        public Window1()
        {
            InitializeComponent();

            // Configure event log for performance monitoring
            if (!EventLog.SourceExists(MyEventSource))
            {
                EventLog.CreateEventSource(MyEventSource, "Application");
            }
            EventLog.WriteEntry(MyEventSource, "* WaveSim startup", EventLogEntryType.Information);

            _grid = new WaveGrid(10);        // 10x10 grid
            _grid.SetCenterPeak(3.0);
            meshMain.Positions       = _grid.Points;
            meshMain.TriangleIndices = _grid.TriangleIndices;

            // On each WheelMouse change, we zoom in/out a particular % of the original distance
            const double ZoomPctEachWheelChange = 0.02;

            zoomDelta = Vector3D.Multiply(ZoomPctEachWheelChange, camMain.LookDirection);
        }