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

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)
public class GraphicsObject { // Path to the x-file containing the frame hierarchy for this GO. protected string xFilePath; // Container for the frames protected AnimationRootFrame rootFrame; // The device for the scene protected Device device; // Event used to perform pre-render operations public event EventHandler SetupCustomTransform; public GraphicsObject(string xFilePath, Device device) { this.xFilePath = xFilePath; this.device = device; } // Allow caller to get a hold of a named frame within the // frame hierarchy. public CustomFrame GetFrame(string name) { return (CustomFrame)Frame.Find(this.rootFrame.FrameHierarchy, name); } // Load the frame hierarchy from file. public virtual void Initialize() { this.rootFrame = Mesh.LoadHierarchyFromFile(this.xFilePath, MeshFlags.Managed, this.device, new CustomAllocateHierarchy(this.xFilePath), // AllocateHierarchy null); // LoadUserData } // Render the frame hierarchy. public bool Render() { // Allow any event listeners to adjust the custom tran << 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>
本站地址:http://www.bajiao123.com

