public static Multiply ( |
||
left | left matrix | |
right | right matrix | |
Результат |
/// <summary> /// calculate the matrix used to transform 3D to 2D /// </summary> private Matrix4 Compute3DTo2DMatrix() { Matrix4 result = Matrix4.Multiply( m_to2DMatrix.Inverse(), m_moveToCenterMatrix.Inverse()); result = Matrix4.Multiply(result, m_scaleMatrix); return(result); }
/// <summary> /// transform the point on Form to 3d world coordinate of revit /// </summary> /// <param name="ps">contain the points to be transformed</param> private List <Vector4> Transform2DTo3D(Point[] ps) { List <Vector4> result = new List <Vector4>(); TransformPoints(ps); Matrix4 transformMatrix = Matrix4.Multiply( m_scaleMatrix.Inverse(), m_moveToCenterMatrix); transformMatrix = Matrix4.Multiply(transformMatrix, m_to2DMatrix); foreach (Point point in ps) { Vector4 v = new Vector4(point.X, point.Y, 0); v = transformMatrix.Transform(v); result.Add(v); } return(result); }