コード例 #1
0
 public override string ToString()
 {
     return(String.Format("X:{0}({1}) Y:{2}({3}) Z:{4}({ColorSpace.Gap})",
                          Point3D.IntToMm(this.x).ToString("##############0.0#"), this.x,
                          Point3D.IntToMm(this.y).ToString("##############0.0#"), this.y,
                          Point3D.IntToMm(this.z).ToString("##############0.0#"), this.z));
 }
コード例 #2
0
        public void Project(RotateCoeffs rotate, Point3D camera)
        {
            double x = Point3D.IntToMm(this.x);
            double y = Point3D.IntToMm(this.y);
            double z = Point3D.IntToMm(this.z);

            x -= Point3D.IntToMm(camera.x);
            y -= Point3D.IntToMm(camera.y);
            z -= Point3D.IntToMm(camera.z);

            if ((rotate.CosX != 1f) && (rotate.SinX != 0f))
            {
                double y0 = y;
                y = (y0 * rotate.CosX) + (z * -rotate.SinX);
                z = (y0 * rotate.SinX) + (z * rotate.CosX);
            }

            if ((rotate.CosY != 1f) && (rotate.SinY != 0f))
            {
                double x0 = x;
                x = (x0 * rotate.CosY) + (z * rotate.SinY);
                z = (x0 * -rotate.SinY) + (z * rotate.CosY);
            }

            if ((rotate.CosZ != 1f) && (rotate.SinZ != 0f))
            {
                double x0 = x;
                x = (x0 * rotate.CosZ) + (y * -rotate.SinZ);
                y = (x0 * rotate.SinZ) + (y * rotate.CosZ);
            }

            this.x = Point3D.MmToInt(x);
            this.y = Point3D.MmToInt(y);
            this.z = Point3D.MmToInt(z);
        }
コード例 #3
0
        public void ApplyViewer(Point3D viewer)
        {
            double x = Point3D.IntToMm(this.x);
            double y = Point3D.IntToMm(this.y);
            double z = Point3D.IntToMm(this.z);

            double ex = Point3D.IntToMm(viewer.x);
            double ey = Point3D.IntToMm(viewer.y);
            double ez = Point3D.IntToMm(viewer.z);

            x = (x - ex) * (ez / z);
            y = (y - ey) * (ez / z);

            this.x = Point3D.MmToInt(x);
            this.y = Point3D.MmToInt(y);
            this.z = Point3D.MmToInt(z);
        }
コード例 #4
0
 public override string ToString()
 {
     return(String.Format("{0} X:{1} Y:{1}", this.Type,
                          Point3D.IntToMm(this.X).ToString("#########0.0##"),
                          Point3D.IntToMm(this.Y).ToString("#########0.0##")));
 }