本文整理汇总了C#中System.Windows.Media.Media3D.Matrix3D.ToVTKTransformation方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3D.ToVTKTransformation方法的具体用法?C# Matrix3D.ToVTKTransformation怎么用?C# Matrix3D.ToVTKTransformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.Matrix3D
的用法示例。
在下文中一共展示了Matrix3D.ToVTKTransformation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadFromXMLNode
public virtual void ReadFromXMLNode(XmlNode node)
{
// Read the origin node
XmlNode originNode = node.SelectSingleNode(ModelXMLDefinition.pipeUCSOrigin);
CPoint3D origin = CPoint3DSerializer.ReadPoint(originNode);
// Read the x axis
XmlNode xAxisNode = node.SelectSingleNode(ModelXMLDefinition.pipeUCSXAxis);
CPoint3D xAxis = CPoint3DSerializer.ReadPoint(xAxisNode);
// Read the x axis
XmlNode yAxisNode = node.SelectSingleNode(ModelXMLDefinition.pipeUCSYAxis);
CPoint3D yAxis = CPoint3DSerializer.ReadPoint(yAxisNode); ;
// Calculate the UCS
Vector3D vecX = new Vector3D(xAxis.X, xAxis.Y, xAxis.Z);
vecX.Normalize();
Vector3D vecY = new Vector3D(yAxis.X, yAxis.Y, yAxis.Z);
vecY.Normalize();
// Get the z axis
Vector3D vecZ = Vector3D.CrossProduct(vecX, vecY);
// Recalculate the y axis since yaxis may not be preh to xaxis.
vecY = Vector3D.CrossProduct(vecZ, vecX);
// Create matrix3d representation
m_matrix3d = new Matrix3D(vecX.X, vecX.Y, vecX.Z, 0,
vecY.X, vecY.Y, vecY.Z, 0,
vecZ.X, vecZ.Y, vecZ.Z, 0,
origin.X, origin.Y, origin.Z, 1.0);
m_matrix3dInvert = new Matrix3D(vecX.X, vecX.Y, vecX.Z, 0,
vecY.X, vecY.Y, vecY.Z, 0,
vecZ.X, vecZ.Y, vecZ.Z, 0,
origin.X, origin.Y, origin.Z, 1.0);
m_matrix3dInvert.Invert();
// Set transform
m_tranform = m_matrix3d.ToVTKTransformation();
m_tranformInvert.DeepCopy(m_tranform);
m_tranformInvert.Inverse();
}