编程资料集中营
 | 网站首页 | 文章中心 | 编程资料2 | 软件下载 | BT下载 | 八卦星闻 | 音乐在线 | 在线游戏 | 免费电影 | 进入问吧 | 
托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译),找了很久关于托管的DirectX编的资料实在是很少,无意中发现了这编文章http://www.jkarlsson.com/Articles/loadframes.asp觉得对学习托管的Direct3D学习很有帮助。所以翻译来与大家共享。另外,本人的英语水平有限,翻不好的地方大家不要见怪。欢迎大家指出有误的地方。谢谢。本人QQ:173257128(koy075,
您现在的位置: 编程资料,学习资料,c,c++,vc,vc++,java,jsp,j2ee,j2me,asp,php >> 文章中心 >> .NET 专区 >> NET 技术 >> 文章正文
【字体:
托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)   进入问吧

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

作者:admin    文章来源:本站    点击数:    更新时间:2007-6-10    

托管的 Direct3D之 使用 Frame Hierarchy 创建动画(翻译)

bsp;// First, render all sibling frames at this level passing the parent´s
  // aggregated transformation matrix.
  if(frame.FrameSibling != null)
  {
    this.RenderFrame(frame.FrameSibling, parentTransformationMatrix);
  }

  // Aggregate the transformation matrix to be used for this frame.
  // 1. Apply the frames transformation as specified in the x-file.
  // 2. Apply the custom transformation for this individual frame.
  // 3. Apply the parent´s aggregated transformation matrix.
  Matrix tm =
    frame.TransformationMatrix *
    ((CustomFrame)frame).CustomTransform *
    parentTransformationMatrix;

  // Go on and render the children of this frame, passing the transformation
  // 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);
}

 

对于层次中的每一帧,RenderFrame 方法先传递它的父帧的变换矩阵递归调用它的同层的其它帧。然后再计算它的父帖和自己的变换矩阵来递归调用它的子帧(children)。最后调用DoRender来实现渲染当前场景。

 

 

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]  ... 下一页  >> 

   

进入问吧

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

文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章: 没有了
  • 高级搜索
    编程资料集中营