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

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)
// we just aggregated. if(frame.FrameFirstChild != null) { this.RenderFrame(frame.FrameFirstChild, tm); } // TODO: Adjust for the possibility of a mesh container hierarchy. // Perform the actual rendering for this frame. if(frame.MeshContainer != null) this.DoRender(frame, tm); } 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); } } } public class Tank : GraphicsObject { protected float turretAngle = 0.0F; protected float bearing = 0.0F; protected Vector3 position = new Vector3(0,0,0); protected flo << 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>
本站地址:http://www.bajiao123.com

