锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产91久久精品一区二区,国产精品熟女福利久久AV,一个色综合久久http://www.shnenglu.com/zybdebug/zh-cnWed, 07 May 2025 13:44:29 GMTWed, 07 May 2025 13:44:29 GMT60鐞嗚ВSkinWeights 楠ㄩ鍔ㄧ敾http://www.shnenglu.com/zybdebug/archive/2009/09/17/96584.htmlzyb_debugzyb_debugThu, 17 Sep 2009 14:45:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/17/96584.htmlhttp://www.shnenglu.com/zybdebug/comments/96584.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/17/96584.html#Feedback1http://www.shnenglu.com/zybdebug/comments/commentRss/96584.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/96584.htmlhttp://hi.baidu.com/zyb_debug/blog/item/fbe409eeb8a8b5e5cf1b3e0b.html


闃呰 Advanced Animation

璋堝埌SkinWeights閲岄潰鐨凾ransformMatrix鐨勬椂鍊欎竴絎斿甫榪囷紝鎴戝緇堜笉鐞嗚В榪欎釜matrix鏈変綍鐢ㄥ錛屽洜涓烘垜鎰熻鎵鏈夌殑欏剁偣鍙樻崲閮借 Frame閲岄潰鐨勯樁灞備綋緋誨仛浜?閭d箞SkinWeights閲岄潰鐨刴atrix鏈変粈涔堢敤銆?/p>

緇忚繃鎴戜竴涓櫄涓婄殑鎬濊冿紝鐪嬩簡GameDev璁哄潧鐨勫笘瀛愶紝緇堜簬鐞嗚В浜嗐?/p>

棣栧厛璁插緩妯★紝寤烘ā寤哄嚭鏉ョ殑鏄竴浜涢《鐐癸紝榪欎簺欏剁偣緇勬垚浜嗘渶鍘熷鐨刴esh銆?/p>

鏈鍘熷鐨刴esh涓湁SkinWeights淇℃伅

SkinWeights

{

鍚嶅瓧錛?/p>

褰卞搷鐨勯《鐐規暟錛?/p>

欏剁偣鐨勭儲寮曪紱//灝辨槸褰卞搷浜嗗嚑涓《鐐?/p>

欏剁偣鏉冮噸錛?/涔樹互Frame TransformMatrix鐨勭櫨鍒嗘瘮

鏈鍚庡氨鏄竴涓?*4鐨勭煩闃碉紱

}

榪欎釜4*4鐭╅樀鏄繖鏃墮楠煎湪 Mesh涓殑浣嶇疆鐨勯嗙煩闃碉紝涔熷氨鏄浉瀵逛簬 local鍧愭爣緋匯?/p>

鎴戣鐨勬槑鐧界偣錛屾墜鑵曟槸涓楠鹼紝鎵嬫寚灝栨槸鎵嬭厱褰卞搷鐨勯《鐐廣傚氨鏄竴涓偣,vetex錛屽湪鑷韓鍧愭爣緋諱笅銆?/p>

閭d箞鐢?鎵嬫寚灝栬繖涓偣 * SkinWeightsMatrix 寰楀埌鐨勫氨鏄釜浣嶇疆錛屼粈涔堜綅緗紵灝辯浉褰撲簬鎶婃墜鑵曡繛甯︽寚灝栫Щ鍒板潗鏍囧師鐐廣傚綋鐒訛紝鎵嬭厱鍦ㄥ潗鏍囧師鐐圭殑浣嶇疆銆?/p>

 

鑷充簬Frame涓瓨鍌ㄧ殑闃跺眰浣撶郴鐭╅樀灝辨槸鐜板湪楠ㄩ鐨勪綅緗?/p>

鎵懼埌鐜板湪鎵嬭厱楠ㄩ鐨勭煩闃? 鎵嬫寚灝朧ertex* SkinWeighsMatrix*(鑲╄唨鐨凪atrix*鑳寵唺鑲樼殑matrix*鎵嬭厱鐨刴atrix)錛?/p>

閭d箞鎵嬫寚灝栬嚜鐒跺氨鍙樻崲鍒頒簡鐩稿簲鐨勪綅緗?/p>

 

鎴戣寰楄繖涔堥氫織錛屼笉鐭ラ亾浼犺揪鍒版濇兂娌★紵

鍙傝冮摼鎺?/p>

http://www.gamedev.net/community/forums/topic.asp?topic_id=479158

http://www.gamedev.net/community/forums/topic.asp?topic_id=392242

鏈鍚庢劅鎱ㄤ笅錛孏ameDev鐨勮鍧涙灉鐒舵槸濂藉湴鏂?/p>

zyb_debug 2009-09-17 22:45 鍙戣〃璇勮
]]>
鍦╒S涓浣曢儴緗?h鍜?cpp鏂囦歡http://www.shnenglu.com/zybdebug/archive/2009/09/15/96216.htmlzyb_debugzyb_debugTue, 15 Sep 2009 06:59:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/15/96216.htmlhttp://www.shnenglu.com/zybdebug/comments/96216.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/15/96216.html#Feedback0http://www.shnenglu.com/zybdebug/comments/commentRss/96216.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/96216.html浠ュ墠鍐欑殑緇濆ぇ澶氭暟紼嬪簭閮芥槸鎶奵pp,h涓鑲¤剳鍎挎斁鍦ㄥ綋鍓嶇洰褰曚笅銆?/p>

榪欐牱鏄庢樉鏄笉濂界殑錛屽墠鍑犲ぉ鎴戝紑濮嬫瀯寤鴻嚜宸辯殑鐐筪3d搴擄紝鏋勫緩浜嗕簺璁哥被涔嬪悗鍙戠幇鎶婂畠浠兘鏀懼湪褰撳墠鐩綍錛屼篃灝辨槸宸ョ▼鐩綍涓嬪競涓嶅ソ鐨勶紝搴旇鎶婂畠浠垎綾諱竴涓嬨?/p>

浜庢槸鎴戣瘯浜嗕笅錛屾柊寤轟竴涓枃浠跺す錛岀劧鍚庢妸銆俬涓㈣繘鍘匯?/p>

緇撴灉鍙戠幇鍦╟pp鏂囦歡閲?#include “*****.h”涓嶈兘緙栬瘧閫氳繃銆傚悗鏉ヨ寰梀S閲屼竴瀹氭湁璁劇疆瀵繪壘.h,璺緞鐨勮緗?/p>

浜庢槸銆?/p>

鍦╬roperty鍐呯湅鍒頒簡鐩稿簲璁劇疆錛屽鍥?/p>

鐪嬪埌 Additional閭d釜閫夐」娌★紝鍦ㄩ偅閲屾坊鍔犺緗礬寰勭殑鍦版柟錛屽皢.h.cpp鎵鍦ㄧ殑鏂囦歡澶瑰寘鍚繘鍘誨氨琛屼簡銆?/p>

濡傚浘


鍚庢潵閬囧埌浜嗕釜棰勭紪璇戝ご鐨勯棶棰橈紝瑙佷笂綃囨枃绔犲惂銆?

zyb_debug 2009-09-15 14:59 鍙戣〃璇勮
]]>
錛堣漿錛夐緙栬瘧澶存枃浠?/title><link>http://www.shnenglu.com/zybdebug/archive/2009/09/15/96214.html</link><dc:creator>zyb_debug</dc:creator><author>zyb_debug</author><pubDate>Tue, 15 Sep 2009 06:35:00 GMT</pubDate><guid>http://www.shnenglu.com/zybdebug/archive/2009/09/15/96214.html</guid><wfw:comment>http://www.shnenglu.com/zybdebug/comments/96214.html</wfw:comment><comments>http://www.shnenglu.com/zybdebug/archive/2009/09/15/96214.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/zybdebug/comments/commentRss/96214.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/zybdebug/services/trackbacks/96214.html</trackback:ping><description><![CDATA[<p>浠婂ぉ鍦ㄦ敼涓涓緢澶х殑紼嬪簭錛屾參鎱㈢湅錛屾參鎱㈡敼銆傜獊鐒跺彂鐜頒竴涓?c鏂囦歡錛岄噷闈粈涔堜篃娌℃湁錛?/p> <p>灝卞嚑涓ご鏂囦歡錛屾垜涓鐪嬶紝鎴戦潬錛岃繖涓嶆槸鎶婄畝鍗曠殑闂鎼炲鏉備簡鍚楋紝闅忔墜鍒犳帀閭d釜c鏂囦歡銆?/p> <p>緇撴灉涓嶈兘緙栬瘧浜嗭紝鎴戦潬錛?/p> <p>fatal error C1083: Cannot open precompiled header file: \'Debug/v13_3.pch\':</p> <p>No such file or directory</p> <p>鎬庝箞rebuild all閮戒笉琛屻?/p> <p>涓婄綉鏌ヤ簡涓涓嬶紝鎵嶆悶鎳備簡錛?/p> <p>錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞鎬葷粨錛嶏紞錛嶏紞錛嶏紞</p> <p>濡傛灉宸ョ▼寰堝ぇ錛屽ご鏂囦歡寰堝錛岃屾湁鍑犱釜澶存枃浠跺張鏄粡甯歌鐢ㄧ殑錛岄偅涔?/p> <p>1銆傛妸榪欎簺澶存枃浠跺叏閮ㄥ啓鍒頒竴涓ご鏂囦歡閲岄潰鍘伙紝姣斿鍐欏埌preh.h</p> <p>2銆傚啓涓涓猵reh.c錛岄噷闈㈠彧涓鍙ヨ瘽錛?include "preh.h"</p> <p>3銆傚浜巔reh.c錛屽湪project setting閲岄潰璁劇疆creat precompiled headers錛屽浜庡叾浠?/p> <p>.c鏂囦歡錛岃緗畊se precompiled header file</p> <p>//</p> <p>鍝堝搱</p> <p>鎴戣瘯浜嗕竴涓嬶紝鏁堟灉寰堟槑鏄撅紝涓嶇敤precompiled header錛岀紪璇戜竴嬈℃垜鍙互鍘諱笂涓帟鎵錛岀敤</p> <p>precompiled header錛岀紪璇戠殑鏃跺欙紝鎴戝彲浠ョ珯璧鋒潵浼鎬釜鎳掕叞錛屾椿鍔ㄦ椿鍔ㄥ氨宸笉澶氬暒</p> <p>錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶈漿杞界殑鏂囩珷錛嶏紞錛嶏紞錛嶏紞錛嶏紞錛嶏紞</p> <p>棰勭紪璇戝ご鐨勬蹇碉細</p> <p>鎵璋撶殑棰勭紪璇戝ご灝辨槸鎶婁竴涓伐紼嬩腑鐨勯偅涓閮ㄥ垎浠g爜,棰勫厛緙栬瘧濂芥斁鍦ㄤ竴涓枃浠墮噷(閫氬父鏄?/p> <p>浠?pch涓烘墿灞曞悕鐨?錛岃繖涓枃浠跺氨縐頒負棰勭紪璇戝ご鏂囦歡榪欎簺棰勫厛緙栬瘧濂界殑浠g爜鍙互鏄換浣曠殑</p> <p>C/C++浠g爜--------鐢氳嚦鏄痠nline鐨勫嚱鏁幫紝浣嗘槸蹇呴』鏄ǔ瀹氱殑錛屽湪宸ョ▼寮鍙戠殑榪囩▼涓笉浼?/p> <p>琚粡甯告敼鍙樸傚鏋滆繖浜涗唬鐮佽淇敼錛屽垯闇瑕侀噸鏂扮紪璇戠敓鎴愰緙栬瘧澶存枃浠躲傛敞鎰忕敓鎴愰緙?/p> <p>璇戝ご鏂囦歡鏄緢鑰楁椂闂寸殑銆傚悓鏃朵綘寰楁敞鎰忛緙栬瘧澶存枃浠墮氬父寰堝ぇ錛岄氬父鏈?-7M澶с傛敞鎰忓強</p> <p>鏃舵竻鐞嗛偅浜涙病鏈夌敤鐨勯緙栬瘧澶存枃浠躲?/p> <p>涔熻浣犱細闂細鐜板湪鐨勭紪璇戝櫒閮芥湁Time stamp鐨勫姛鑳斤紝緙栬瘧鍣ㄥ湪緙栬瘧鏁翠釜宸ョ▼鐨勬椂鍊欙紝瀹?/p> <p>鍙細緙栬瘧閭d簺緇忚繃淇敼鐨勬枃浠訛紝鑰屼笉浼氬幓緙栬瘧閭d簺浠庝笂嬈$紪璇戣繃錛屽埌鐜板湪娌℃湁琚慨鏀硅繃</p> <p>鐨勬枃浠躲傞偅涔堜負浠涔堣繕瑕侀緙栬瘧澶存枃浠跺憿錛熺瓟妗堝湪榪欓噷錛屾垜浠煡閬撶紪璇戝櫒鏄互鏂囦歡涓哄崟</p> <p>浣嶇紪璇戠殑錛屼竴涓枃浠剁粡榪囦慨鏀瑰悗錛屼細閲嶆柊緙栬瘧鏁翠釜鏂囦歡錛屽綋鐒跺湪榪欎釜鏂囦歡閲屽寘鍚殑鎵鏈?/p> <p>澶存枃浠朵腑鐨勪笢瑗匡紙.eg Macro, Preprocesser 錛夐兘瑕侀噸鏂板鐞嗕竴閬嶃俈C鐨勯緙栬瘧澶存枃浠?/p> <p>淇濆瓨鐨勬鏄繖閮ㄥ垎淇℃伅銆備互閬垮厤姣忔閮借閲嶆柊澶勭悊榪欎簺澶存枃浠躲?/p> <p>棰勭紪璇戝ご鐨勪綔鐢細</p> <p>鏍規嵁涓婃枃浠嬬粛錛岄緙栬瘧澶存枃浠剁殑浣滅敤褰撶劧灝辨槸鎻愰珮渚垮疁閫熷害浜嗭紝鏈変簡瀹冧綘娌℃湁蹇呰姣忔</p> <p>閮界紪璇戦偅浜涗笉闇瑕佺粡甯告敼鍙樼殑浠g爜銆傜紪璇戞ц兘褰撶劧灝辨彁楂樹簡銆?/p> <p>棰勭紪璇戝ご鐨勪嬌鐢細</p> <p>瑕佷嬌鐢ㄩ緙栬瘧澶達紝鎴戜滑蹇呴』鎸囧畾涓涓ご鏂囦歡錛岃繖涓ご鏂囦歡鍖呭惈鎴戜滑涓嶄細緇忓父鏀瑰彉鐨?/p> <p>浠g爜鍜屽叾浠栫殑澶存枃浠訛紝鐒跺悗鎴戜滑鐢ㄨ繖涓ご鏂囦歡鏉ョ敓鎴愪竴涓緙栬瘧澶存枃浠訛紙.pch鏂囦歡錛?/p> <p>鎯沖繀澶у閮界煡閬?StdAfx.h榪欎釜鏂囦歡銆傚緢澶氫漢閮借涓鴻繖鏄疺C鎻愪緵鐨勪竴涓?#8220;緋葷粺綰у埆”鐨?/p> <p>錛岀紪璇戝櫒甯︾殑涓涓ご鏂囦歡銆傚叾瀹炰笉鏄殑錛岃繖涓枃浠跺彲浠ユ槸浠諱綍鍚嶅瓧鐨勩傛垜浠潵鑰冨療涓涓?/p> <p>鍏稿瀷鐨勭敱AppWizard鐢熸垚鐨凪FC Dialog Based銆紼嬪簭鐨勯緙栬瘧澶存枃浠躲傦紙鍥犱負AppWizard</p> <p>浼氫負鎴戜滑鎸囧畾濂藉浣曚嬌鐢ㄩ緙栬瘧澶存枃浠訛紝榛樿鐨勬槸StdAfx.h錛岃繖鏄疺C璧風殑鍚嶅瓧錛夈傛垜浠?/p> <p>浼氬彂鐜拌繖涓ご鏂囦歡閲屽寘鍚簡浠ヤ笅鐨勫ご鏂囦歡錛?/p> <p>#include <afxwin.h> // MFC core and standard components</p> <p>#include <afxext.h> // MFC extensions</p> <p>#include <afxdisp.h> // MFC Automation classes</p> <p>#include <afxdtctl.h> // MFC support for Internet Explorer 4</p> <p>Common Controls</p> <p>#include <afxcmn.h></p> <p>榪欎簺姝f槸浣跨敤MFC鐨勫繀欏誨寘鍚殑澶存枃浠訛紝褰撶劧鎴戜滑涓嶅お鍙兘鍦ㄦ垜浠殑宸ョ▼涓慨鏀硅繖浜涘ご鏂?/p> <p>浠剁殑錛屾墍浠ヨ浠栦滑鏄ǔ瀹氱殑銆?/p> <p>閭d箞鎴戜滑濡備綍鎸囧畾瀹冩潵鐢熸垚棰勭紪璇戝ご鏂囦歡銆傛垜浠煡閬撲竴涓ご鏂囦歡鏄笉鑳界紪璇戠殑銆傛墍浠ユ垜</p> <p>浠繕闇瑕佷竴涓猚pp鏂囦歡鏉ョ敓鎴?pch 鏂囦歡銆傝繖涓枃浠墮粯璁ょ殑灝辨槸StdAfx.cpp銆傚湪榪欎釜鏂囦歡</p> <p>閲屽彧鏈変竴鍙ヤ唬鐮佸氨鏄細#include “Stdafx.h”銆傚師鍥犳槸鐞嗘墍褰撶劧鐨勶紝鎴戜滑浠呬粎鏄瀹冭兘</p> <p>澶熺紪璇戣屽凡?D?D?D涔熷氨鏄錛岃鐨勫彧鏄畠鐨?cpp鐨勬墿灞曞悕銆傛垜浠彲浠ョ敤/Yc緙栬瘧寮鍏蟲潵鎸?/p> <p>瀹歋tdAfx.cpp鏉ョ敓鎴愪竴涓?pch鏂囦歡錛岄氳繃/Fp緙栬瘧寮鍏蟲潵鎸囧畾鐢熸垚鐨刾ch鏂囦歡鐨勫悕瀛椼傛墦</p> <p>寮project ->Setting->C/C++ 瀵硅瘽妗嗐傛妸Category鎸囧悜Precompiled Header銆傚湪宸﹁竟鐨?/p> <p>鏍戝艦瑙嗗浘閲岄夋嫨鏁翠釜宸ョ▼銆</p> <p>Project Options(鍙充笅瑙掔殑閭d釜鐧界殑鍦版柟)鍙互鐪嬪埌 /Fp “debug/PCH.pch”錛岃繖灝辨槸鎸?/p> <p>瀹氱敓鎴愮殑.pch鏂囦歡鐨勫悕瀛楋紝榛樿鐨勯氬父鏄<宸ョ▼鍚?gt;.pch錛堟垜鐨勭ず渚嬪伐紼嬪悕灝辨槸PCH錛夈?/p> <p>鐒跺悗錛屽湪宸﹁竟鐨勬爲褰㈣鍥鵑噷閫夋嫨StdAfx.cpp.//榪欐椂鍙兘閫変竴涓猚pp鏂囦歡錛?/p> <p>榪欐椂鍘熸潵鐨凱roject Option鍙樻垚浜?Source File Option錛堝師鏉ユ槸宸ョ▼錛岀幇鍦ㄦ槸涓涓枃浠?/p> <p>錛屽綋鐒跺彉浜嗭級銆傚湪榪欓噷鎴戜滑鍙互鐪嬪埌 /Yc寮鍏籌紝/Yc鐨勪綔鐢ㄥ氨鏄寚瀹氳繖涓枃浠舵潵鍒涘緩涓涓?/p> <p>Pch鏂囦歡銆?Yc鍚庨潰鐨勬枃浠跺悕鏄偅涓寘鍚簡紼沖畾浠g爜鐨勫ご鏂囦歡錛屼竴涓伐紼嬮噷鍙兘鏈変竴涓枃</p> <p>浠剁殑鍙互鏈塝C寮鍏熾俈C灝辨牴鎹繖涓夐」鎶?StdAfx.cpp緙栬瘧鎴愪竴涓狾bj鏂囦歡鍜屼竴涓狿CH鏂囦歡</p> <p>銆?/p> <p>鐒跺悗鎴戜滑鍐嶉夋嫨涓涓叾瀹冪殑鏂囦歡鏉ョ湅鐪嬶紝//鍏朵粬cpp鏂囦歡</p> <p>鍦ㄨ繖閲岋紝Precomplier 閫夋嫨浜?Use 鈰嫰鈰竴欏癸紝澶存枃浠舵槸鎴戜滑鎸囧畾鍒涘緩PCH 鏂囦歡鐨剆tda</p> <p>fx.h</p> <p>鏂囦歡銆備簨瀹炰笂錛岃繖閲屾槸浣跨敤宸ョ▼閲岀殑璁劇疆錛岋紙濡傚浘1錛?Yu”stdafx.h”銆?/p> <p>榪欐牱錛屾垜浠氨璁劇疆濂戒簡棰勭紪璇戝ご鏂囦歡銆備篃灝辨槸璇達紝鎴戜滑鍙互浣跨敤棰勭紪璇戝ご鍔熻兘浜嗐備互</p> <p>涓嬫槸娉ㄦ剰浜嬮」錛?/p> <p>1):濡傛灉浣跨敤浜?Yu錛屽氨鏄浣跨敤浜嗛緙栬瘧錛屾垜浠湪姣忎釜.cpp鏂囦歡鐨勬渶寮澶達紝鎴戝己璋冧竴閬?/p> <p>鏄渶寮澶達紝鍖呭惈 浣犳寚瀹氫駭鐢焢ch鏂囦歡鐨?h鏂囦歡錛堥粯璁ゆ槸stdafx.h錛変笉鐒跺氨浼氭湁闂銆傚</p> <p>鏋滀綘娌℃湁鍖呭惈榪欎釜鏂囦歡錛屽氨鍛婅瘔浣燯nexpected file end. 濡傛灉浣犱笉鏄湪鏈寮澶村寘鍚殑錛?/p> <p>浣犺嚜宸辮瘯浠ヤ笅灝辯煡閬撲簡錛岀粷瀵規湁寰堟儕浜虹殑鏁堟灉鈰?.</p> <p>fatal error C1010: unexpected end of file while looking for precompiled</p> <p>header directive</p> <p>Generating Code...</p> <p>2錛夊鏋滀綘鎶妏ch鏂囦歡涓嶅皬蹇冧涪浜嗭紝緙栬瘧鐨勬椂鍊欏氨浼氫駭鐢熷緢澶氱殑涓嶆甯哥殑琛屼負銆傛牴鎹互涓?/p> <p>鐨勫垎鏋愶紝浣犲彧瑕佽緙栬瘧鍣ㄧ敓鎴愪竴涓猵ch鏂囦歡銆備篃灝辨槸璇存妸 stdafx.cpp錛堝嵆鎸囧畾/Yc鐨勯偅涓?/p> <p>cpp鏂囦歡錛変粠鏂扮紪璇戜竴閬嶃傚綋鐒朵綘鍙互鍌誨偦鐨?Rebuild All銆傜畝鍗曚竴鐐瑰氨鏄夋嫨閭d釜cpp</p> <p>鏂囦歡錛屾寜涓涓婥trl + F7灝卞彲浠ヤ簡銆備笉鐒跺彲鏄緢嫻垂鏃墮棿鐨勫摝銆?/p> <p>//</p> <p>鍛靛懙錛屽鏋滀綘灞呯劧鑰愮潃鎬у瓙鐪嬪埌浜嗚繖閲岋紝閭d箞鍐嶅洖鍒板笘瀛愭渶寮濮嬬湅鐪嬫垜鐨勬葷粨鍚э紒</p> <img src ="http://www.shnenglu.com/zybdebug/aggbug/96214.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/zybdebug/" target="_blank">zyb_debug</a> 2009-09-15 14:35 <a href="http://www.shnenglu.com/zybdebug/archive/2009/09/15/96214.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹屽杽Camera綾?/title><link>http://www.shnenglu.com/zybdebug/archive/2009/09/14/96159.html</link><dc:creator>zyb_debug</dc:creator><author>zyb_debug</author><pubDate>Mon, 14 Sep 2009 12:59:00 GMT</pubDate><guid>http://www.shnenglu.com/zybdebug/archive/2009/09/14/96159.html</guid><wfw:comment>http://www.shnenglu.com/zybdebug/comments/96159.html</wfw:comment><comments>http://www.shnenglu.com/zybdebug/archive/2009/09/14/96159.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/zybdebug/comments/commentRss/96159.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/zybdebug/services/trackbacks/96159.html</trackback:ping><description><![CDATA[//=========================================<br>   /**<br>   嬈¤綆楁柟娉?br>   right鍚戦噺鐨剏鍒嗛噺濮嬬粓鏄?<br>   */<br>//=========================================<br><br>鍦–amera綾誨姞浜嗕竴涓紝浠ヨ嚜韜綅緗拰鐩爣浣嶇疆璁$畻look,up,right鍚戦噺鐨勫嚱鏁?br>void zybCamera::setPositionAndTarget(D3DXVECTOR3* pos,D3DXVECTOR3* target)<br>{<br>   _pos = *pos;<br>   D3DXVECTOR3 look = *target - *pos;<br>   D3DXVec3Normalize(&look,&look);<br>   _look = look; <p>   _right.y = 0;<br>   //姝e悜鏃嬭漿90°錛屾兂鎯寵嚜宸卞墠鏂規槸鍓嶅悜閲忥紝鍙堝悜閲忚嚜鐒朵負鍓嶅悜閲忔棆杞?0<br>   _right.x = look.z;<br>   _right.z = -look.x;<br>   D3DXVec3Normalize(&_right,&_right);</p> <p>   D3DXVec3Cross(&_up, &_look, &_right);<br>   D3DXVec3Normalize(&_up, &_up);</p> <p><br>}</p> <img src ="http://www.shnenglu.com/zybdebug/aggbug/96159.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/zybdebug/" target="_blank">zyb_debug</a> 2009-09-14 20:59 <a href="http://www.shnenglu.com/zybdebug/archive/2009/09/14/96159.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎵╁厖瀹岃礬寰勫簱http://www.shnenglu.com/zybdebug/archive/2009/09/14/96100.htmlzyb_debugzyb_debugMon, 14 Sep 2009 03:56:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/14/96100.htmlhttp://www.shnenglu.com/zybdebug/comments/96100.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/14/96100.html#Feedback8http://www.shnenglu.com/zybdebug/comments/commentRss/96100.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/96100.htmlhttp://hi.baidu.com/zyb_debug/blog/item/87a5d6c3072f8c3fe4dd3b2a.html
鑺變簡涓涓棭涓婄殑鏃墮棿錛岀粓浜庡皢璺緞搴撴墿鍏呭畬姣曘?/p>

鍐嶆鎰熷徆涓涓婣nimation 閭f湰涔﹀疄鍦ㄦ槸澶ソ浜嗐?/p>

閫斾腑鐨勮尪澹朵細鎸夌収鑷繁鍦ㄥ閮ㄦ枃浠朵腑瀹氫箟鐨勮礬寰勮蛋錛屾湁鐩寸嚎錛屾湁鏇茬嚎銆?/p>

澶栭儴txt鏄繖鏍峰畾涔夌殑

xof 0303txt 0032

template Path {
<F8569BED-53B6-4923-AF0B-59A09271D556>
DWORD Type;        // 0=straight, 1=curved
Vector Start;
Vector Point1;
Vector Point2;
Vector End;
}

template Route {
<18AA1C92-16AB-47a3-B002-6178F9D2D12F>
DWORD NumPaths;
array Path Paths[NumPaths];
}

Route Robot {
5; // 5 paths

0; // Straight path type
0.0, 10.0,   0.0; // Start
0.0, 10.0,   0.0; // Unused
0.0, 10.0,   0.0; // Unused
0.0, 10.0, 150.0;, // End

1; // Curved path type
    0.0, 10.0, 150.0; // Start
   75.0, 10.0, 150.0; // Point1
150.0, 10.0, 75.0; // Point2
150.0, 10.0,   0.0;, // End

1; // Curved path type
150.0, 10.0,    0.0; // Start
150.0, 10.0, -75.0; // Point1
   75.0, 10.0, -150.0; // Point2
    0.0, 10.0, -150.0;, // End

0; // Straight path type
     0.0, 10.0, -150.0; // Start
     0.0, 10.0,    0.0; // Unused
     0.0, 10.0,    0.0; // Unused
-150.0, 10.0,   75.0;, // End

0; // Straight path type
-150.0, 10.0, 75.0; // Start
     0.0, 10.0,   0.0; // Unused
     0.0, 10.0,   0.0; // Unused
     0.0, 10.0,   0.0;; // End
}

鐒跺悗鐢ㄤ釜綾昏В鏋愶紝鏍規嵁鏃墮棿鎻掑煎氨琛屼簡銆?br>



zyb_debug 2009-09-14 11:56 鍙戣〃璇勮
]]>
LoadMesh and DrawMeshhttp://www.shnenglu.com/zybdebug/archive/2009/09/12/96004.htmlzyb_debugzyb_debugSat, 12 Sep 2009 08:04:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/12/96004.htmlhttp://www.shnenglu.com/zybdebug/comments/96004.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/12/96004.html#Feedback1http://www.shnenglu.com/zybdebug/comments/commentRss/96004.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/96004.htmlhttp://hi.baidu.com/zyb_debug/blog/item/d2ee04171d48ab5bf2de32d7.html
鍒╃敤涓婄瘒鏂囩珷鐨凞3DXMESHCONTAINER_EX錛孡oadMesh鍜孌rawMesh閮芥槸綆鍗曠殑鍩虹綾誨嚱鏁幫紝
浠ュ悗灝變笉鐢ㄦ瘡嬈¤澆鍏ョ殑鏃跺欓兘鍐欓偅涓澶у爢騫沖嚒鐨勪唬鐮併?br>

HRESULT LoadMesh(
        D3DXMESHCONTAINER_EX 
**ppMesh, 
        IDirect3DDevice9 
*pDevice, 
        
char *Filename, char *TexturePath /* =  */,
        DWORD NewFVF 
/* = 0 */, DWORD LoadFlags /* = D3DXMESH_SYSTEMMEM */
        )
    {

        ID3DXMesh 
*pLoadMesh = NULL;
        HRESULT hr;

        
// Error checking
        if(!ppMesh || !pDevice || !Filename || !TexturePath)
            
return E_FAIL;

        
// Use system memory if converting FVF
        DWORD TempLoadFlags = LoadFlags;
        
if(NewFVF)
            TempLoadFlags 
= D3DXMESH_SYSTEMMEM;

        
// Load the mesh using D3DX routines
        ID3DXBuffer *MaterialBuffer = NULL, *AdjacencyBuffer = NULL;
        DWORD NumMaterials;
        
if(FAILED(hr=D3DXLoadMeshFromXA(Filename, TempLoadFlags,
            pDevice, 
&AdjacencyBuffer,
            
&MaterialBuffer, NULL,
            
&NumMaterials, &pLoadMesh)))
            
return hr;

        
// Convert to new FVF first as needed
        if(NewFVF) {
            ID3DXMesh 
*pTempMesh;

            
// Use CloneMeshFVF to convert mesh
            if(FAILED(hr=pLoadMesh->CloneMeshFVF(LoadFlags, NewFVF, pDevice, &pTempMesh))) {
                ReleaseCOM(AdjacencyBuffer);
                ReleaseCOM(MaterialBuffer);
                ReleaseCOM(pLoadMesh);
                
return hr;
            }

            
// Free prior mesh and store new pointer
            ReleaseCOM(pLoadMesh);
            pLoadMesh 
= pTempMesh; pTempMesh = NULL;
        }

        
// Allocate a D3DXMESHCONTAINER_EX structure
        D3DXMESHCONTAINER_EX *pMesh = new D3DXMESHCONTAINER_EX();
        
*ppMesh = pMesh;

        
// Store mesh name (filename), type, and mesh pointer
        pMesh->Name = _strdup(Filename);
        pMesh
->MeshData.Type = D3DXMESHTYPE_MESH;
        pMesh
->MeshData.pMesh = pLoadMesh; pLoadMesh = NULL;

        
// Store adjacency buffer
        DWORD AdjSize = AdjacencyBuffer->GetBufferSize();
        
if(AdjSize) {
            pMesh
->pAdjacency = new DWORD[AdjSize];
            memcpy(pMesh
->pAdjacency, AdjacencyBuffer->GetBufferPointer(), AdjSize);
        }
        ReleaseCOM(AdjacencyBuffer);

        
// Build material list
        if(!(pMesh->NumMaterials = NumMaterials)) {

            
// Create a default material
            pMesh->NumMaterials = 1;
            pMesh
->pMaterials   = new D3DXMATERIAL[1];
            pMesh
->pTextures    = new IDirect3DTexture9*[1];

            ZeroMemory(pMesh
->pMaterials, sizeof(D3DXMATERIAL));
            pMesh
->pMaterials[0].MatD3D.Diffuse.r = 1.0f;
            pMesh
->pMaterials[0].MatD3D.Diffuse.g = 1.0f;
            pMesh
->pMaterials[0].MatD3D.Diffuse.b = 1.0f;
            pMesh
->pMaterials[0].MatD3D.Diffuse.a = 1.0f;
            pMesh
->pMaterials[0].MatD3D.Ambient   = pMesh->pMaterials[0].MatD3D.Diffuse;
            pMesh
->pMaterials[0].MatD3D.Specular  = pMesh->pMaterials[0].MatD3D.Diffuse;
            pMesh
->pMaterials[0].pTextureFilename = NULL;
            pMesh
->pTextures[0]                   = NULL;

        } 
else {

            
// Load the materialsx

            D3DXMATERIAL 
*Materials = (D3DXMATERIAL*)MaterialBuffer->GetBufferPointer();
            pMesh
->pMaterials = new D3DXMATERIAL[pMesh->NumMaterials];
            pMesh
->pTextures  = new IDirect3DTexture9*[pMesh->NumMaterials];

            
for(DWORD i=0;i<pMesh->NumMaterials;i++) {
                pMesh
->pMaterials[i].MatD3D = Materials[i].MatD3D;
                pMesh
->pMaterials[i].MatD3D.Ambient = pMesh->pMaterials[i].MatD3D.Diffuse;

                
// Load the texture if one exists
                pMesh->pTextures[i] = NULL;
                
if(Materials[i].pTextureFilename) {
                    
char TextureFile[MAX_PATH];
                    sprintf_s(TextureFile,MAX_PATH, 
"%s%s", TexturePath, 
                        Materials[i].pTextureFilename);
                    D3DXCreateTextureFromFileA(pDevice,
                        TextureFile,
                        
&pMesh->pTextures[i]);
                }
            }
        }
        ReleaseCOM(MaterialBuffer);

        
// Optimize the mesh for better attribute access
        pMesh->MeshData.pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, NULL, NULL, NULL, NULL);

        
// Clear pMesh pointer just in case
        pMesh = NULL;

        
return S_OK;

    }

    
// Draw the first mesh in a linked list of objects
    HRESULT DrawMesh(D3DXMESHCONTAINER_EX *pMesh)
    {

        IDirect3DDevice9 
*pD3DDevice;
        DWORD LastState, OldAlphaState, OldSrcBlend, OldDestBlend;

        
// Error checking
        if(!pMesh)
            
return E_FAIL;
        
if(!pMesh->MeshData.pMesh)
            
return E_FAIL;
        
if(!pMesh->NumMaterials || !pMesh->pMaterials)
            
return E_FAIL;

        
// Get the device interface
        pMesh->MeshData.pMesh->GetDevice(&pD3DDevice);

        
// Release vertex shader if being used
        pD3DDevice->SetVertexShader(NULL);
        pD3DDevice
->SetVertexDeclaration(NULL);

        
// Save render states
        pD3DDevice->GetRenderState(D3DRS_ALPHABLENDENABLE, &OldAlphaState);
        pD3DDevice
->GetRenderState(D3DRS_SRCBLEND, &OldSrcBlend);
        pD3DDevice
->GetRenderState(D3DRS_DESTBLEND, &OldDestBlend);
        LastState 
= OldAlphaState;

        
// Setup pointer for mesh to draw, either regular or skinned
        ID3DXMesh *pDrawMesh = (!pMesh->pSkinMesh)?pMesh->MeshData.pMesh:pMesh->pSkinMesh;

        
// Look through all subsets
        for(DWORD i=0;i<pMesh->NumMaterials;i++) {

            
// Set material and texture
            pD3DDevice->SetMaterial(&pMesh->pMaterials[i].MatD3D);
            pD3DDevice
->SetTexture(0, pMesh->pTextures[i]);

            
// Enable or disable alpha blending per material
            if(pMesh->pMaterials[i].MatD3D.Diffuse.a != 1.0f) {
                
if(LastState != TRUE) {
                    LastState 
= TRUE;
                    pD3DDevice
->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
                    pD3DDevice
->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);//SRCCOLOR);
                    pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR);
                }
            } 
else {
                
if(LastState != FALSE) {
                    LastState 
= FALSE;
                    pD3DDevice
->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
                }
            }

            
// Draw the mesh subset
            pDrawMesh->DrawSubset(i);
        }

        
// Restore alpha blending states
        if(LastState != OldAlphaState) {
            pD3DDevice
->SetRenderState(D3DRS_ALPHABLENDENABLE, OldAlphaState);
            pD3DDevice
->SetRenderState(D3DRS_SRCBLEND, OldSrcBlend);
            pD3DDevice
->SetRenderState(D3DRS_DESTBLEND, OldDestBlend);
        }

        
// Make sure to release the device object!
        pD3DDevice->Release();

        
// Return success
        return S_OK;

    }


zyb_debug 2009-09-12 16:04 鍙戣〃璇勮
]]>
鎵╁厖D3DXMESHCONTAINER鍜孌3DXFramehttp://www.shnenglu.com/zybdebug/archive/2009/09/11/95962.htmlzyb_debugzyb_debugFri, 11 Sep 2009 13:51:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/11/95962.htmlhttp://www.shnenglu.com/zybdebug/comments/95962.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/11/95962.html#Feedback0http://www.shnenglu.com/zybdebug/comments/commentRss/95962.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/95962.htmlhttp://hi.baidu.com/zyb_debug/blog/item/cb3fe2ca9ca3f015bf09e682.html

寮濮嬩簡Advanced Animation with DirectX鐨勯槄璇?br>鍩虹綾誨簱鐨勬瀯寤烘槸閲嶈鐨?榪囧悗鎵撶畻鎶婂畠浠姞鍏ユ垜鐨剒ybToos鐨凢ramework閲屻?br>浠g爜鏉ヨ嚜涔︿腑

#ifndef ZYBANIMATIONTOOLS_H

#define ZYBANIMATIONTOOLS_H

#include 
"DXUT.h"

//=========================================
    /**
    鎵╁厖D3DXMESHCONTAINER
    鎵╁厖D3DXFrame
    
*/
//=========================================


namespace zyb
{

    
#define ReleaseCOM(x) { if(x!=NULL) x->Release(); x=NULL; }

    
// Declare an extended version of D3DXFRAME
    
// that contains a constructor and destructor
    
// as well as a combined transformation matrix
    struct D3DXFRAME_EX : D3DXFRAME 
    {
        D3DXMATRIX matCombined;   
// Combined matrix
        D3DXMATRIX matOriginal;   // Original transformation from .X

        D3DXFRAME_EX()
        {
            Name 
= NULL;
            pMeshContainer 
= NULL;
            pFrameSibling 
= pFrameFirstChild = NULL;
            D3DXMatrixIdentity(
&matCombined);
            D3DXMatrixIdentity(
&matOriginal);
            D3DXMatrixIdentity(
&TransformationMatrix);
        }

        
~D3DXFRAME_EX()
        { 
            delete [] Name;          Name 
= NULL;
            delete pFrameSibling;    pFrameSibling 
= NULL;
            delete pFrameFirstChild; pFrameFirstChild 
= NULL;
        }

        
// Function to scan hierarchy for matching frame name
        D3DXFRAME_EX *Find(const char *FrameName)
        {
            D3DXFRAME_EX 
*pFrame, *pFramePtr;

            
// Return this frame instance if name matched
            if(Name && FrameName && !strcmp(FrameName, Name))
                
return this;

            
// Scan siblings
            if((pFramePtr = (D3DXFRAME_EX*)pFrameSibling)) {
                
if((pFrame = pFramePtr->Find(FrameName)))
                    
return pFrame;
            }

            
// Scan children
            if((pFramePtr = (D3DXFRAME_EX*)pFrameFirstChild)) {
                
if((pFrame = pFramePtr->Find(FrameName)))
                    
return pFrame;
            }

            
// Return none found
            return NULL;
        }

        
// Reset transformation matrices to originals
        void Reset()
        {
            
// Copy original matrix
            TransformationMatrix = matOriginal;

            
// Reset sibling frames
            D3DXFRAME_EX *pFramePtr;
            
if((pFramePtr = (D3DXFRAME_EX*)pFrameSibling))
                pFramePtr
->Reset();

            
// Reset child frames
            if((pFramePtr = (D3DXFRAME_EX*)pFrameFirstChild))
                pFramePtr
->Reset();
        }

        
// Function to combine matrices in frame hiearchy
        void UpdateHierarchy(D3DXMATRIX *matTransformation = NULL)
        {
            D3DXFRAME_EX 
*pFramePtr;
            D3DXMATRIX matIdentity;

            
// Use an identity matrix if none passed
            if(!matTransformation) {
                D3DXMatrixIdentity(
&matIdentity);
                matTransformation 
= &matIdentity;
            }

            
// Combine matrices w/supplied transformation matrix
            matCombined = TransformationMatrix * (*matTransformation);

            
// Combine w/sibling frames
            if((pFramePtr = (D3DXFRAME_EX*)pFrameSibling))
                pFramePtr
->UpdateHierarchy(matTransformation);

            
// Combine w/child frames
            if((pFramePtr = (D3DXFRAME_EX*)pFrameFirstChild))
                pFramePtr
->UpdateHierarchy(&matCombined);
        }

        
void Count(DWORD *Num)
        {
            
// Error checking
            if(!Num)
                
return;

            
// Increase count of frames
            (*Num)+=1;

            
// Process sibling frames
            D3DXFRAME_EX *pFrame;
            
if((pFrame=(D3DXFRAME_EX*)pFrameSibling))
                pFrame
->Count(Num);

            
// Process child frames
            if((pFrame=(D3DXFRAME_EX*)pFrameFirstChild))
                pFrame
->Count(Num);
        }
    };

    
// Declare an extended version of D3DXMESHCONTAINER
    
// that contains a constructor and destructor
    
// as well as an array of textures, a mesh object
    
// that contains the generated skin mesh, and 
    
// matrices that map to the frame hierarchy's and
    
// for updating bones.
    struct D3DXMESHCONTAINER_EX : D3DXMESHCONTAINER
    {
        IDirect3DTexture9 
**pTextures;
        ID3DXMesh          
*pSkinMesh;

        D3DXMATRIX        
**ppFrameMatrices;
        D3DXMATRIX         
*pBoneMatrices;

        D3DXMESHCONTAINER_EX()
        {
            Name               
= NULL;
            MeshData.pMesh     
= NULL;
            pMaterials         
= NULL;
            pEffects           
= NULL;
            NumMaterials       
= 0;
            pAdjacency         
= NULL;
            pSkinInfo          
= NULL;
            pNextMeshContainer 
= NULL;
            pTextures          
= NULL;
            pSkinMesh          
= NULL;
            ppFrameMatrices    
= NULL;
            pBoneMatrices      
= NULL;
        }

        
~D3DXMESHCONTAINER_EX()
        {
            
if(pTextures && NumMaterials) {
                
for(DWORD i=0;i<NumMaterials;i++)
                    ReleaseCOM(pTextures[i]);
            }
            delete [] pTextures;       pTextures 
= NULL;
            NumMaterials 
= 0;

            delete [] Name;            Name 
= NULL;
            delete [] pMaterials;      pMaterials 
= NULL;
            delete pEffects;           pEffects 
= NULL;

            delete [] pAdjacency;      pAdjacency 
= NULL;
            delete [] ppFrameMatrices; ppFrameMatrices 
= NULL;
            delete [] pBoneMatrices;   pBoneMatrices 
= NULL;

            ReleaseCOM(MeshData.pMesh);
            ReleaseCOM(pSkinInfo);
            ReleaseCOM(pSkinMesh);

            delete pNextMeshContainer; pNextMeshContainer 
= NULL;
        }

        D3DXMESHCONTAINER_EX 
*Find(char *MeshName)
        {
            D3DXMESHCONTAINER_EX 
*pMesh, *pMeshPtr;

            
// Return this mesh instance if name matched
            if(Name && MeshName && !strcmp(MeshName, Name))
                
return this;

            
// Scan next in list
            if((pMeshPtr = (D3DXMESHCONTAINER_EX*)pNextMeshContainer)) {
                
if((pMesh = pMeshPtr->Find(MeshName)))
                    
return pMesh;
            }

            
// Return none found
            return NULL;
        }
    };

    

    








}


#endif


zyb_debug 2009-09-11 21:51 鍙戣〃璇勮
]]>
涓婅嚜涔?/title><link>http://www.shnenglu.com/zybdebug/archive/2009/09/10/95857.html</link><dc:creator>zyb_debug</dc:creator><author>zyb_debug</author><pubDate>Thu, 10 Sep 2009 14:15:00 GMT</pubDate><guid>http://www.shnenglu.com/zybdebug/archive/2009/09/10/95857.html</guid><wfw:comment>http://www.shnenglu.com/zybdebug/comments/95857.html</wfw:comment><comments>http://www.shnenglu.com/zybdebug/archive/2009/09/10/95857.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/zybdebug/comments/commentRss/95857.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/zybdebug/services/trackbacks/95857.html</trackback:ping><description><![CDATA[<p><a >http://hi.baidu.com/zyb_debug/blog/item/e7072b10295eb074cb80c42a.html</a><br>ogre鐨勫己澶ц鎴戝繊涓嶄綇鎯崇敤瀹冦?/p> <p>榪欏嚑澶╁揩瑕佺湅瀹岄偅鏈功浜嗭紝榪樺墿鍔ㄦ侀槾褰卞拰2D銆傛槑澶╁簲璇ュ氨鍙互瀹岀粨浜嗐?/p> <p>緙栫▼涔嬬編鐪嬩簡緇鍓嶉潰寮曡█錛屾垜鍙戠幇2騫存潵鎴戝拷瑙嗕簡涓涓噸瑕佺殑涓滆タ灝辨槸綆楁硶銆傚垢濂芥垜鍦ㄥぇ涓夎繖涓騫村垰寮濮嬪彂鐜頒簡銆?/p> <p>DirectX涓熀紜榪樻湁Animation涓嶅お鎳傦紝涓嶈繃鎴戝凡緇忔墦鍗頒簡Advanced Animation with DirectX9銆?/p> <p>鍚潃MP3涓婇煶涔愬ぉ鍫傘嬬簿閫夛紝瀛︿範瀹屽悗璧板湪澶у鐨勮礬涓娿?/p> <p>鎰熻紱葷鏄姝ょ殑榪?...</p> <img src ="http://www.shnenglu.com/zybdebug/aggbug/95857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/zybdebug/" target="_blank">zyb_debug</a> 2009-09-10 22:15 <a href="http://www.shnenglu.com/zybdebug/archive/2009/09/10/95857.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹炰綔ADTvector2 vector3 vector4 matrix44 matrix33http://www.shnenglu.com/zybdebug/archive/2009/09/08/95543.htmlzyb_debugzyb_debugTue, 08 Sep 2009 02:46:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/08/95543.htmlhttp://www.shnenglu.com/zybdebug/comments/95543.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/08/95543.html#Feedback4http://www.shnenglu.com/zybdebug/comments/commentRss/95543.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/95543.html闃呰鍏ㄦ枃

zyb_debug 2009-09-08 10:46 鍙戣〃璇勮
]]>
鍏充簬while(cin)http://www.shnenglu.com/zybdebug/archive/2009/09/06/95409.htmlzyb_debugzyb_debugSun, 06 Sep 2009 06:38:00 GMThttp://www.shnenglu.com/zybdebug/archive/2009/09/06/95409.htmlhttp://www.shnenglu.com/zybdebug/comments/95409.htmlhttp://www.shnenglu.com/zybdebug/archive/2009/09/06/95409.html#Feedback3http://www.shnenglu.com/zybdebug/comments/commentRss/95409.htmlhttp://www.shnenglu.com/zybdebug/services/trackbacks/95409.htmlhttp://hi.baidu.com/zyb_debug/blog/item/cdfc2adf9b982451cdbf1a7e.html
streams瀹氫箟浜嗕袱涓彲鐢ㄤ簬甯冨皵琛ㄨ揪寮忕殑鍑芥暟

operator void*()   鎰忎箟錛歴tream鏄惁鍑洪敊錛堢浉褰撲簬!fail()錛?br>operator !()       鎰忎箟錛歴tream鏄惁宸插嚭閿欙紙鐩稿綋浜巉ail()錛?/p>

鎴戜滑鍙互榪愮敤operator void*()鍦ㄦ帶鍒剁粨鏋勪腑綆媧佹祴鍑簊tream鐨勫綋鍓嶇姸鎬?

while (std::cin)
{
}
鎺у埗緇撴瀯涓殑甯冨皵鏉′歡鍊煎茍涓嶆槸闈炲緱鐩存帴杞崲涓篵ool涓嶅彲錛屽彧瑕佽兘澶熻漿鎹負鏌愪釜鏁存暟鍨嬪埆鎴栨寚閽堝瀷鍒氨澶熶簡銆?br>杞崲涓簐oid* 甯稿父鏄負浜嗗湪鍚屼竴琛ㄨ揪寮忎腑璇誨叆瀵硅薄騫舵祴璇曟槸鍚︽垚鍔燂細

if(std::cin>> x)
{
//reading x was successful
}
姝e鍏堝墠鐨勮璁猴紝琛ㄨ揪寮?br>std::cin >> x
浼氳繑鍥瀋in錛屾墍浠ヨ鍏鍚庯紝涓婅堪璇彞鍙樹負
if(std::cin)
{
}

姝ゆ椂鐨刢in琚敤浜庢潯浠跺垽鏂?鎵浠in浼氳皟鐢?operator void*,榪斿洖"stream鏄惁鍙戠敓閿欒"

浠ヤ笂鎶鏈殑鍑犱釜鍏稿瀷搴旂敤灝辨槸浠ュ驚鐜鍏ュ璞″茍澶勭悊
while(std::cin >> obj)
{
std:: cout << obj << std::endl;
}

濡傛灉failbit鎴朾adbit琚绔嬶紝璇ュ驚鐜氨绔嬪嵆涓---鍑虹幇閿欒鎴栬呰鍒?end-of-file).

鎴戜滑鍙互鍒╃敤operator!榪涜鐩稿弽嫻嬭瘯錛屽畠浼氳繑鍥?strean鏄惁宸插彂鐢熼敊璇?錛屼篃灝辨槸璇村鏋渇ailbit 鎴朾adbit琚绔嬪氨浼氳繑鍥瀟rue鐢ㄦ硶濡備笅:
if(!std::cin)
{
//the stream is not OK
}

涓婅堪鏂囧瓧鍑轟簬 <<c++鏍囧噯紼嬪簭搴?鑷慨鏁欑▼涓庡弬鑰冩墜鍐?>>p600 渚嵎-瀛熷博璇?/p>

鑺變簡鍑犲ぉ鏃墮棿緇堜簬灝嗚繖鏈功闃呰瀹屼簡錛岄噷闈㈢殑streambuf娌℃湁鐞嗚В錛屾槸鎴戝姛搴曚笉澶熺殑緙樻晠鍚?..
寮瀛︿簡錛屼漢澶氫簡璧鋒潵錛岀戶緇潤闈欑殑瀛︿範



zyb_debug 2009-09-06 14:38 鍙戣〃璇勮
]]>
亚洲国产成人久久精品99 | 久久高清一级毛片| 91久久精品国产成人久久| 国产亚洲综合久久系列| 9久久9久久精品| 久久久久国产一区二区三区| 久久久亚洲裙底偷窥综合| 狠狠综合久久综合88亚洲| 免费久久人人爽人人爽av| 久久66热人妻偷产精品9| 欧美大香线蕉线伊人久久| 久久伊人精品青青草原高清| 久久综合日本熟妇| 久久久久久毛片免费播放| 国内精品久久久久影院网站| 91久久精品国产91性色也| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 99久久无码一区人妻| 丁香五月综合久久激情| 99热成人精品免费久久| 久久久久久青草大香综合精品| 久久乐国产精品亚洲综合| 亚洲精品无码专区久久同性男| 久久人人爽人人爽人人片AV高清| 亚洲人成无码网站久久99热国产| 亚洲国产欧洲综合997久久| 久久久久人妻精品一区三寸蜜桃| 青青草原综合久久大伊人导航 | 一本久道久久综合狠狠爱| 久久99国产精品久久99| 综合网日日天干夜夜久久 | 久久人人爽人人人人片av| www久久久天天com| 久久综合精品国产一区二区三区| 伊人久久综合精品无码AV专区| 久久99国产精品久久99果冻传媒| 精品99久久aaa一级毛片| 伊人色综合久久天天人手人婷| 亚洲综合久久综合激情久久| 狠狠综合久久AV一区二区三区 | 久久99久久99小草精品免视看|