GridLinesVisual3D defineGrid(double maxLegLength) { var grid = new GridLinesVisual3D(); grid.Fill = Brushes.LightGray; grid.Width = maxLegLength * 2.1; grid.Length = grid.Width; grid.Thickness = grid.Width / 2000; grid.MajorDistance = grid.Width / 6; grid.MinorDistance = grid.MajorDistance / 4; return grid; }
// Not used - looks weird and is hard to line up properly public GridLinesVisual3D GetGrid() { GridLinesVisual3D grid = new GridLinesVisual3D(); grid.Width = 50; grid.Length = 50; grid.MajorDistance = 5; grid.MinorDistance = 1; grid.Thickness = 0.01; return grid; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 15 "..\..\..\UI\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnPause); #line default #line hidden return; case 2: #line 16 "..\..\..\UI\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnHelp); #line default #line hidden return; case 3: #line 17 "..\..\..\UI\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.SwitchCameraCommand_OnExecuted); #line default #line hidden return; case 4: this.CameraViewsCombobox = ((System.Windows.Controls.ComboBox)(target)); return; case 5: this.TogglePause = ((System.Windows.Controls.CheckBox)(target)); #line 33 "..\..\..\UI\MainWindow.xaml" this.TogglePause.Checked += new System.Windows.RoutedEventHandler(this.ToggleButton_OnChanged); #line default #line hidden #line 33 "..\..\..\UI\MainWindow.xaml" this.TogglePause.Unchecked += new System.Windows.RoutedEventHandler(this.ToggleButton_OnChanged); #line default #line hidden return; case 6: this.ButtonExit = ((System.Windows.Controls.Button)(target)); #line 34 "..\..\..\UI\MainWindow.xaml" this.ButtonExit.Click += new System.Windows.RoutedEventHandler(this.ButtonExit_OnClick); #line default #line hidden return; case 7: this.ViewPort = ((HelixToolkit.Wpf.HelixViewport3D)(target)); #line 39 "..\..\..\UI\MainWindow.xaml" this.ViewPort.CameraChanged += new System.Windows.RoutedEventHandler(this.ViewPort_CameraChanged); #line default #line hidden return; case 8: this.Grid = ((HelixToolkit.Wpf.GridLinesVisual3D)(target)); return; case 9: this.BoatBearing = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target)); return; case 10: this.BoatPosition = ((System.Windows.Media.Media3D.TranslateTransform3D)(target)); return; case 11: this.FileModelVisual3D = ((HelixToolkit.Wpf.FileModelVisual3D)(target)); return; case 12: this.Waypoint = ((AutoPilotSimulation.UI.DraggableSphere)(target)); return; case 13: this.InfoBox = ((AutoPilotSimulation.UI.InfoBox)(target)); return; } this._contentLoaded = true; }
private Visual3D CreateFaceGrid( Point3D V, Vector3D V2 ) { GridLinesVisual3D grid = new GridLinesVisual3D(); grid.Thickness = 0.4; grid.Length = this.Size * _size; grid.Width = this.Size * _size; grid.MinorDistance = _size; grid.Center = new Point3D( V.X, V.Y, V.Z); grid.Normal = V2; return grid; }
public World() { // instantiate our world WorldObjects = new ModelVisual3D(); Cubes = new ModelVisual3D(); JointObjects = new ModelVisual3D(); // create something to represent where the kinect is Kinect = new CubeVisual3D() { SideLength = 0.1, Center = new Point3D(0, 0, 0), Material = MaterialHelper.CreateMaterial(_Constants.KinectBrush, _Constants.KinectBrush) }; // something to represent the floor RectangleVisual3D Floor = new RectangleVisual3D() { LengthDirection = new Vector3D(0, 0, 1), Normal = new Vector3D(0, 1, 0), Origin = new Point3D(0, -0.01, 0), Length = 20, Width = 20, Fill = Brushes.White, Material = MaterialHelper.CreateMaterial(Brushes.White, Brushes.White) }; WorldObjects.Children.Add(Floor); // grid lines to layer on top of the floor GridLines = new GridLinesVisual3D() { LengthDirection = new Vector3D(0, 0, 1), Normal = new Vector3D(0, 1, 0), Transform = new ScaleTransform3D(0.025, 0.025, 0.025), Center = new Point3D(0, 0, 100), }; WorldObjects.Children.Add(GridLines); // and a reference co-ordinate system CoordinateSystem = new CoordinateSystemVisual3D() { ArrowLengths = 0.3 }; WorldObjects.Children.Add(CoordinateSystem); // setup our world transformations FloorTransform = new TranslateTransform3D(); AngleRotationTransform = new RotateTransform3D(Rotation3D.Identity, Kinect.Center); WorldTransforms = new Transform3DGroup(); WorldTransforms.Children.Add(FloorTransform); WorldTransforms.Children.Add(AngleRotationTransform); Kinect.Transform = WorldTransforms; JointObjects.Transform = FloorTransform; }