Esempio n. 1
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);
        }
Esempio n. 2
0
 public void Project(RotateCoeffs rotate, Point3D camera)
 {
     if (this.points == null)
         return;
     for (int i = 0; i < this.points.Length; i++)
         this.points[i].Project(rotate, camera);
 }
Esempio n. 3
0
        public void Project(int x, int y, int z, Point3D camera)
        {
            RotateCoeffs c = new RotateCoeffs();

            c.Assign(x, y, z);
            for (int i = 0; i < this.Count; i++)
            {
                this[i].Project(c, camera);
            }
        }
Esempio n. 4
0
        public static RotateCoeffs Empty()
        {
            RotateCoeffs c = new RotateCoeffs();

            c.sinX = 0f;
            c.cosX = 1f;
            c.sinY = 0f;
            c.cosY = 1f;
            c.sinZ = 0f;
            c.cosZ = 1f;
            return(c);
        }