Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            Normalize.WinHeight = isometrixBox.ClientSize.Height;
            Normalize.WinWidth  = isometrixBox.ClientSize.Width;

            //Base
            PointF3D base1 = new PointF3D(2, 0, 0);
            PointF3D base2 = new PointF3D(0, 0, 5);
            PointF3D base3 = new PointF3D(15f, 0, 8f);
            //Height
            PointF3D height = new PointF3D(2, 10, 0);

            DefaultPyramid = new Polygon3D[]
            {
                //base
                new Polygon3D(new PointF3D[] { base1, base2, base3 }),
                //connections lines to the height
                new Polygon3D(new PointF3D[] { base1, height }),
                new Polygon3D(new PointF3D[] { base2, height }),
                new Polygon3D(new PointF3D[] { base3, height }),
                //height
                new Polygon3D(new PointF3D[] { height, height }),
            };
            pyramid = (Polygon3D[])DefaultPyramid.Clone();

            DefaultObjCentre = new PointF3D(2, 0, 2);
            objCentre        = DefaultObjCentre;
            surfaceCentre    = DefaultSurfaceCentre;


            DefaultTransformVals();
            PointF[] IzometricAxes = ProjectionAffinity.projectionIsometric(coordinateLines);
            PointF[] XYAxes        = ProjectionAffinity.projectionXY(coordinateLines);
            PointF[] XZAxes        = ProjectionAffinity.projectionXZ(coordinateLines);
            PointF[] YZAxes        = ProjectionAffinity.projectionYZ(coordinateLines);
            normalizedIzometricAxes = new PointF[IzometricAxes.Length];
            normalizedXYAxes        = new PointF[XYAxes.Length];
            normalizedXZAxes        = new PointF[XZAxes.Length];
            normalizedYZAxes        = new PointF[YZAxes.Length];

            for (int i = 0; i < coordinateLines.Length; i++)
            {
                normalizedIzometricAxes[i].X = Normalize.NormalizeX(IzometricAxes[i].X);
                normalizedIzometricAxes[i].Y = Normalize.NormalizeY(IzometricAxes[i].Y);
                normalizedXYAxes[i].X        = Normalize.NormalizeX(XYAxes[i].X);
                normalizedXYAxes[i].Y        = Normalize.NormalizeY(XYAxes[i].Y);
                normalizedXZAxes[i].X        = Normalize.NormalizeX(XZAxes[i].X);
                normalizedXZAxes[i].Y        = Normalize.NormalizeY(XZAxes[i].Y);
                normalizedYZAxes[i].X        = Normalize.NormalizeX(YZAxes[i].X);
                normalizedYZAxes[i].Y        = Normalize.NormalizeY(YZAxes[i].Y);
            }
        }
Ejemplo n.º 2
0
 public PointF3D[] Scale(PointF3D ScalVal, PointF3D ScalCentre)
 {
     return(ProjectionAffinity.Scale3D(polygons, ScalVal.X, ScalVal.Y, ScalVal.Z, ScalCentre));
 }
Ejemplo n.º 3
0
 public PointF3D[] RotateZ(float Angle, PointF3D RotCentre)
 {
     return(ProjectionAffinity.RotateZ3D(polygons, Angle, RotCentre));
 }
Ejemplo n.º 4
0
 public PointF3D[] Translate(PointF3D translation)
 {
     return(ProjectionAffinity.Translate3D(polygons, translation.X, translation.Y, translation.Z));
 }
Ejemplo n.º 5
0
 public PointF[] ProjectZX()
 {
     return(ProjectionAffinity.projectionXZ(polygons));
 }
Ejemplo n.º 6
0
 public PointF[] ProjectIsometric()
 {
     return(ProjectionAffinity.projectionIsometric(polygons));
 }