public Trajectory3DView()
        {
            InitializeComponent();

            model.Transform = new Transform3DGroup();

            Axes axes = new Axes()
                {
                    Color = Colors.White
                };

            model.Children.Add(axes);

            WireLine roadAxis = new WireLine()
            {
                Point1 = new Point3D(-10, 0, 0),
                Point2 = new Point3D(10, 0, 0),
                Thickness = 5.0,
                Color = Colors.BlueViolet,
                ArrowEnds = Petzold.Media2D.ArrowEnds.End,
                Transform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), Settings.Default.KinectAngle))
            };

            model.Children.Add(roadAxis);

            if (Globals.ds.trajectories.Count > 0)
            {
                DrawTrajectory(Globals.ds.trajectories[Globals.ds.trajectories.Count - 1].t_id,Colors.Red);
            }

        }
Пример #2
0
		private void AddLine(double x0, double y0, double z0, double x1, double y1, double z1)
		{
			WireLine line = new WireLine { Point1 = new Point3D(x0, y0, z0), Point2 = new Point3D(x1, y1, z1) };
			BindingOperations.SetBinding(line, WireLine.ColorProperty, colorBinding);
			Children.Add(line);
		}
Пример #3
0
		private WireLine CreateLine(Point3D position, Vector3D direction)
		{
			var length = direction.Length;
			var colorRatio = (length - minLength) / (maxLength - minLength);
			if (colorRatio.IsNaN() || colorRatio.IsInfinite())
				colorRatio = 0;

			direction.Normalize();

			WireLine line = new WireLine
			{
				Point1 = position,
				Point2 = position + direction,
				Color = palette.GetColor(colorRatio)
			};

			return line;
		}