本文整理汇总了C#中System.Matrix4d.Invert方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix4d.Invert方法的具体用法?C# Matrix4d.Invert怎么用?C# Matrix4d.Invert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Matrix4d
的用法示例。
在下文中一共展示了Matrix4d.Invert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertChild
/// <summary>
/// Inserts one new child node to this parent node.
/// </summary>
/// <param name="ch">Child node to add.</param>
/// <param name="toParent">Transform from local space of the child to the parent's space.</param>
public virtual void InsertChild( ISceneNode ch, Matrix4d toParent )
{
children.AddLast( ch );
ch.ToParent = toParent;
toParent.Invert();
ch.FromParent = toParent;
ch.Parent = this;
}
示例2: Complete
/// <summary>
/// Complete non-mandatory (deferred) values in the Intersection instance.
/// </summary>
public void Complete()
{
if ( Solid != null )
{
// world coordinates:
LocalToWorld = Solid.ToWorld();
WorldToLocal = LocalToWorld;
WorldToLocal.Invert();
Vector3d.TransformPosition( ref CoordLocal, ref LocalToWorld, out CoordWorld );
// object coordinates:
LocalToObject = Solid.ToObject();
Vector3d.TransformPosition( ref CoordLocal, ref LocalToObject, out CoordObject );
// appearance:
ReflectanceModel = (IReflectanceModel)Solid.GetAttribute( PropertyName.REFLECTANCE_MODEL );
if ( ReflectanceModel == null )
ReflectanceModel = new PhongModel();
Material = (IMaterial)Solid.GetAttribute( PropertyName.MATERIAL );
if ( Material == null )
Material = ReflectanceModel.DefaultMaterial();
double[] col = (double[])Solid.GetAttribute( PropertyName.COLOR );
SurfaceColor = (double[])((col != null) ? col.Clone() : Material.Color.Clone());
Textures = Solid.GetTextures();
// Solid is responsible for completing remaining values:
Solid.CompleteIntersection( this );
Normal.Normalize();
if ( Enter != Front )
Vector3d.Multiply( ref Normal, -1.0, out Normal );
}
if ( SurfaceColor == null )
SurfaceColor = new double[] { 0.0, 0.2, 0.3 };
}