internal void showHidePlane() { if (this.Content != null && showPlane) { Rect3D bounds = this.Content.Bounds; //var length = bound.SizeX > bound.SizeY ? bound.SizeX : bound.SizeY > bound.SizeZ ? bound.SizeY : bound.SizeZ > bound.SizeX ? bound.SizeZ : bound.SizeX; var length = Math.Max(bounds.Size.X, Math.Max(bounds.Size.Y, bounds.Size.Z)); length += 10; if (_plane == null) { _plane = new RectangleVisual3D { Normal = new Vector3D(0, 1, 0), Fill = new SolidColorBrush(Color.FromArgb(80, 255, 0, 0)) } } ; //_plane.LengthDirection = new Vector3D(0, 0.2, 1); _plane.Width = length; _plane.Length = length; parent.Children.Add(_plane); showPlane = false; //PlaneVisual3D p = new PlaneVisual3D(this); //p.createPlane(); //parent.Children.Add(p); } else if (!showPlane) { parent.Children.Remove(_plane); _plane = null; showPlane = true; } }
public RectangleUI(Rectangle rectangle) : base(rectangle) { Rectangle = rectangle; var rect = new RectangleVisual3D(); double angle = GetAngleABC(rectangle.Vertices[0].Point, rectangle.Vertices[1].Point, rectangle.Vertices[2].Point); Point3D diagonalPoint, widthPoint, lengthPoint; Point3D basePoint = rectangle.Vertices[0].Point; if (IsDoubleEqual(90, angle)) { //Vertice[0] and Vertice[2] - diagonal diagonalPoint = rectangle.Vertices[2].Point; widthPoint = rectangle.Vertices[3].Point; lengthPoint = rectangle.Vertices[1].Point; } else { //Vertice[0] and Vertice[3] - diagonal diagonalPoint = rectangle.Vertices[3].Point; widthPoint = rectangle.Vertices[2].Point; lengthPoint = rectangle.Vertices[1].Point; } diagonalPoint = diagonalPoint.Multiply(SCALE_FACTOR); widthPoint = widthPoint.Multiply(SCALE_FACTOR); lengthPoint = lengthPoint.Multiply(SCALE_FACTOR); basePoint = basePoint.Multiply(SCALE_FACTOR); rect.LengthDirection = lengthPoint - basePoint; var widthDirection = widthPoint - basePoint; //check if it is really a rectangle if (!(IsDoubleEqual(Vector3D.DotProduct(widthDirection, rect.LengthDirection), 0) && IsDoubleEqual(Vector3D.DotProduct(rect.LengthDirection, lengthPoint - diagonalPoint), 0) && IsDoubleEqual(Vector3D.DotProduct(widthDirection, widthPoint - diagonalPoint), 0))) { throw new NotRectangleException($"Прямоугольник №{rectangle.Number}: четыре точки №{rectangle.Vertices[0].Number}, " + $"№{rectangle.Vertices[1].Number}, " + $"№{rectangle.Vertices[2].Number}, " + $"№{rectangle.Vertices[3].Number}, " + $"не формируют прямоугльник"); } rect.Normal = Vector3D.CrossProduct(rect.LengthDirection, widthDirection); rect.Origin = new Point3D((basePoint.X + diagonalPoint.X) / 2, (basePoint.Y + diagonalPoint.Y) / 2, (basePoint.Z + diagonalPoint.Z) / 2); rect.Width = basePoint.DistanceTo(widthPoint); rect.Length = basePoint.DistanceTo(lengthPoint); VisualElement = rect; Material.Children.Add(RectangleBaseMaterial); Title = "Прямоугольник №" + rectangle.Number; }
public RectangleVisual3D CreateCube() { var diff = _end - _begin; var cube = new RectangleVisual3D(); cube.Origin = _begin.ToPoint3D(); cube.Length = 100; cube.Width = 100; cube.Material = Materials.DarkGray; return(cube); }
public MainWindow() { InitializeComponent(); model = new ModelVisual3D(); const int rows = 5; const int columns = 4; const double distance = 120; var turbine = new WindTurbine(); var r = new Random(); for (int i = 0; i < rows; i++) { double y = i * distance; for (int j = 0; j + (i % 2) * 0.5 <= columns - 1; j++) { double x = (j + (i % 2) * 0.5) * distance; var visual = new WindTurbineVisual3D { RotationAngle = r.Next(360), RotationSpeed = 20, WindTurbine = turbine, Transform = new TranslateTransform3D(x, y, 0) }; model.Children.Add(visual); } } var seasurface = new RectangleVisual3D { DivWidth = 100, DivLength = 100, Origin = new Point3D((rows - 2) * distance * 0.5, (columns) * distance * 0.5, 0), Width = rows * distance * 2, Length = columns * distance * 2 }; seasurface.Material = seasurface.BackMaterial = MaterialHelper.CreateMaterial(Colors.SeaGreen, 0.8); model.Children.Add(new GridLinesVisual3D() { Center = seasurface.Origin, Fill = Brushes.Gray, Width = seasurface.Width, Length = seasurface.Length }); model.Children.Add(seasurface); view1.Children.Add(model); Loaded += MainWindowLoaded; Closed += MainWindowClosed; }
// [PropertyFilePropertyArrayAttribute(new uint[] { 0x0d109090, 0x0d109091, 0x0d109092 }, Optional=true)] // public KeyProperty RenderGroup // { get; set; } // [PropertyFilePropertyArrayAttribute(new uint[] { 0x0d1090a0, 0x0d1090a1, 0x0d1090a2 }, Optional = true)] // public Int32Property DecalMachineSpec // { get; set; } public LotEditorItemMarker CreateGeometry() { LotEditorItemMarker marker = new LotEditorItemMarker(this); RectangleVisual3D rectangle = new RectangleVisual3D(); rectangle.Length = 2 * Scale; rectangle.Width = 2 * Scale; rectangle.Material = new DiffuseMaterial(Brushes.Transparent); rectangle.BackMaterial = MaterialHelper.CreateMaterial(Brushes.Green, new SolidColorBrush(Color.FromScRgb(1f, 0.2f, 0.2f, 0f))); marker.ManipulatorModel = rectangle.Model; marker.Transform = new MatrixTransform3D(this.Transform.GetAsMatrix3D()); ModelRepresentation = marker; return(marker); }
private static RectangleVisual3D GenerateRectangle() { RectangleVisual3D rectangle = new RectangleVisual3D() { Width = 6, Length = 7, Origin = new Point3D(0.5, -0.5, 0.7), Normal = new Vector3D(0.5, 1, 0.7), LengthDirection = new Vector3D(3, 4, 5), Fill = Brushes.Yellow }; return(rectangle); }
private void AddImageBase(string source, double minx, double miny, double maxx, double maxy) { double width = maxx - minx; double height = maxy - miny; double cx = (minx + maxx) / 2; double cy = (miny + maxy) / 2; BitmapImage bitmap = new BitmapImage(new Uri(source, UriKind.Relative)); ImageBrush brush = new ImageBrush(bitmap) { RelativeTransform = new RotateTransform(90), TileMode = TileMode.Tile }; RectangleVisual3D rect = new RectangleVisual3D { Length = width, Width = height, Origin = new Point3D(cx, cy, 0), Fill = brush }; TheViewport.Children.Add(rect); }
public void DrawCube() { RectangleVisual3D myCube = new RectangleVisual3D(); myCube.Origin = new Point3D(50, 50, 50); //Set this value to whatever you want your Cube Origen to be. myCube.Width = 50; //whatever width you would like. myCube.Length = 50; //Set Length = Width myCube.Normal = new Vector3D(0, 1, 0); // if you want a cube that is not at some angle then use a vector in the direction of an axis such as this one or <1,0,0> and <0,0,1> myCube.LengthDirection = new Vector3D(0, 1, 0); //This will depend on the orientation of the cube however since it is equilateral just set it to the same thing as normal. myCube.Material = new DiffuseMaterial(Brushes.Red); // Set this with whatever you want or just set the myCube.Fill Property with a brush type. var hVp3D = new HelixViewport3D(); var lights = new DefaultLights(); var teaPot = new Teapot(); hVp3D.Children.Add(lights); //hVp3D.Children.Add(teaPot); hVp3D.Children.Add(myCube); this.Content = hVp3D; //this.AddChild(hVp3D); }
public void UpdateDebugLabels() { if (!IsDebugEnabled) { return; } double n = Math.Pow(2, TileZoom); double inverseZoom = 18 - tileZoom; double newTileX = TileX * Math.Pow(2, inverseZoom); double newTileY = tileY * Math.Pow(2, inverseZoom); double NormalizedX = (scale.NormalizeX(newTileX) + scale.NormalizeX(TileService.xTileOffset)); double NormalizedY = (scale.NormalizeY(newTileY) + scale.NormalizeY(TileService.yTileOffset)); double osmTileXPreFloor = NormalizedX * n; double osmTileYPreFloor = NormalizedY * n; int osmTileX = (int)Math.Floor(osmTileXPreFloor); int osmTileY = (int)Math.Floor(osmTileYPreFloor); //Clear any previous this.Children.Clear(); //Generate a unique tile color Random r = new Random(Guid.NewGuid().GetHashCode()); Color color = Color.FromArgb(100, (byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255)); //Create a small border for tile double borderSize = Width * 0.05; // 5% RectangleVisual3D LeftEdge = new RectangleVisual3D(); RectangleVisual3D RightEdge = new RectangleVisual3D(); RectangleVisual3D TopEdge = new RectangleVisual3D(); RectangleVisual3D BottomEdge = new RectangleVisual3D(); double offset = Width / 2; //LeftEdge LeftEdge.Origin = new Point3D(borderSize / 2 - offset, Width / 2 - offset, 0.1); LeftEdge.Width = Width; LeftEdge.Length = borderSize; LeftEdge.Fill = new SolidColorBrush(color); //Right Edge RightEdge.Origin = new Point3D(Width - borderSize / 2 - offset, Width / 2 - offset, 0.1); RightEdge.Length = borderSize; RightEdge.Width = Width; RightEdge.Fill = new SolidColorBrush(color); //TopEdge TopEdge.Origin = new Point3D(Width / 2 - offset, borderSize / 2 - offset, 0.1); TopEdge.Width = borderSize; TopEdge.Length = Width; TopEdge.Fill = new SolidColorBrush(color); //BottomEdge BottomEdge.Origin = new Point3D(Width / 2 - offset, Width - borderSize / 2 - offset, 0.1); BottomEdge.Width = borderSize; BottomEdge.Length = Width; BottomEdge.Fill = new SolidColorBrush(color); //Create text billboard for x / y values BillboardTextVisual3D tilenumBilboard = new BillboardTextVisual3D(); tilenumBilboard.Position = new Point3D(0, 0, 8 + inverseZoom * 4); tilenumBilboard.Background = Brushes.LightSalmon; tilenumBilboard.Text = $"TXY: {TileX}/{TileY} NTXY: {newTileX}/{newTileY} \n OSMTXY: {osmTileXPreFloor}/{osmTileYPreFloor} \n OSMFTXY: {osmTileX - 1}/{osmTileY}"; Children.Add(LeftEdge); Children.Add(RightEdge); Children.Add(TopEdge); Children.Add(BottomEdge); Children.Add(tilenumBilboard); }
private void CreateLotModel() { //Create the plane representing the lot (texture & size) if (UnitFileEntry.LotOverlayBoxSize != null) { Vector2Property lotSize = UnitFileEntry.LotOverlayBoxSize; RectangleVisual3D groundPlane = new RectangleVisual3D(); groundPlane.Width = (lotSize.X); groundPlane.Length = (lotSize.Y); groundPlane.Transform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), -90)); if (UnitFileEntry.LotOverlayBoxOffset != null) { // groundPlane.Transform = Transform3DHelper.CombineTransform(groundPlane.Transform, new TranslateTransform3D(-1 * UnitFileEntry.LotOverlayBoxOffset.X, -1 * UnitFileEntry.LotOverlayBoxOffset.Y, 0)); } if (UnitFileEntry.LotPlacementTransform != null && UnitFileEntry.LotPlacementTransform.Count > 0) { groundPlane.Transform = Transform3DHelper.CombineTransform(groundPlane.Transform, (Transform3D) new MatrixTransform3D(UnitFileEntry.LotPlacementTransform[0].GetAsMatrix3D()).Inverse); } if (UnitFileEntry.LotMask != null) { DatabaseIndex index = DatabaseManager.Instance.Indices.Find(k => k.InstanceId == UnitFileEntry.LotMask.InstanceId && k.TypeId == 0x2f4e681c); if (index != null) { Color color1 = Colors.Black; Color color2 = Colors.Red; Color color3 = Colors.Green; Color color4 = Colors.Blue; if (UnitFileEntry.LotColor1 != null) { color1 = Color.FromRgb((byte)(255 * UnitFileEntry.LotColor1.R), (byte)(255 * UnitFileEntry.LotColor1.G), (byte)(255 * UnitFileEntry.LotColor1.B)); } if (UnitFileEntry.LotColor2 != null) { color2 = Color.FromRgb((byte)(255 * UnitFileEntry.LotColor2.R), (byte)(255 * UnitFileEntry.LotColor2.G), (byte)(255 * UnitFileEntry.LotColor2.B)); } if (UnitFileEntry.LotColor3 != null) { color3 = Color.FromRgb((byte)(255 * UnitFileEntry.LotColor3.R), (byte)(255 * UnitFileEntry.LotColor3.G), (byte)(255 * UnitFileEntry.LotColor3.B)); } if (UnitFileEntry.LotColor4 != null) { color4 = Color.FromRgb((byte)(255 * UnitFileEntry.LotColor4.R), (byte)(255 * UnitFileEntry.LotColor4.G), (byte)(255 * UnitFileEntry.LotColor4.B)); } using (MemoryStream byteStream = new MemoryStream(index.GetIndexData(true))) { RasterImage rasterImage = RasterImage.CreateFromStream(byteStream, RasterChannel.Preview, color4, color3, color2, color1); groundPlane.Material = new DiffuseMaterial(new ImageBrush(rasterImage.MipMaps[0])); } } groundPlane.BackMaterial = new DiffuseMaterial(new SolidColorBrush(Colors.Transparent)); } viewPort.Children.Add(groundPlane); } }
public MainViewModel(MainWindow mainWindow) { // TODO: Complete member initialization this.mainWindow = mainWindow; Model3DGroup modelGroup = new Model3DGroup(); TubeVisual3D tube1 = GenerateTube(); RectangleVisual3D rectangle = GenerateRectangle(); SphereVisual3D sphere = new SphereVisual3D() { Center = new Point3D(1.5, 2.5, -0.7), Radius = 2 }; //modelGroup.Children.Add(tube1.Model); //modelGroup.Children.Add(rectangle.Model); //modelGroup.Children.Add(sphere.Model); /* * * Point3D point; * Point3D point2; * Point3D point3; * Point3D point4; * AddElementsPart2(modelGroup, out point, out point2, out point3, out point4); * * * TubeVisual3D path = new TubeVisual3D() * { * Path = new Point3DCollection(new List<Point3D>(){ * point + new Vector3D(0, 0, 20), * point2 + new Vector3D(0, 0, 19), * point3 + new Vector3D(0, 0, 18), * point4 + new Vector3D(0, 0, 17) * }), * Diameter = 0.5, * ThetaDiv = 20, * IsPathClosed = false, * Fill = Brushes.Green * //Fill = new Brush() { Colors.Blue} * }; * * modelGroup.Children.Add(path.Content); * */ //AddSolidBox(modelGroup); //AddRevolved(modelGroup); HelixVisual3D helixItem = new HelixVisual3D(); helixItem.Fill = new SolidColorBrush(Colors.Violet); helixItem.Origin = new Point3D(0, 0, -0.45); helixItem.Diameter = 0.1; helixItem.Turns = 2; helixItem.Length = 0.9; helixItem.Radius = 0.35; //modelGroup.Children.Add(helixItem.Content); //modelGroup.Children.Add(box.Content); //<helix:HelixVisual3D //Origin="0 0 -0.45" //Diameter="0.1" //Turns="2" //Length="0.9" //Radius="0.35" //Fill="Violet" //Visible="{Binding IsChecked, ElementName=HelixVisible}"/> numberOfPoints = 100; // wireLines = new WireLines { Color = Colors.Black, Thickness = 3, }; Points = new Point3DCollection(GeneratePoints(numberOfPoints, 7000 * 0.001)); //wireLines.Lines = Points; //modelGroup.Children.Add(wireLines.Content); var y0 = 0d; var theta = Math.PI / 180 * 30; var roofBuilder = new MeshBuilder(false, false); var y1 = y0 + Math.Tan(theta) * 5 / 2; var p0 = new Point(0, y1); var p1 = new Point(5 / 2 + 0.2 * Math.Cos(theta), y0 - 0.2 * Math.Sin(theta)); var p2 = new Point(p1.X + 0.1 * Math.Sin(theta), p1.Y + 0.1 * Math.Cos(theta)); var p3 = new Point(0, y1 + 0.1 / Math.Cos(theta)); var p4 = new Point(-p2.X, p2.Y); var p5 = new Point(-p1.X, p1.Y); IList <Point> roofSection = new List <Point>() { p0, p1, p1, p2, p2, p3, p3, p4, p4, p5, p5, p0 }; var roofAxisX = new Vector3D(0, -1, 0); var roofAxisY = new Vector3D(0, 0, 1); var roofOrigin = new Point3D(1, 1, 1); //roofBuilder.AddPolygon(roofSection, roofAxisX, roofAxisY, roofOrigin); Point3DCollection simplePoly = new System.Windows.Media.Media3D.Point3DCollection( new List <Point3D>() { new Point3D(1, 0, 1), new Point3D(1, 1, 1), new Point3D(0, 1, 1), new Point3D(0, 0, 1), /* * //new Point3D(1,0, 1), * new Point3D(0,0, -1), * new Point3D(1,0, -1), * new Point3D(1,1, -1), * new Point3D(0,1, -1), * //new Point3D(1,0, 1), * new Point3D(0,0, -1), * new Point3D(0,0, 1), */ } ); roofBuilder.AddPolygon(simplePoly); //roofBuilder.AddRectangularMesh() GeometryModel3D roofGeometry = new GeometryModel3D(); //var material = MaterialHelper.CreateMaterial(Brushes.LightBlue, ambient: 77, freeze: false); var material = MaterialHelper.CreateMaterial(Colors.LawnGreen, 0.25); roofGeometry.Material = material; roofGeometry.BackMaterial = material; roofGeometry.Geometry = roofBuilder.ToMesh(true); modelGroup.Children.Add(roofGeometry); //ScreenSpaceLines3D Wireframe = new ScreenSpaceLines3D(); //Wireframe.Thickness = 2; //Wireframe.Color = Colors.Black; //Wireframe.Points = simplePoly; ////Wireframe.MakeWireframe(roofGeometry); //modelGroup.Children.Add(Wireframe.Content); var Mesh = new MeshGeometry3D(); //var Material = MaterialHelper.CreateImageMaterial(image); var Damping = 0.98; var integrator = new VerletIntegrator() { Iterations = 4, Damping = 0.98 }; var WindSpeed = 6; var WindDirection = 180; var PoleHeight = 12; var Height = 3; var Length = 4; var Mass = 0.8; var m = 48; var n = 32; var pts = new Point3D[n, m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { pts[i, j] = new Point3D(-Length * j / (m - 1), 0, PoleHeight - Height * i / (n - 1)); } } var pts2 = new Point3D[2, 4]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 4; j++) { double x = 0, z = 0; if (i == 0) { x = 0; z = 0; } if (i == 1) { x = 1; z = 0; } if (i == 2) { x = 1; z = 1; } if (i == 3) { x = 0; z = 1; } pts[i, j] = new Point3D(x, i, PoleHeight - z); } } var mb = new MeshBuilder(false, true); //mb.AddRectangularMesh(pts, null, false, false); mb.AddRectangularMesh(pts, null, false, false); Mesh = mb.ToMesh(); var gradientMaterial = CreateGradientBrushMaterial(); gradientMaterial = MaterialHelper.CreateMaterial(Colors.LightBlue, 0.25); GeometryModel3D meshGeometry = new GeometryModel3D(); meshGeometry.Geometry = Mesh; meshGeometry.Material = gradientMaterial; meshGeometry.BackMaterial = gradientMaterial; modelGroup.Children.Add(meshGeometry); this.Model = modelGroup; }
private void InitializeScene() { linearInterpolator = new LinearInterpolator(); sphericalLinearInterpolator = new SphericalLinearInterpolator(); realTimeInterpolator = new RealTimeInterpolator(); const double maxVal = 8; var arrowX = new ArrowVisual3D(); arrowX.Direction = new Vector3D(1, 0, 0); arrowX.Point1 = new Point3D(0, 0, 0); arrowX.Point2 = new Point3D(maxVal, 0, 0); arrowX.Diameter = 0.1; arrowX.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowX); arrowX = new ArrowVisual3D(); arrowX.Direction = new Vector3D(1, 0, 0); arrowX.Point1 = new Point3D(0, 0, 0); arrowX.Point2 = new Point3D(maxVal, 0, 0); arrowX.Diameter = 0.1; arrowX.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowX); var arrowMX = new ArrowVisual3D(); arrowMX.Direction = new Vector3D(-1, 0, 0); arrowMX.Point1 = new Point3D(0, 0, 0); arrowMX.Point2 = new Point3D(-maxVal, 0, 0); arrowMX.Diameter = 0.1; arrowMX.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowMX); arrowMX = new ArrowVisual3D(); arrowMX.Direction = new Vector3D(-1, 0, 0); arrowMX.Point1 = new Point3D(0, 0, 0); arrowMX.Point2 = new Point3D(-maxVal, 0, 0); arrowMX.Diameter = 0.1; arrowMX.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowMX); var arrowY = new ArrowVisual3D(); arrowY.Direction = new Vector3D(0, 0, 1); arrowY.Point1 = new Point3D(0, 0, 0); arrowY.Point2 = new Point3D(0, 0, maxVal); arrowY.Diameter = 0.1; arrowY.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowY); arrowY = new ArrowVisual3D(); arrowY.Direction = new Vector3D(0, 0, 1); arrowY.Point1 = new Point3D(0, 0, 0); arrowY.Point2 = new Point3D(0, 0, maxVal); arrowY.Diameter = 0.1; arrowY.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowY); var arrowMY = new ArrowVisual3D(); arrowMY.Direction = new Vector3D(0, 0, -1); arrowMY.Point1 = new Point3D(0, 0, 0); arrowMY.Point2 = new Point3D(0, 0, -maxVal); arrowMY.Diameter = 0.1; arrowMY.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowMY); arrowMY = new ArrowVisual3D(); arrowMY.Direction = new Vector3D(0, 0, -1); arrowMY.Point1 = new Point3D(0, 0, 0); arrowMY.Point2 = new Point3D(0, 0, -maxVal); arrowMY.Diameter = 0.1; arrowMY.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowMY); var arrowZ = new ArrowVisual3D(); arrowZ.Direction = new Vector3D(0, 1, 0); arrowZ.Point1 = new Point3D(0, 0, 0); arrowZ.Point2 = new Point3D(0, maxVal, 0); arrowZ.Diameter = 0.1; arrowZ.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowZ); arrowZ = new ArrowVisual3D(); arrowZ.Direction = new Vector3D(0, 1, 0); arrowZ.Point1 = new Point3D(0, 0, 0); arrowZ.Point2 = new Point3D(0, maxVal, 0); arrowZ.Diameter = 0.1; arrowZ.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowZ); var arrowMZ = new ArrowVisual3D(); arrowMZ.Direction = new Vector3D(0, -1, 0); arrowMZ.Point1 = new Point3D(0, 0, 0); arrowMZ.Point2 = new Point3D(0, -maxVal, 0); arrowMZ.Diameter = 0.1; arrowMZ.Fill = System.Windows.Media.Brushes.Black; HelixViewportLeft.Children.Add(arrowMZ); arrowMZ = new ArrowVisual3D(); arrowMZ.Direction = new Vector3D(0, 0, -1); arrowMZ.Point1 = new Point3D(0, 0, 0); arrowMZ.Point2 = new Point3D(0, -maxVal, 0); arrowMZ.Diameter = 0.1; arrowMZ.Fill = System.Windows.Media.Brushes.Black; HelixViewportRight.Children.Add(arrowMZ); var xArrowText = new TextVisual3D(); xArrowText.Text = "X"; xArrowText.Position = new Point3D(maxVal - 0.5, 0, 0.5); xArrowText.Height = 0.5; xArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportLeft.Children.Add(xArrowText); xArrowText = new TextVisual3D(); xArrowText.Text = "X"; xArrowText.Position = new Point3D(maxVal - 0.5, 0, 0.5); xArrowText.Height = 0.5; xArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportRight.Children.Add(xArrowText); var yArrowText = new TextVisual3D(); yArrowText.Text = "Z"; yArrowText.Position = new Point3D(0, 0.5, maxVal - 0.5); yArrowText.Height = 0.5; yArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportLeft.Children.Add(yArrowText); yArrowText = new TextVisual3D(); yArrowText.Text = "Z"; yArrowText.Position = new Point3D(0, 0.5, maxVal - 0.5); yArrowText.Height = 0.5; yArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportRight.Children.Add(yArrowText); var zArrowText = new TextVisual3D(); zArrowText.Text = "Y"; zArrowText.Position = new Point3D(0.5, maxVal - 0.5, 0); zArrowText.Height = 0.5; zArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportLeft.Children.Add(zArrowText); zArrowText = new TextVisual3D(); zArrowText.Text = "Y"; zArrowText.Position = new Point3D(0.5, maxVal - 0.5, 0); zArrowText.Height = 0.5; zArrowText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportRight.Children.Add(zArrowText); var leftText = new TextVisual3D(); leftText.Text = "Internal angles interpolation"; leftText.Position = new Point3D(0, 0, maxVal + 0.5); leftText.Height = 1; leftText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportLeft.Children.Add(leftText); var rightText = new TextVisual3D(); rightText.Text = "Inverse chain"; rightText.Position = new Point3D(0, 0, maxVal + 0.5); rightText.Height = 1; rightText.FontWeight = System.Windows.FontWeights.Bold; HelixViewportRight.Children.Add(rightText); var floor = new RectangleVisual3D { Fill = new SolidColorBrush(Color.FromArgb(30, 0, 0, 0)), Normal = new Vector3D(0, 0, 1), Origin = new Point3D(0, 0, 0) }; floor.Width = floor.Length = 10; floor.LengthDirection = new Vector3D(1, 0, 0); HelixViewportLeft.Children.Add(floor); var wall = new RectangleVisual3D { Fill = new SolidColorBrush(Color.FromArgb(30, 0, 0, 0)), Normal = new Vector3D(0, 0, 1), Origin = new Point3D(0, 0, 0) }; wall.Width = wall.Length = 10; wall.LengthDirection = new Vector3D(1, 0, 0); HelixViewportRight.Children.Add(wall); frameEuler = new CombinedManipulator() { CanRotateX = false, CanRotateY = false, CanRotateZ = false }; frameQuaternion = new CombinedManipulator() { CanRotateX = false, CanRotateY = false, CanRotateZ = false }; }