public void Scaling(float kx, float ky, float kz) { for (int i = 0; i < Points.Count; i++) { AT.Scaling(Points[i], kx, ky, kz); } UpdateCenter(); }
public void RotateZ(double angle) { for (int i = 0; i < Points.Count; i++) { AT.RotateZ(Points[i], angle); } UpdateCenter(); }
public void Move(float dx, float dy, float dz) { for (int i = 0; i < Points.Count; i++) { AT.Move(Points[i], dx, dy, dz); } UpdateCenter(); }
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); }
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); }
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); }