<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[诡辩生活::WEB标准::游戏编程::Ogre::ofuson::教程::图形学]]></title>
  <subtitle type="html"><![CDATA[游戏的世界]]></subtitle>
  <id>http://blog.guibian.com/</id> 
  <link rel="alternate" type="text/html" href="http://blog.guibian.com/" /> 
  <link rel="self" type="application/atom+xml" href="http://blog.guibian.com/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.4.1022">PJBlog2</generator> 
  <updated>2008-08-12T17:51:33+08:00</updated> 

  <entry>
	  <title type="html"><![CDATA[开始使用gamebryo]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-08-12T17:51:33+08:00</updated>
	  <published>2008-08-12T17:51:33+08:00</published>
		  <summary type="html"><![CDATA[最近的项目公司选择了Gamebryo作为引擎。我之前看过一些gamebryo的东西。这次拿到了source的版本，粗略看了一下，感受不少gamebryo的强大。<br/><br/>首先是工具的强大。引擎在图形方面的渲染其实不是重要的。因为图形现在已经没有什么秘密可言了。开源引擎的效果已经和商业引擎差不多了。]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=53" /> 
	  <id>http://blog.guibian.com/default.asp?id=53</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[杭州啊，好累好累的旅游]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=8" label="Trip" /> 
	  <updated>2008-07-15T00:37:46+08:00</updated>
	  <published>2008-07-15T00:37:46+08:00</published>
		  <summary type="html"><![CDATA[周六开始了早已计划好的杭州之行。<br/>上海这周一直很热很热，杭州也没好到哪里去。<br/><br/>早晨从张江这边出发，差点误了火车班点。好在上海地铁比较快。 ：）<br/>到南站大概就用了40分钟。&nbsp;&nbsp; 座动组到杭州还是很快的。差不多一个半小时就到杭州站了。<br/><br/>在车站里吃了点东西，就坐公交直接去了白堤（好像是少年宫前面的站）。<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=52" /> 
	  <id>http://blog.guibian.com/default.asp?id=52</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Ogre &amp; Scaleform整合]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-07-15T00:35:42+08:00</updated>
	  <published>2008-07-15T00:35:42+08:00</published>
		  <summary type="html"><![CDATA[如果你玩Crysis，你会觉得他的UI很帅很帅，因为他使用全屏动画，<br/>这完全依赖于Scaleform的高超表现，Scaleform真是个好东西啊。<br/>www.scaleform.com<br/>他把Flash影片，用三角形描绘出来，让你能制作出传统位图不能解决的UI效果。]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=51" /> 
	  <id>http://blog.guibian.com/default.asp?id=51</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Ogre骨骼动画融合]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-06-22T11:56:00+08:00</updated>
	  <published>2008-06-22T11:56:00+08:00</published>
		  <summary type="html"><![CDATA[很多商业引擎都支持骨骼动画融合这个功能。<br/>融合可以让你的动画自然过渡到下一个动画，你可以精确控制下一个动画播放时间等信息。<br/><br/>Ogre其实也支持动画的融合，只是Ogre并没有给出代码级的支持。<br/>PS：Ogre很有意思，他天然支持很多东西，但是都没有实现出来，需要你来实现。<br/><br/>好的，下面来通过代码看看如果进行一个简单的骨骼动画融合。<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/><br/>class AnimationBlender<br/>{<br/>public:<br/>&#160;&#160;&#160;&#160;enum BlendingTransition&nbsp;&nbsp;//不同的混合方式<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;BlendSwitch,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 直接切换到目标动画<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;BlendWhileAnimating,&nbsp;&nbsp; // 交叉淡入淡出（源动画比例缩小，同时目标动画比例增大）<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;BlendThenAnimate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 淡出源动画到目标动画第一帧，然后开始目标动画 <br/>&#160;&#160;&#160;&#160;};<br/><br/>private:<br/>&#160;&#160;&#160;&#160;Entity *mEntity;<br/>&#160;&#160;&#160;&#160;AnimationState *mSource;<br/>&#160;&#160;&#160;&#160;AnimationState *mTarget;<br/><br/>&#160;&#160;&#160;&#160;BlendingTransition mTransition;<br/><br/>&#160;&#160;&#160;&#160;bool loop; //是否循环<br/><br/>&#160;&#160;&#160;&#160;~AnimationBlender() {}<br/><br/>public: <br/>&#160;&#160;&#160;&#160;Real mTimeleft, mDuration; //持续时间<br/><br/>&#160;&#160;&#160;&#160;bool complete;<br/><br/>&#160;&#160;&#160;&#160;void blend( const String &amp;animation, BlendingTransition transition, Real duration, bool l );<br/>&#160;&#160;&#160;&#160;void addTime( Real );<br/>&#160;&#160;&#160;&#160;Real getProgress() { return mTimeleft/ mDuration; }<br/>&#160;&#160;&#160;&#160;AnimationState *getSource() { return mSource; }<br/>&#160;&#160;&#160;&#160;AnimationState *getTarget() { return mTarget; }<br/>&#160;&#160;&#160;&#160;AnimationBlender( Entity *);<br/>&#160;&#160;&#160;&#160;void init( const String &amp;animation );<br/>};<br/></div></div><br/><br/>实现的代码<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent"><br/>void AnimationBlender::init(const String &amp;animation)<br/>{<br/>&#160;&#160;&#160;&#160;//初始化所有动作的AnimationState<br/>&#160;&#160;&#160;&#160;AnimationStateSet *set = mEntity-&gt;getAllAnimationStates();<br/>&#160;&#160;&#160;&#160;AnimationStateIterator it = set-&gt;getAnimationStateIterator();<br/>&#160;&#160;&#160;&#160;while(it.hasMoreElements())<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;AnimationState *anim = it.getNext();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;anim-&gt;setEnabled(false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;anim-&gt;setWeight(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;anim-&gt;setTimePosition(0);<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;//初始化mSource<br/>&#160;&#160;&#160;&#160;mSource = mEntity-&gt;getAnimationState( animation );<br/>&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(true);<br/>&#160;&#160;&#160;&#160;mSource-&gt;setWeight(1);<br/>&#160;&#160;&#160;&#160;mTimeleft = 0;<br/>&#160;&#160;&#160;&#160;mDuration = 1;<br/>&#160;&#160;&#160;&#160;mTarget = 0;<br/>&#160;&#160;&#160;&#160;complete=false;<br/>} <br/>void AnimationBlender::blend( const String &amp;animation, BlendingTransition transition, Real duration, bool l )<br/>{<br/>&#160;&#160;&#160;&#160;loop=l; //设置是否需要循环<br/>&#160;&#160;&#160;&#160;if( transition == AnimationBlender::BlendSwitch )<br/>&#160;&#160;&#160;&#160;{//如果混合方式为直接切换，改变mSource 即可<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( mSource != 0 )<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource = mEntity-&gt;getAnimationState( animation );<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(true);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setWeight(1);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setTimePosition(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTimeleft = 0;<br/>&#160;&#160;&#160;&#160;} <br/>&#160;&#160;&#160;&#160;else <br/>&#160;&#160;&#160;&#160;{ <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//先取得新的动画状态<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;AnimationState *newTarget = mEntity-&gt;getAnimationState( animation );<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( mTimeleft &gt; 0 ) //前一次的混合尚未结束<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( newTarget == mTarget )<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 新的目标就是正在混合中的目标，什么也不做<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else if( newTarget == mSource )<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 新的目标是源动画，直接go back<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource = mTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget = newTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTimeleft = mDuration - mTimeleft; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 现在newTarget是真的新的动画了<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( mTimeleft &lt; mDuration * 0.5 ) //上一次的混合进度还未超过一半<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 简单替换Target就行了<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setEnabled(false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setWeight(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else //如果已经过半，旧的target成为新的source<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setWeight(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource = mTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget = newTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setEnabled(true);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setWeight( 1.0 - mTimeleft / mDuration );<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setTimePosition(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else //上次的混合已经结束，当前未处于混合状态中<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTransition = transition;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTimeleft = mDuration = duration;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget = newTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setEnabled(true);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setWeight(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setTimePosition(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;}<br/>}<br/>void AnimationBlender::addTime( Real time )<br/>{<br/>&#160;&#160;&#160;&#160;if( mSource != 0 ) //若无AnimationState则不进行操作<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( mTimeleft &gt; 0 ) //两个动画仍在混合过程中<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTimeleft -= time; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if( mTimeleft &lt; 0 )<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 混合完毕,切换到目标动画<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(false);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setWeight(0);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource = mTarget;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setEnabled(true);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setWeight(1);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget = 0;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// 仍然处于混合状态中，改变两个动画的权值<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setWeight(mTimeleft / mDuration);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;setWeight(1.0 - mTimeleft / mDuration);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;//在这种混合方式下，需要为目标动画增加时间<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(mTransition == AnimationBlender::BlendWhileAnimating)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mTarget-&gt;addTime(time);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (mSource-&gt;getTimePosition() &gt;= mSource-&gt;getLength())<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;complete=true;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;complete=false;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;addTime(time);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSource-&gt;setLoop(loop);<br/>&#160;&#160;&#160;&#160;}<br/>}<br/>AnimationBlender::AnimationBlender( Entity *entity ) : mEntity(entity){}<br/></div></div><br/><br/><br/>哈哈，相信你已经看出来，这段代码有很多很多的不足。比如只有骨骼动画的融合，<br/>而且还是写死的，必须0.5。<br/><br/>我现在已经扩展了这些功能，包括做到了骨骼动画与定点动画的融合，变形动画的融合等等。而且可以精确控制融合的时机。你有什么好想法也欢迎与我讨论]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=50" /> 
	  <id>http://blog.guibian.com/default.asp?id=50</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[GPU Gems3翻译 第一章 用GPU生成复杂的地形]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-06-04T20:14:44+08:00</updated>
	  <published>2008-06-04T20:14:44+08:00</published>
		  <summary type="html"><![CDATA[原作者：Ryan Geiss <br/>NVIDIA Corporation<br/><br/>第一节：介绍<br/>传统方法，程序生成的地形是受限的，因为他们用CPU来生成高度场，而由GPU来渲染。然而天生就是串行处理的CPU并不适合生成非常复杂的地形--一个需要高度并行的工作。因此，有CPU生成的简单高度场不能提供非常有趣的地形特征（类似地洞和悬崖)。<br/>我们期待GPU，实时的来生成高度复杂的地形。通过使用新的DirectX 10的特性：几何体着色(geometry shader)，流输出(stream output),和渲染到3D纹理(rendering to 3D textures)，我们可以利用GPU快速生成大块复杂的地形。综上，这些块创建了一个大的，有细节多边形的模型来呈现出来这个地形，在目前的视角下（图1-1）例子。<br/><a href="http://blog.guibian.com/attachments/month_0806/p200864201438.JPG" rel="lightbox[roadtrip]" title="Http://www.guibian.com/"><img src="http://blog.guibian.com/attachments/month_0806/p200864201438.JPG" border="0" alt=""/></a><br/><br/>第二节：Marching Cubes与密度函数<br/><span style="color:Red">译者注：</span>Marching Cubes是一种计算机图形学算法，由<a target="_blank" href="http://en.wikipedia.org/wiki/Marching_cubes#cite_note-Originalpaper-0">Lorensen和Cline</a>发表在1987年SIGGRAPH上，目的有一个三维的标量场（或称为体素(voxels)）中提取一个等值面的多边形网格。<br/><br/>理论上来说，地形表面可以完全用一个单一函数来描述，这就是密度函数。对于任意3D空间中的点(x,y,z),该函数计算出一个单一的浮点值。这个值在空间上变化，有时是一个负值，有时是一个正值。如果是负值，说明空间中的点在地形以内。如果是负值，说明这个点位于一个空的空间中(空气中或水中)。负值和正值的边界值是0，是地形的表面。也就是属于我们要创建多边形模型的表面。<br/><br/>每次，我们用GPU为地形的一个“块”生成多边形，但是我们想进一步细分块到32x32x32这些更小的单元或者体素。图1-2示例了一个坐标系。在这些体素里我们将创建一些多边形（三角面）来描绘地表。marching cubes算法让我们在一个单一个体素上生成正确的多边形，作为输入的是他八个角的密度值，作位输出的是，他将在某些地方生成0-5个多边形。如果一个单元的八个角密度值得符号都是相同的，那么这个单元全部在地形以内或者以外，因此没有多边形输出。所有其他情况下，这个单元依赖于岩石和大气的边界，那么在某些地方会生成0-5个多边形。<br/><a href="http://blog.guibian.com/attachments/month_0806/y20086422138.jpg" rel="lightbox[roadtrip]" title="Http://www.guibian.com/"><img src="http://blog.guibian.com/attachments/month_0806/y20086422138.jpg" border="0" alt=""/></a><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=49" /> 
	  <id>http://blog.guibian.com/default.asp?id=49</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[前一阵做的休闲网游]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=5" label="My Life" /> 
	  <updated>2008-06-03T04:11:19+08:00</updated>
	  <published>2008-06-03T04:11:19+08:00</published>
		  <summary type="html"><![CDATA[这是前一阵做的一个休闲游戏，UI界面是另外一个同事写的。<br/>此版本是Alpha版本，或者叫做演示版。功能还不完善。这个完善的游戏大概要到年底才能完成。因为是一个外包项目，所以代码无法公开了。<br/>目前已经能够实现多人联网对战了。包含大厅，房间，游戏内等。<br/>观看地址如下：（版权归属深圳泰山电子）<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/flash.gif" alt="" style="margin:0px 2px -3px 0px" border="0"/>Flash动画</div><div class="UBBContent"><a id="temp5016_href" href="http://blog.guibian.com/javascript:MediaShow('swf','temp5016','http://www.toltech.cn/flash/video_mouse.swf','400','300')"><img name="temp5016_img" src="http://blog.guibian.com/images/mm_snd.gif" style="margin:0px 3px -2px 0px" border="0" alt=""/><span id="temp5016_text">在线播放</span></a><div id="temp5016"></div></div></div><br/>更多精彩请查看：<a href="http://www.i-dong.com" target="_blank">http://www.i-dong.com</a><br/>并请看体博会展示：<a target="_blank" href="http://www.i-dong.com/news/official/official08060301.html">国际友人体验打地鼠项目</a><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=48" /> 
	  <id>http://blog.guibian.com/default.asp?id=48</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[费劲的Vista啊]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=5" label="My Life" /> 
	  <updated>2008-05-31T11:56:05+08:00</updated>
	  <published>2008-05-31T11:56:05+08:00</published>
		  <summary type="html"><![CDATA[今天装了vista操作系统（终极版）。<br/>vista用起来真够费劲的。首先是UAC。这个破东西导致很多东西不能更新。<br/>典型的有QQ游戏平台等。<br/>另外装很多软件有错误。<br/>例如 3DMax9 需要安装官方补丁,否则会提示某个dll错误<br/><a href="http://images.autodesk.com/adsk/files/3dsmax9_sp2_32bit.zip" target="_blank">http://images.autodesk.com/adsk/files/3dsmax9_sp2_32bit.zip</a><br/>这里是官方补丁地址！<br/><br/>这个帖子用来记录&nbsp;&nbsp;解决Vista和诸多软件不兼容问题解决办法]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=47" /> 
	  <id>http://blog.guibian.com/default.asp?id=47</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[MANGOS服务端架设成功]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-05-29T23:36:56+08:00</updated>
	  <published>2008-05-29T23:36:56+08:00</published>
		  <summary type="html"><![CDATA[一直想把Mangos服务端假设起来，跑一下魔兽世界，今天在单位测试成功了。大概花费半天时间，困难并不是太大，基本按设置一步步做就可以了。<br/><br/><br/>Mangos是魔兽世界服务端模拟器。是一个开源项目，在sourceforge上可以找到。<br/><br/>先说一下我机器的配置，inter双核处理器，显卡太烂了是Inter集成的（单位真TM抠门）<br/>1G内存，200G硬盘。操作系统是vista终极版。编译环境vs2005 sp1<br/>我的魔兽世界客户端是9C最新的决战太阳井2.4.2（如果你的客户端版本跟我不一样应该问题不大，不过从MPQ文件里提取dbc,map的时候需要修改一下那个工具 ）<br/><br/>首先要去svn上down一下mangos的最新版本。<br/>基本上如果编译环境跟我一样，直接就编译通过了。<br/><br/><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=46" /> 
	  <id>http://blog.guibian.com/default.asp?id=46</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Ogre中的动画纹理]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-05-21T09:43:03+08:00</updated>
	  <published>2008-05-21T09:43:03+08:00</published>
		  <summary type="html"><![CDATA[在最近一个休闲游戏项目中，有一个需求：需要一个瞄准心。<br/>由于需要瞄准的地方环境非常复杂（其实就是模型很多，不规则），所以如果用求碰撞的方法去计算，再把一张纹理图贴上去是非常麻烦的 ：）<br/>所以我考虑了用纹理投影，Texture Decal。<br/>这个在Ogre中级教程中有个例子。<br/>PS：题外话，Texture Decal可以无缝的贴到模型上，但是也有很多局限性，比如每一个Decal需要一个Pass，如果Decal太多的话就没办法了，多了Pass会大大影响到效率。<br/>还有一个问题就是我在项目中遇到的问题。<br/><br/>需求是这样的：需要一个瞄准心，这个准心在遇到需要击打的物体时，改变准心的效果（这里我先实现的是改变准心的颜色）。<br/><br/>Ogre里支持动画纹理:<br/>setAnimatedTextureName(&#34;image.png&#34;,num,frame);<br/>第一个参数是纹理的名字，第二个参数是帧数，一般来说比方说是2帧<br/>你的图片要命名成image_0.png和image_1.png<br/>frame是帧速率。<br/><br/>你也可以用setCurrentFrame(int)来控制它&nbsp;&nbsp;：） 简单吧<br/><br/><br/><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=45" /> 
	  <id>http://blog.guibian.com/default.asp?id=45</id> 
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Ogre实现场景动态装载卸载]]></title>
	  <author>
		 <name>volfmath</name>
		 <uri>http://blog.guibian.com/</uri>
		 <email>volfmath@gmail.com</email>
	  </author>
	  <category term="" scheme="http://blog.guibian.com/default.asp?cateID=6" label="Tech" /> 
	  <updated>2008-05-03T16:18:28+08:00</updated>
	  <published>2008-05-03T16:18:28+08:00</published>
		  <summary type="html"><![CDATA[经常玩日本游戏的朋友们应该都知道。日本RPG中经常有一些场景切换的画面。比如在角色走动过程中，突然进入战斗状态，他会先把先前的场景渲染成一张图片，然后移开这张图片，在渲染另一个场景，譬如是战斗场景。<br/><br/>最近在休闲网络游戏时，也碰到一个这样的需求。就是在一局游戏中动态的切换场景。<br/><br/>这个项目时间比较紧迫，场景直接用了解析OFusion的OSM文件来做。但是我遇到一些问题是OfusionLoader这个东西，只有装载没有卸载。如果这样的话，就很难满足项目中的需求。（就算没有这个需求，卸载场景还是需要做的）<br/><br/>好在并不是太困难，只要按照OFusion的状态方式，把他所装载的东西都记录下来就可以了。<br/><br/>比如我先把装载的场景中的状态的静态模型都记录到一个容器中<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">void OSMScene::cr&#101;ateEntities(TiXmlElement* pEntityNode, Ogre::SceneNode* pSceneRoot)<br/>{<br/>&#160;&#160;&#160;&#160;// Iterate all meshes, creating them. <br/>&#160;&#160;&#160;&#160;for (TiXmlElement* pMeshElem = pEntityNode-&gt;FirstChildElement();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pMeshElem != 0; pMeshElem = pMeshElem-&gt;NextSiblingElement())<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Ogre could cast an exception, in which case we just try to <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// continue reading the other meshes<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;try <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;const char *pszName = pMeshElem-&gt;Attribute(&#34;name&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;const char *pszFileName = pMeshElem-&gt;Attribute(&#34;filename&#34;);<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// try to cr&#101;ate the mesh<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Entity *pEntity = mSceneMgr-&gt;cr&#101;ateEntity(pszName, pszFileName);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(pEntity==0) continue;<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Check if the object should cast shadows<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;const char *pszCastShadows=pMeshElem-&gt;Attribute(&#34;CastShadows&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(pszCastShadows &amp;&amp; stricmp(pszCastShadows, &#34;no&#34;)==0)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pEntity-&gt;setCastShadows(false);&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;else<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pEntity-&gt;setCastShadows(true);&#160;&#160;&#160;&#160;<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Cr&#101;ate node with full information<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SceneNode *pObjNode=cr&#101;ateNode(pMeshElem, pSceneRoot);<br/><br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Attach the mesh entity to node<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pObjNode-&gt;attachObject(pEntity);<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;StaticModel * staticModel = new StaticModel();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;staticModel-&gt;mEntity&nbsp;&nbsp;&nbsp;&nbsp;= pEntity;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;staticModel-&gt;mSceneNode = pObjNode;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mStaticModelList.push_back(staticModel);<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Notify<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(mCallbacks)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mCallbacks-&gt;OnEntityCr&#101;ate(pEntity, pMeshElem);<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Add to entity list<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mEntities.push_back(pEntity);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} catch(...)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;continue;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;}&#160;&#160;&#160;&#160;<br/>}</div></div><br/><br/>然后再清理场景之间清理掉他们<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">// Del&#101;te all entity<br/>void OSMScene::del&#101;teEntities(void)<br/>{<br/>&#160;&#160;&#160;&#160;std::vector&lt;StaticModel * &gt;::iterator StaticModelIter;<br/>&#160;&#160;&#160;&#160;for(StaticModelIter = mStaticModelList.begin(); StaticModelIter != mStaticModelList.end(); ++StaticModelIter)<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Ogre::Entity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* pEntity&nbsp;&nbsp;&nbsp;&nbsp;= (*StaticModelIter)-&gt;mEntity;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Ogre::SceneNode&nbsp;&nbsp; * pSceneNode = (*StaticModelIter)-&gt;mSceneNode;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pSceneNode-&gt;detachObject(pEntity);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSceneMgr-&gt;destroySceneNode(pSceneNode);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mSceneMgr-&gt;destroyEntity(pEntity);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;del&#101;te *StaticModelIter;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;mStaticModelList.clear();<br/><br/>}</div></div><br/><br/>其他象摄像机，灯光都按照这样的方法装载、卸载掉。<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">最后清理场景<br/>bool OSMScene::destroyScene()<br/>{<br/>&#160;&#160;&#160;&#160;try<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;del&#101;teEntities();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;del&#101;teLight();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;del&#101;teCamera();<br/>.............................................................<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return true;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;catch(...)<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;LogManager::getSingleton().logMessage(&#34;Error&#34;);&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;}<br/><br/>&#160;&#160;&#160;&#160;return false;<br/>}</div></div><br/><br/>当然由于OFusion也沿用了Ogre的文件管理系统，因此在加载前他把自己的资源目录添加到Ogre的资源配置文件中去了，在卸载的时候我们也需要删除它们，防止那个资源目录爆炸式的增加<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://blog.guibian.com/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">void OSMScene::undeclareResources(void)<br/>{<br/>&#160;&#160;&#160;&#160;if(!mXMLDoc.isNull())<br/>&#160;&#160;&#160;&#160;{<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;TiXmlElement* rootElem = mXMLDoc-&gt;RootElement();<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;try <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Get mesh filename from entities<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;TiXmlElement *pMeshNode = rootElem-&gt;FirstChildElement(&#34;entities&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(pMeshNode)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Iterate all meshes, creating them. <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (TiXmlElement* pMeshElem = pMeshNode-&gt;FirstChildElement();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pMeshElem != 0; pMeshElem = pMeshElem-&gt;NextSiblingElement())<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// Declare mesh resource<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;const char *pszFileName = pMeshElem-&gt;Attribute(&#34;filename&#34;);&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ResourceGroupManager::getSingleton().undeclareResource(pszFileName, &#34;Mesh&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} catch(...)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/><br/>&#160;&#160;&#160;&#160;}<br/><br/>}</div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://blog.guibian.com/default.asp?id=44" /> 
	  <id>http://blog.guibian.com/default.asp?id=44</id> 
  </entry>	
		
</feed>