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); } }
public PointF[] ProjectZX() { return(ProjectionAffinity.projectionXZ(polygons)); }