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

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)
// Event used to perform pre-render operations
public event EventHandler SetupCustomTransform; // Render the frame hierarchy.public bool Render(){ // Allow any event listeners to adjust the custom transformation // matrixes for the individual frames in the hierarchy. if(this.SetupCustomTransform != null) { this.SetupCustomTransform(this, null); } // Begin recusively rendering the frames. // Use the identity matrix as the custom transform for the entire // frame hierarchy. this.RenderFrame(this.rootFrame.FrameHierarchy, Matrix.Identity); return true;}
然后 Render方法继续进行并调用受保护(protected)的建立每一帧的变换矩阵和宣染每一帧的递归方法RenderFrame, RenderFrame方法在参数里获取要渲染的帧和它的父帧的变换矩阵,如果是根帧(rootFrame)我们传达一个单位矩阵。
protected void RenderFrame(Frame frame, Matrix parentTransformationMatrix){ &n
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>
本站地址:http://www.bajiao123.com

