void MainWindow_Loaded(object sender, RoutedEventArgs e) { busyIndicator.IsBusy = true; _dxImageContainer = new D3DImageSlimDX(); _dxImageContainer.IsFrontBufferAvailableChanged += _D3DImageContainer_IsFrontBufferAvailableChanged; dxImage.Source = _dxImageContainer; _dxScene = new DxScene(); _dxImageContainer.SetBackBufferSlimDX(_dxScene.SharedTexture); renderProps.Scale = _dxScene.PointsCloudRenderer.Scale; // init camera helixView.Camera.Position = new Point3D(0, 25, -100); helixView.Camera.LookDirection = new Point3D(0, 0, 100) - helixView.Camera.Position; helixView.Camera.UpDirection = new Vector3D(0, 1, 0); helixView.Camera.FarPlaneDistance = 2000; // this is about 20 meters helixView.CameraChanged += delegate { UpdateCameraPosition(); }; UpdateCameraPosition(); BeginRenderingScene(); // setup tracker _kinectTracker = new KinectTracker(); _kinectTracker.TrackinkgStarted += OnKinectTrackinkgStarted; _kinectTracker.TrackingUpdated += OnKinectTrackingUpdated; _kinectTracker.TrackinkgCompleted += OnKinectTrackingCompleted; _kinectTracker.StartTracking(); }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_kinectTracker != null) _kinectTracker.StopTracking(); StopRenderingScene(); if (_dxScene != null) { _dxScene.Dispose(); _dxScene = null; } if (_dxImageContainer != null) { _dxImageContainer.Dispose(); _dxImageContainer = null; } }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_kinectTracker != null) { _kinectTracker.StopTracking(); } StopRenderingScene(); if (_dxScene != null) { _dxScene.Dispose(); _dxScene = null; } if (_dxImageContainer != null) { _dxImageContainer.Dispose(); _dxImageContainer = null; } }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { busyIndicator.IsBusy = true; _dxImageContainer = new D3DImageSlimDX(); _dxImageContainer.IsFrontBufferAvailableChanged += _D3DImageContainer_IsFrontBufferAvailableChanged; dxImage.Source = _dxImageContainer; _dxScene = new DxScene(); _dxImageContainer.SetBackBufferSlimDX(_dxScene.SharedTexture); renderProps.Scale = _dxScene.PointsCloudRenderer.Scale; // init camera helixView.Camera.Position = new Point3D(0,25,-100); helixView.Camera.LookDirection = new Point3D(0, 0, 100) - helixView.Camera.Position; helixView.Camera.UpDirection = new Vector3D(0,1,0); helixView.Camera.FarPlaneDistance = 2000; // this is about 20 meters helixView.CameraChanged += delegate { UpdateCameraPosition(); }; UpdateCameraPosition(); BeginRenderingScene(); // setup tracker _kinectTracker = new KinectTracker(); _kinectTracker.TrackinkgStarted += OnKinectTrackinkgStarted; _kinectTracker.TrackingUpdated += OnKinectTrackingUpdated; _kinectTracker.TrackinkgCompleted += OnKinectTrackingCompleted; _kinectTracker.StartTracking(); }