public override void Translate(float Ox, float Oy, float Oz) { float[] p1 = LightPos; _Affine tran = new _Affine(); tran.Translate(Ox, Oy, Oz); p1 = tran.ConvertPoint(p1); _Math3D.CopyMatrix(LightPos, p1); ChangeMatrix(); }
// Quay quanh truc bat ky public void Rotate(float angle, _Vector3D p0, _Vector3D p1) { _Vector3D v = p1 - p0; _Affine tran1 = new _Affine(); _Affine rot = new _Affine(); _Affine tran2 = new _Affine(); tran1.Translate(-p0.x, -p0.y, -p0.z); rot.Rotate(angle, v); tran2.Translate(p0.x, p0.y, p0.z); _Affine temp = tran1 + rot + tran2; _Math3D.CopyMatrix(mMatrix, temp.mMatrix); }
public override void Translate(float Ox, float Oy, float Oz) { float[] p1 = new float[3] { pBegin.x, pBegin.y, pBegin.z }; float[] p2 = new float[3] { pEnd.x, pEnd.y, pEnd.z }; _Affine tran = new _Affine(); tran.Translate(Ox, Oy, Oz); p1 = tran.ConvertPoint(p1); p2 = tran.ConvertPoint(p2); mBegin = new _Vector3D(p1); mEnd = new _Vector3D(p2); ChangeMatrix(); }