Пример #1
0
        public OrbitPanel()
        {
            this.DoubleBuffered = true;

            PlanetPos    = new Xyz[9];
            OrbitDisplay = new bool[11];
            PlanetOrbit  = new PlanetOrbit[9];

            Offscreen    = null;
            PaintEnabled = false;
        }
Пример #2
0
        private void DrawPlanetOrbit(Graphics graphics, PlanetOrbit planetOrbit, Color colorUpper, Color colorLower)
        {
            Pen   pen = new Pen(colorUpper);
            Point point1, point2;
            Xyz   xyz = planetOrbit.GetAt(0).Rotate(MtxToEcl).Rotate(MtxRotate);

            point1 = GetDrawPoint(xyz);

            for (int i = 1; i <= planetOrbit.Division; i++)
            {
                xyz = planetOrbit.GetAt(i).Rotate(MtxToEcl);

                pen.Color = xyz.Z >= 0.0 ? colorUpper : colorLower;

                xyz    = xyz.Rotate(MtxRotate);
                point2 = GetDrawPoint(xyz);
                graphics.DrawLine(pen, point1.X, point1.Y, point2.X, point2.Y);
                point1 = point2;
            }
        }