Пример #1
0
        public void Show(Vector3 Start, Draw3d D, Color Col, float W)
        {
            if (X != 0 || Y != 0 || Z != 0)
            {
                double  S = 5;
                Vector3 V = new Vector3(this) + Start;
                Vector3 X = new Vector3(this);
                X.Norm();
                Vector3 Y = Cross(X, new Vector3(0, 0, 1));
                Vector3 Z = Cross(X, Y);
                if (Y.Equals(Z))
                {
                    Y = new Vector3(0, 1, 0);
                    Z = new Vector3(1, 0, 0);
                }
                X *= S * 2;
                Y.Norm();
                Z.Norm();
                Y *= S;
                Z *= S;
                D.Polygons.Add(new Polygon(D.CMult(Col, 0.9), new Vector3[] { V - X + Y + Z, V - X + Y - Z, V - X - Y - Z, V - X - Y + Z }));
                D.Polygons.Add(new Polygon(D.CMult(Col, 0.8), new Vector3[] { V, V - X + Y + Z, V - X + Y - Z }));
                D.Polygons.Add(new Polygon(D.CMult(Col, 0.7), new Vector3[] { V, V - X + Y + Z, V - X - Y + Z }));
                D.Polygons.Add(new Polygon(D.CMult(Col, 0.8), new Vector3[] { V, V - X - Y + Z, V - X - Y - Z }));
                D.Polygons.Add(new Polygon(D.CMult(Col, 0.7), new Vector3[] { V, V - X + Y - Z, V - X - Y - Z }));

                D.addLine(Col, W, Start, V - X);
            }
        }
Пример #2
0
        public Draw(Graphics Graphics, SizeF Size)
        {
            SF.Alignment     = StringAlignment.Center;
            SF.LineAlignment = StringAlignment.Center;
            this.Graphics    = Graphics;
            this.Size        = Size;
            Draw3D           = new Draw3d
            {
                Pos  = new Point(0, 100),
                Size = Rect3D.Size
            };

            Bm = new Bitmap(Draw3D.Size.Width, Draw3D.Size.Height);

            Draw3D.Graphics = Graphics.FromImage(Bm);


            //Draw3D.Graphics.Clip = new Region(new Rectangle(Draw3D.Pos,Draw3D.Size));
            Draw3D.CameraDist = 700;
            //SelectedElements = new List<GuiElement>() {BlindButton,LockButton,EyeLinesButton };
            FamilyButton.ButtonEvent = FamilyPress;
            Elements = new List <GuiElement>()
            {
                SpeedText, SpeedAdd, SpeedSub
            };
            SpeedAdd.ButtonEvent = SpeedAddPress;
            SpeedSub.ButtonEvent = SpeedSubPress;
            //BlindButton.ButtonEvent = BlindButtonEvent;
            //LockButton.ButtonEvent = LockButtonEvent;
            //EyeLinesButton.ButtonEvent = EyeLinesButtonEvent;
        }
Пример #3
0
                public void Show3d(Draw3d D3)
                {
                    float   Radius = SizeScale3d * this.Radius / SizeScale2d;
                    Vector3 V      = new Vector3(Radius, Radius, Radius);

                    Polygon[] Polys = D3.getCuboid(Col, Leaf.Center * SizeScale3d - V, Leaf.Center * SizeScale3d + V);
                    D3.Polygons.AddRange(Polys);
                }
Пример #4
0
 public void Show3D(Draw3d D, Vector3 Sun)
 {
     foreach (var I in Branches)
     {
         I.Show3D(D, Sun);
     }
     foreach (var I in Leaves)
     {
         I.Show3D(D);
         //(Sun * 15*5).Show(I.Center*15,D,Color.Orange,3);
     }
     D.addLine(Tree.BranchColor, Width * SizeScale3d, Base * SizeScale3d, Tip * SizeScale3d);
 }
Пример #5
0
 public void Show3D(Draw3d D)
 {
     Vector3[] Points = new Vector3[] { Base *SizeScale3d, Tip1 *SizeScale3d, Tip2 *SizeScale3d };
     Polygon   P      = new Polygon(Col, Points);
     D.Polygons.Add(P);
     if (CurrentSeed != null)
     {
         float     Radius = SizeScale3d * CurrentSeed.Radius / SizeScale2d;
         Vector3   V      = new Vector3(Radius, Radius, Radius);
         Polygon[] Polys  = D.getCuboid(CurrentSeed.Col, Center * SizeScale3d - V, Center * SizeScale3d + V);
         D.Polygons.AddRange(Polys);
     }
     if (CurrentFlower != null)
     {
         CurrentFlower.Show3d(D);
     }
 }
Пример #6
0
 public void ShowSelected(Draw D, Draw3d D3)
 {
     Root.Show3D(D3, Sun);
 }