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

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)
protected void DoRender(Frame frame, Matrix m){ this.device.Transform.World = m; ExtendedMaterial[] em = frame.MeshContainer.GetMaterials(); Texture[] t = ((CustomMeshContainer)(frame.MeshContainer)).Textures; for(int i=0; i < em.Length; i++) { this.device.Material = em[i].Material3D; if(t[i] != null) { this.device.SetTexture(0, t[i]); } frame.MeshContainer.MeshData.Mesh.DrawSubset(i); }}
如果我还要对帧层次中的个别帧进行转换。我们需要一上保存帧的方法。所以我们就增加了一个由帧的名字返回一个帧的函数GetFrame.
// 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);}
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>
本站地址:http://www.bajiao123.com

