Beispiel #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();
        }
Beispiel #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);
        }
Beispiel #3
0
        private const double RenderPeriodInMS = 60;  //50;

        public Window1()
        {
            InitializeComponent();

            _splashAmplitude     = -3.0;
            slidPeakHeight.Value = -1.0 * _splashAmplitude;

            _raindropPeriodInMS = 35.0;
            slidNumDrops.Value  = 1.0 / (_raindropPeriodInMS / 1000.0);

            _dropSize = 1;


            // Grid ayarlama
            _grid = new WaveGrid(GridSize);
            meshMain.Positions       = _grid.Points;
            meshMain.TriangleIndices = _grid.TriangleIndices;

            // WheelMouse'daki her değişiklikte orijinal mesafenin belirli bir % 'ini yakınlaştırıp uzaklaştırırız
            const double ZoomPctEachWheelChange = 0.02;

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