Exemple #1
0
        static public PointXYZ Move(PointXYZ p, float dx, float dy, float dz)
        {
            float[,] T = new float[, ] {
                { 1, 0, 0, 0 },
                { 0, 1, 0, 0 },
                { 0, 0, 1, 0 },
                { dx, dy, dz, 1 }
            };

            AT.MatrixMul(p, T);
            return(p);
        }
Exemple #2
0
        static public void Scaling(PointXYZ p, float kx, float ky, float kz)
        {
            float[,] scale_matrix =
            {
                { kx,  0,  0, 0 },
                {  0, ky,  0, 0 },
                {  0,  0, kz, 0 },
                {  0,  0,  0, 1 }
            };

            AT.MatrixMul(p, scale_matrix);
        }
Exemple #3
0
        static public void RotateZ(PointXYZ p, double angle)
        {
            double rangle = Math.PI * angle / 180;
            float  sin    = (float)Math.Sin(rangle);
            float  cos    = (float)Math.Cos(rangle);

            float[,] rotation_matrix =
            {
                { cos,  sin, 0, 0 },
                { -sin, cos, 0, 0 },
                {    0,   0, 1, 0 },
                {    0,   0, 0, 1 }
            };
            AT.MatrixMul(p, rotation_matrix);
        }