public static List <Math3D.Line3D> Translate(List <Math3D.Line3D> lines, Math3D.Point3D oldOrigin, Math3D.Point3D newOrigin)
 {
     for (int i = 0; i < lines.Count; i++)
     {
         lines[i] = Math3D.Translate(lines[i], oldOrigin, newOrigin);
     }
     return(lines);
 }
Exemple #2
0
        public Bitmap Draw(Bitmap img)
        {
            Graphics g      = Graphics.FromImage(img);
            var      point0 = new Point(Ox, Oy);

            if (Ox != int.MinValue)
            {
                var    degrees  = 170;
                double cDegrees = Math.PI * degrees / 180.0;
                var    x        = (Ox - Math.Cos(cDegrees) * img.Width / 2);
                var    y        = (Oy + Math.Sin(cDegrees) * img.Height / 2);
                var    point1   = new Point((int)x, (int)y);
                g.DrawLine(Pens.Black, point0, point1);
                g    = DrawString(g, "X", new Point(point1.X - 16, point1.Y - 32));
                Ox3D = new Math3D.Point3D(x, y, 0);
            }

            if (Oy != int.MinValue)
            {
                var    degrees  = 10;
                double cDegrees = Math.PI * degrees / 180.0;
                var    x        = (Ox - Math.Cos(cDegrees) * img.Width / 2);
                var    y        = (Oy + Math.Sin(cDegrees) * img.Height / 2);
                var    point1   = new Point((int)x, (int)y);
                g.DrawLine(Pens.Black, point0, point1);
                g    = DrawString(g, "Z", new Point(point1.X, point1.Y - 32));
                Oy3D = new Math3D.Point3D(x, y, 0);
            }

            if (Oz != int.MinValue)
            {
                var point1 = new Point(Ox, Oy - img.Height / 2);
                g.DrawLine(Pens.Black, point0, point1);
                g    = DrawString(g, "Y", new Point(point1.X - 16, point1.Y));
                Oz3D = new Math3D.Point3D(0, 0, 10);
            }
            return(img);
        }
Exemple #3
0
 public Cords(Math3D.Point3D point)
 {
     Ox = point.X;
     Oy = point.Y;
     Oz = point.Z;
 }
Exemple #4
0
 public Line3D(Math3D.Point3D point1, Math3D.Point3D point2)
 {
     Point1 = point1;
     Point2 = point2;
 }
Exemple #5
0
 public static Surface Translate(Surface surface, Math3D.Point3D oldOrigin, Math3D.Point3D newOrigin)
 {
     surface.points = Math3D.Translate(surface.points, oldOrigin, newOrigin);
     return(surface);
 }