
本站地址:http://www.bajiao123.com

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)
我们需要用一些代码来获取一个DirectX文件和创建帧层次(Frame Hiearchy)来存储我们的AnimationRootFrame 对象。我们使用静态方法Mesh.LoadHierachyFromFile 来帮助我们实现上面的功能。这个方法需要我们定义类来实现真正的分配类层次中每部份的操作。我们需要继承抽象类,AllocateHierarchy , Frame和MeshContainer。
以下所示是我们这个类的第一个版本:
public class GraphicsObject{ // Path to the x-file containing the frame hierarchy for this class. protected string xFilePath; // Container for the frames protected AnimationRootFrame rootFrame; public GraphicsObject(string xFilePath, Device device) { this.xFilePath = xFilePath; this.device = device; } // Load the frame hierarchy from file. public virtual void Initialize() { this.rootFrame = Mesh.LoadHierarchyFromFile(this.xFilePath, MeshFlags.Managed, this.device, new CustomAllocateHierarchy(this.xFilePath), null); }}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
本站地址:http://www.bajiao123.com

