コード例 #1
0
        private void OnDrawGizmos()
        {
            Rectangle3 rect = Rectangle3.CreateFromCCWPoints(P0.position, P1.position, P2.position, P3.position);

            FiguresColor();
            DrawRectangle(ref rect);
        }
コード例 #2
0
            static void Main(string[] args)
            {
                Rectangle3 r = new Rectangle3();

                r.length = 4.5;
                r.width  = 3.5;
                r.Display();
                Console.ReadLine();
            }
コード例 #3
0
        public void TestTask2_3()
        {
            Figure3    figure    = new Figure3(4, 6);
            Square3    square    = new Square3(3, 4);
            Rectangle3 rectangle = new Rectangle3(5, 7);

            Assert.AreEqual(figure.Draw(), figure.GetType().Name);
            Assert.AreEqual(square.Draw(), square.GetType().Name);
            Assert.AreEqual(rectangle.Draw(), rectangle.GetType().Name);
        }
コード例 #4
0
        protected void DrawRectangle(ref Rectangle3 rectangle)
        {
            Vector3 v0, v1, v2, v3;

            rectangle.CalcVertices(out v0, out v1, out v2, out v3);
            Gizmos.DrawLine(v0, v1);
            Gizmos.DrawLine(v1, v2);
            Gizmos.DrawLine(v2, v3);
            Gizmos.DrawLine(v3, v0);
        }
コード例 #5
0
        private Shape AddPlane()
        {
            var shape = new Rectangle3(Vector3.UnitZ, 2, 2, ConsoleColor.Blue)
            {
                CullBackFaces = false
            };

            shape.RotateX(-pi / 2);
            return(shape);
        }
コード例 #6
0
        private void btn4_MouseEnter(object sender, MouseEventArgs e)
        {
            StackPanel1.Visibility = Visibility.Hidden;
            StackPanel2.Visibility = Visibility.Hidden;
            StackPanel3.Visibility = Visibility.Visible;
            StackPanel4.Visibility = Visibility.Hidden;
            czy_otwarta_pierwsza   = false;
            czy_otwarta_druga      = false;
            czy_otwarta_trzecia    = true;
            czy_otwarta_czwarta    = false;

            Rectangle3.BeginAnimation(WidthProperty, BorderAnimation1);
        }
コード例 #7
0
 private void btn3_MouseEnter(object sender, MouseEventArgs e)
 {
     if (StackPanel3.Visibility == Visibility.Hidden)
     {
         StackPanel3.BeginAnimation(HeightProperty, DropDownAnimation);
         StackPanel3.BeginAnimation(OpacityProperty, DropDownOpacityAnimation);
         StackPanel3.Effect.BeginAnimation(OpacityProperty, DropDownOpacityAnimation);
     }
     StackPanel1.Visibility = Visibility.Hidden;
     StackPanel2.Visibility = Visibility.Hidden;
     StackPanel3.Visibility = Visibility.Visible;
     StackPanel4.Visibility = Visibility.Hidden;
     Rectangle3.BeginAnimation(WidthProperty, BorderAnimation1);
 }
        private void OnDrawGizmos()
        {
            Vector3    point     = Point.position;
            Rectangle3 rectangle = CreateRectangle3(Rectangle);

            Vector3 closestPoint;
            float   dist  = Distance.Point3Rectangle3(ref point, ref rectangle, out closestPoint);
            float   dist1 = Distance.SqrPoint3Rectangle3(ref point, ref rectangle, out closestPoint);
            float   dist2 = rectangle.DistanceTo(point);

            FiguresColor();
            DrawRectangle(ref rectangle);

            ResultsColor();
            DrawPoint(closestPoint);

            LogInfo(dist + " " + Mathf.Sqrt(dist1) + " " + dist2);
        }
コード例 #9
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var compositor = Window.Current.Compositor;

            var rotationAnimation = compositor.CreateScalarKeyFrameAnimation();
            var linear            = compositor.CreateLinearEasingFunction();

            rotationAnimation.InsertKeyFrame(1.0f, 360, linear);
            rotationAnimation.Duration          = TimeSpan.FromSeconds(9);
            rotationAnimation.Target            = nameof(Rectangle1.Rotation);
            rotationAnimation.IterationBehavior = AnimationIterationBehavior.Forever;

            Rectangle1.StartAnimation(rotationAnimation);
            Rectangle3.StartAnimation(rotationAnimation);

            rotationAnimation.Duration = TimeSpan.FromSeconds(8);

            Rectangle2.StartAnimation(rotationAnimation);
            Rectangle4.StartAnimation(rotationAnimation);
        }
コード例 #10
0
        private void OnDrawGizmos()
        {
            Line3      line      = CreateLine3(Line);
            Rectangle3 rectangle = CreateRectangle3(Rectangle);


            Line3Rectangle3Intr info;
            bool find = Intersection.FindLine3Rectangle3(ref line, ref rectangle, out info);

            FiguresColor();
            DrawRectangle(ref rectangle);
            DrawLine(ref line);

            if (find)
            {
                ResultsColor();
                DrawPoint(info.Point);
            }

            LogInfo(info.IntersectionType);
        }
コード例 #11
0
        private void OnDrawGizmos()
        {
            Ray3       ray       = CreateRay3(Ray);
            Rectangle3 rectangle = CreateRectangle3(Rectangle);


            Ray3Rectangle3Intr info;
            bool find = Intersection.FindRay3Rectangle3(ref ray, ref rectangle, out info);

            FiguresColor();
            DrawRectangle(ref rectangle);
            DrawRay(ref ray);

            if (find)
            {
                ResultsColor();
                DrawPoint(info.Point);
            }

            LogInfo(info.IntersectionType);
        }
コード例 #12
0
		private void OnDrawGizmos()
		{
			Segment3 segment = CreateSegment3(P0, P1);
			Rectangle3 rectangle = CreateRectangle3(Rectangle);


			Segment3Rectangle3Intr info;
			bool find = Intersection.FindSegment3Rectangle3(ref segment, ref rectangle, out info);

			FiguresColor();
			DrawRectangle(ref rectangle);
			DrawSegment(ref segment);

			if (find)
			{
				ResultsColor();
				DrawPoint(info.Point);
			}

			LogInfo(info.IntersectionType);
		}
コード例 #13
0
 private void btn4_MouseLeave(object sender, MouseEventArgs e)
 {
     Rectangle3.BeginAnimation(WidthProperty, BorderAnimation2);
 }