本文整理汇总了C#中System.IO.BinaryReader.ReadMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.BinaryReader.ReadMatrix方法的具体用法?C# System.IO.BinaryReader.ReadMatrix怎么用?C# System.IO.BinaryReader.ReadMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.BinaryReader
的用法示例。
在下文中一共展示了System.IO.BinaryReader.ReadMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: From3DMAXStream
public static FullAnimation From3DMAXStream(System.IO.Stream stream, SkeletonExtended skeleton, bool reverse)
{
Matrix[][] Frames;
var clip = new FullAnimation();
var reader = new System.IO.BinaryReader(stream);
var start = reader.ReadInt32();
var end = reader.ReadInt32();
var length = end - start + 1;
clip.BonesCount = reader.ReadInt32();
var counter = reader.ReadInt32();
Frames = new Matrix[length][];
for (int i = 0; i < length; i++)
Frames[i] = new Matrix[clip.BonesCount];
for (int i = 0; i < clip.BonesCount; i++)
for (int j = 0; j < length; j++)
Frames[j][i] = reader.ReadMatrix();
//теперь надо вычислить дельты
//(идёт загрузка экспортированного из макса)
for (int i = 0; i < clip.BonesCount; i++)
for (int @in = 0; @in < length; @in++)
Frames[@in][i] = skeleton.baseskelet.bones[i].BaseMatrix * Frames[@in][i];
if (reverse)
{
//Matrix[][] FramesTmp = new Matrix[length][];
Frames = Frames.Reverse().ToArray();
}
Matrix[][] relatedMatrices = Animation.GetRelatedMatrices(Frames, skeleton.baseskelet);
DecomposedMatrix[][] decomposedMatrices = GetDecomposedMatrices(skeleton.baseskelet, relatedMatrices);
clip.matrices = decomposedMatrices;
return clip;
}