<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feeds.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feeds.feedsky.com/csdn.net/n5" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feeds.feedsky.com/csdn.net/n5" type="application/rss+xml"></fs:self_link><lastBuildDate>Sun, 21 Jun 2009 21:54:00 GMT</lastBuildDate><title>Mobile game developement</title><link>http://blog.csdn.net/n5/</link><item><title>RGBA模式人物换色的实现</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287382.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287382.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287382.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287382</trackback:ping><description>&lt;br /&gt;早期的即时战略游戏，如星际争霸，采用调色板模式，因而可以很方便的通过修改人物图片的调色板索引，达到换色的效果。在RGBA模式下，修改顶点色或设置材质自发光皆不能达到满意的效果，因为我们需要的是像素级别的颜色调整，和多边形无关，即便可以通过细分材质，那也很勉强，况且会增加材质数量影响性能。所以我经过研究，觉得唯一的方法还是改变纹理。（欢迎有人提供更好的方法，这也是我发表这个文章的目的）那么怎么改变纹理呢？法宝是HSV。纹理的像素值是在RGBA颜色空间的，而换色的效果其实是改变色相，也就是HSV颜色空间的H。所以先把像素从RGB变换到HSV,修改H达到换色效果，再变换回RGB,然后用改变后的像素位图生成新的纹理并替换。RGB,HSV转换的算法网上就有。有个问题是，修改H后传入HSV2RGB之前要先确保H的范围正确，或者算法中必须处理。另一个重要的问题是怎么确定哪些部分需要换成哪些颜色，一个很原始但有效的方法就是使用mask图。&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287382.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644720/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287382.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644720/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644720/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:54:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287382.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287382.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287382.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644720/1153028</fs:itemid></item><item><title>3D几何流水线之模型变换</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287375.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287375.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287375.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287375</trackback:ping><description>&lt;br /&gt;参考书：Real-time Rendering 2nd, 《3D游戏与计算机图形学中的数学方法》&lt;br /&gt;&lt;br /&gt;
最初，物体在模型空间中，通过模型变换改变了物体的位置和朝向，物体被变换到世界空间。&lt;br /&gt;&lt;br /&gt;
按照变换顺序，应该先旋转后平移，对于opengl的规则，是TR X V。&lt;br /&gt;
矩阵T,R都是4X4的，T中只有第4列有效，其他是单位阵的排列，R中是前3X3子阵有效，其他是单位阵排列，将TR相乘：&lt;br /&gt;&lt;br /&gt;
| 1 0 0 Tx |     | Ux Vx Nx 0 |      | Ux Vx Nx Tx |&lt;br /&gt;
| 0 1 0 Ty |  X | Uy Vy Ny 0 |  =  | Uy Vy Ny Ty |&lt;br /&gt;
| 0 0 1 Tz |     | Uz Vz Nz 0 |      | Uz Vz Nz Tz |&lt;br /&gt;
| 0 0 0 1   |     | 0   0   0   1 |      | 0    0   0    1  |&lt;br /&gt;&lt;br /&gt;
可
见，在最&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287375.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644721/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287375.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644721/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644721/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:52:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287375.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287375.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287375.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644721/1153028</fs:itemid></item><item><title>ZBuffer裁剪planar shadow</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287368.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287368.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287368.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287368</trackback:ping><description>&lt;br /&gt;适当的操作ZBuffer可以巧妙的完成一些任务，比如我要在擂台的边缘裁剪人的影子。擂台的特点是边缘之外的地方比较低。将影子埋在擂台表面下一点点，
先绘制擂台，然后改变z test func,改为greater,并关闭z
write,然后绘制影子，因为影子是在擂台下面的，这样从擂台上方看，影子具有比擂台表面更大的z值，opengl中z值大意味着离camera远，按
照正常的z测试方法，GL_LESS或GL_LEQUAL通过测试，这样影子应该画不出来，而如果将z test
func设为GL_GREATER,离camera远的影子反而绘制在擂台表面上了。而在擂台的边缘，因为擂台外的像素会比影子更低，影子的z会比较小，
不能通过GL_GREATER的测试，这样擂台边缘外的影子片段就不能绘制了，也就达到了裁剪的目的。同时由于绘制影子时关闭了z
write,影子的z值不会被写入，也就意味着影子之后绘制的东西能挡住影子，比如人总能踩住影子。之后恢复正常的z test并打开z
write，绘制人和其他物体。&lt;br /&gt;
当然这个方法也并不完美，比如镜头前的物体会挡住影子，影&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287368.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644722/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287368.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644722/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644722/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:51:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287368.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287368.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287368.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644722/1153028</fs:itemid></item><item><title>opengl粒子系统的渲染方式</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287361.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287361.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287361.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287361</trackback:ping><description>&lt;br /&gt;原来一直以为，只有当前颜色alpha&lt;br /&gt;&lt;br /&gt;
使用的混合函数为glBlendFunc( GL_SRC_ALPHA, GL_ONE );也有类似alpha通道的效果。&lt;br /&gt;
复习一下blend的公式：&lt;br /&gt;
源颜色是（Rs,Gs,Bs,As）,源混合因子是（Sr,Sg,Sb,Sa）,目的颜色是（Rd,Gd,Bd,Ad）,目的混合因子是（Dr,Dg,Db,Da），而默认的混合计算是加法&lt;br /&gt;
那么最终混合后的片段颜色是 （RsSr+RdDr, GsSg+GdDg, BsSb+BdDb, AsSa+AdDa)&lt;br /&gt;&lt;br /&gt;
GL_SRC_ALPHA代表的RGBA混合因子是(As,As,As,As),因为我这张纹理是24bitRGB的，没有alpha通道，所以As=1&lt;br /&gt;
GL_ONE的代表RGBA混合因子是(1,1,1,1)&lt;br /&gt;&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287361.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644723/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287361.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644723/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644723/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:50:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287361.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287361.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287361.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644723/1153028</fs:itemid></item><item><title>lens flare:镜头光晕</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287359.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287359.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287359.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287359</trackback:ping><description>&lt;br /&gt;最近的又一个工作是给游戏添加镜头光晕，google一下，gamedev上就有一个很好的教程，最简单的方法是：将太阳位置投影到屏幕空间，如果不在屏
幕内就不画，否则从太阳位置向屏幕中心画出一系列的光晕贴图，混合方法还是src:srcalpha,dest:one。可完全当做2d图片进行绘制。&lt;br /&gt;&lt;br /&gt;
我
使用irrlicht引擎，就有一个小问题了，如果当做2d图片绘制就必须改变camera,设置一个平行透视的camera，这样也不是不行，但是为了
统一，我给lens flare写了一个custom scene
node，这样就必须用3d方法绘制，其实就是一个billboard而以，参考下irrlicht中的billboard实现，计算出hor和ver偏
移向量，即可从中心位置构造四边形的边。至于flare的3d位置的获得，首先是计算出屏幕坐标（根据在序列上的位置），然后利用irr提供的射线方法从
屏幕空间反投影到3d空间，z值的确定我根据太阳的位置求出一个缩放值，这样保证反投影后太阳还是在原来的3d位置上。这么搞貌似比直接用2d的方法有些
麻烦了&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287359.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644724/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287359.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644724/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644724/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:49:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287359.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287359.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287359.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644724/1153028</fs:itemid></item><item><title>OpenGL clip plane会受modle-view matrix影响</title><link>http://blog.csdn.net/n5/archive/2009/06/21/4287357.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4287357.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4287357.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4287357</trackback:ping><description>&lt;br /&gt;From the red book: OpenGL implementations often must compute the 
inverse of the modelview matrix so that normals and clipping planes can 
be correctly transformed to eye coordinates.&lt;br /&gt;&lt;br /&gt;
From google: When you call glClipPlane, equation is transformed by the inverse of
the modelview matrix and stored in the resulting eye coordinates.
Subsequent changes to the modelview matrix have no effect on the stored
plane-equation components.&lt;br /&gt;&lt;br /&gt;
即，
调用glClipPlane时，会使用当前的modle-v&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4287357.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644725/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/21/4287357.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644725/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644725/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 22 Jun 2009 05:48:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/21/4287357.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/21/4287357.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/21/4287357.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644725/1153028</fs:itemid></item><item><title>成为优秀的程序员真不简单</title><link>http://blog.csdn.net/n5/archive/2009/06/13/4267306.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4267306.aspx</wfw:comment><slash:comments>97</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4267306.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4267306</trackback:ping><description>&lt;br /&gt;真正精通一门语言，特别是c++这样的复杂语言，不简单。&lt;br /&gt;况且可能需要熟悉3，4种语言，而且要防止惯性的干扰，不简单。&lt;br /&gt;精通数据结构和算法以及优化，正确分析选择问题所需要的数据结构和算法，不简单。&lt;br /&gt;熟悉自己工作的平台的方方面面，从硬件到操作系统到编译器到各种开发库，不简单。&lt;br /&gt;能实用的运用设计模式去设计软件，系统结构清晰合理，开发高效，易维护，不简单。&lt;br /&gt;编写的代码就像艺术品，增一行则多，减一行则少，不简单。&lt;br /&gt;懂得重构，善用重构，追求完美但不超预算，不简单。&lt;br /&gt;和伙伴合作流畅，工作开心少加班，不简单。&lt;br /&gt;拥有快速学习能力，迅速熟悉新领域，不简单。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;而做一个游戏程序员，就更不简单了：&lt;br /&gt;&lt;br /&gt;精通必要的数学和物理知识并能实用，不简单&lt;br /&gt;精通图形学原理和具体3D算法，不简单&lt;br /&gt;知道算法还不行，能在具体的项目中活学活用，不简单&lt;br /&gt;理念要先进，追求一流的开发效率，开发出一流的工具帮助美术策划提高效率，不简单&lt;br /&gt;熟悉美术所用的工具&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4267306.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/236644726/n5/csdn.net/s.gif?r=http://blog.csdn.net/n5/archive/2009/06/13/4267306.aspx&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644726/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644726/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sun, 14 Jun 2009 07:51:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/06/13/4267306.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/06/13/4267306.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/06/13/4267306.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644726/1153028</fs:itemid></item><item><title>在游戏中使用面向对象的FSM</title><link>http://blog.csdn.net/n5/archive/2009/05/09/4163710.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4163710.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4163710.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4163710</trackback:ping><description>&lt;br /&gt;在游戏中使用面向对象的FSM&lt;br /&gt;&lt;br /&gt;以前一直是用switch的状态机，因为J2ME没办法用太多类，现在改做c++了，终于可以试一试面向对象的状态机了，代码果然简洁了好多。参考的是《Programming Game AI by Example》第2章，大约改了下。首先要定义一个状态基类：&lt;br /&gt;&lt;br /&gt;template 
class State
{
public:
    State(){}
    virtual ~State(){}
    //executed when entity enter this state
    virtual void OnEnter(entity_type*) = 0;
    //entity update this state
    virtual void Update(entity_type*, float dt) = 0;
    //entity render in this state
    virtual void Render(en&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4163710.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644727/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644727/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sun, 10 May 2009 01:27:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/05/09/4163710.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/05/09/4163710.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/05/09/4163710.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644727/1153028</fs:itemid></item><item><title>lyo blog3D文章集锦</title><link>http://blog.csdn.net/n5/archive/2009/04/07/4053311.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/4053311.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/4053311.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=4053311</trackback:ping><description>lyo blog关闭了，好文章做个备份--------------------------------------- Skinned Mesh in M3GFiled under: ProgrammingSkinned Mesh，就是根据skeleton去变换顶点，通过addTransform函数将Vertex和bone绑定，Specification中给出了计算式子：Denote the set of nodes (bones) associated with a vertex by { N1, N2, …, NN }. Denote by Mi the transformation from the local coordinate system of node Nito a reference coordinate system. The choice of the reference coordinate system is not critical; depending on the impl&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/4053311.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644728/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644728/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 07 Apr 2009 17:27:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/04/07/4053311.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/04/07/4053311.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/04/07/4053311.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644728/1153028</fs:itemid></item><item><title>wxGlade &amp; wxFormBuilder</title><link>http://blog.csdn.net/n5/archive/2009/03/08/3968504.aspx</link><wfw:comment>http://blog.csdn.net/n5/comments/3968504.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/n5/comments/commentRss/3968504.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3968504</trackback:ping><description>&lt;br /&gt;最近在使用wxPython写一个编辑器，做界面使用了wxGlade，以前我只用过wxWidgets+wxFormBuilder的组合，感觉wxPython+wxGlade确实效率更高些，当然这受益于python语言的简洁易用。&lt;br /&gt;&lt;br /&gt;几点使用体会：&lt;br /&gt;&lt;br /&gt;1）wxGlade自动生成的代码可以和自己写的代码和平共处。在使用wxFormBuilder时，除了生成界面代码，还要生成派生类代码，这样界面代码不需要做任何修改，自己的代码直接写在派生类中。这种方法比较面向对象了，但是缺点是派生类代码生成后如果要改变，就必须合并自己写的代码。而wxGlade生成的界面代码可以往里面添加自己的代码，界面改变后重新生成代码并不会删除你自己的代码。这主要靠代码中的一些wxGlade标记注释实现。比如# begin wxGlade: MainFrame.__init__和# end wxGlade之间的代码是wxGlade生成的，你不能在这里面加代码，否则会被覆盖掉，但在外面加就没问题了。&lt;br /&gt;&lt;br /&gt;2）使用方式方面wxGlade和wxFormBuil&lt;img src =&quot;http://blog.csdn.net/n5/aggbug/3968504.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/csdn.net/n5/236644729/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/csdn.net/n5/236644729/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sun, 08 Mar 2009 19:37:00 +0800</pubDate><author>happyfire</author><comments>http://blog.csdn.net/n5/archive/2009/03/08/3968504.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/n5/archive/2009/03/08/3968504.aspx</guid><dc:creator>happyfire</dc:creator><fs:srclink>http://blog.csdn.net/n5/archive/2009/03/08/3968504.aspx</fs:srclink><fs:srcfeed>http://blog.csdn.net/n5/feed.aspx</fs:srcfeed><fs:itemid>csdn.net/n5/~1153042/236644729/1153028</fs:itemid></item></channel></rss>