锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久久性,亚洲美女精品久久,国产精品亚洲欧美 http://m.shnenglu.com/billhsu/category/7690.htmlzh-cn Thu, 23 Jun 2011 13:22:17 GMT Thu, 23 Jun 2011 13:22:17 GMT 60 Android娓告垙璁℃椂 http://m.shnenglu.com/billhsu/archive/2011/01/30/139627.htmlBill Hsu Bill Hsu Sun, 30 Jan 2011 15:16:00 GMT http://m.shnenglu.com/billhsu/archive/2011/01/30/139627.html http://m.shnenglu.com/billhsu/comments/139627.html http://m.shnenglu.com/billhsu/archive/2011/01/30/139627.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/139627.html http://m.shnenglu.com/billhsu/services/trackbacks/139627.html http://androgeek.info/?p=299 浠ュ墠浠g爜緇忛獙寰堝閮芥槸鍩轟簬windows鐨勶紝鎵浠ュandroid涓嬮潰鐨勮鏃跺嚱鏁頒笉鏄お浜嗚В銆?br> 鍦ㄥ啓Friut3D 鏃訛紝鎴戠敤鐨勪唬鐮佹槸鐢╣ettimeofday()鏉ヨ鏃剁殑銆備絾鏄晥鏋滀笉濂斤紝娓告垙閲屾湁涓満鏅窇璧鋒潵鍗佸垎鍗★紝acepig鍏勫拰鎴戦兘瑙夊緱榪欎釜闂寰堣寮傘傚紑濮嬭寰楄繖鏄ā鍨嬬殑闂錛岀幇鍦ㄧ湅鏉ユ槸璁℃椂鍑芥暟涓嶇簿紜児寰楃ジ銆?br> 鐪嬬湅褰撴椂鍐欑殑鑾峰彇緋葷粺鏃墮棿鐨勪唬鐮侊細
static long getTime( void ) { gettimeofday( & now, NULL); return ( long )(now.tv_sec * 1000 + now.tv_usec / 1000 ); }
浠婂ぉ鍦ㄤ竴涓猤oogle璁ㄨ緇勯噷寰楃煡gettimeofday()璁板緱鐨則ick鏄笉鍑嗙‘鐨勩傝岃繖涓父鎴忛昏緫渚濊禆浜巘ime delta鏉ヨ綆楀悇涓墿浣撹繍鍔紝璁℃椂涓嶇簿紜紝娓叉煋鑷劧浼氬崱欏褲?br> 浜庢槸鐢ㄧ撼縐掔駭鐨勫噯紜害鐨刢lock_gettime()閲嶅啓浜唃etTime()鍑芥暟錛?br>
static long _getTime( void ) { struct timespec now; clock_gettime(CLOCK_MONOTONIC, & now); return now.tv_sec * 1000000 + now.tv_nsec / 1000 ; }
鏀逛簡璁℃椂鍑芥暟鍚庯紝娓告垙鍚勪釜鍦烘櫙閮芥祦鐣呬簡銆?br> ]]> 楠ㄩ鍔ㄧ敾涓殑鍙嶅悜鍔ㄥ姏瀛?/title> http://m.shnenglu.com/billhsu/archive/2010/08/26/124852.htmlBill Hsu Bill Hsu Thu, 26 Aug 2010 09:29:00 GMT http://m.shnenglu.com/billhsu/archive/2010/08/26/124852.html http://m.shnenglu.com/billhsu/comments/124852.html http://m.shnenglu.com/billhsu/archive/2010/08/26/124852.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/124852.html http://m.shnenglu.com/billhsu/services/trackbacks/124852.html IK鍦ㄩ楠煎姩鐢婚噷甯稿父鑳界湅鍒幫紝浣滅敤灝辨槸鏍規(guī)嵁瀛愰楠肩殑鏂逛綅鎺ㄧ畻鍑哄畠鐨勯偅浜涚埗楠ㄩ鏂逛綅銆傚彲鏄竴鐩撮兘鏄煡閬撴湁閭d箞鍥炰簨錛屼絾鏄張涓嶅お鐭ラ亾鍏蜂綋鏄庝箞瀹炵幇鐨勩?br />鍦╩ulti-crash.com涓婄湅鍒頒竴綃?a target="_blank" >楠ㄩ鍔ㄧ敾鍙嶅悜鍔ㄥ姏瀛?IK)鐨勫疄鐜?nbsp; 錛屽唴瀹瑰啓鐨勫緢鏄撴噦銆?br />榪欐槸鍩轟簬CCD(Cyclic Coordinate Descent)綆楁硶鐨勩傝繕鏈夌闆呭彲姣旂煩闃電殑綆楁硶錛屼笉榪囪繖縐嶇畻娉曟垜榪樹笉澶竻妤氾紝甯屾湜楂樻墜鎸囨暀鍟娿?br />涓嬮潰璁茶CCD錛屽厛鐪嬭繖寮犲浘銆?br /> 娉ㄦ剰鍥句腑鐨勭孩綰垮拰緇跨嚎錛岀孩綰挎槸褰撳墠楠ㄩ涓庣洰鏍囬楠肩殑榪炵嚎錛岀豢綰挎槸鐩爣楠ㄩ涓庢渶緇堜綅緗殑榪炵嚎銆?br />浠庡瓙楠ㄩ鍒扮埗楠ㄩ鐨勯『搴忚凱浠h綆楋紝鏃嬭漿綰㈢嚎鍒扮豢綰褲傝繖鏍峰榪唬鍑犳灝變細寰楀埌杈冨ソ鐨勭粨鏋溿?br /> 瑕佹敞鎰忕殑鏄渶瑕佸楠ㄩ鐨勬棆杞寖鍥村姞浠ラ檺鍒訛紝鍥犱負浜轟綋鐨勫叧鑺備笉鏄互鍙互浠繪剰鏂瑰紡鏃嬭漿鐨勩?br /> [渚嬪鍥句腑钃濊壊閮ㄥ垎涓哄彲浠ユ棆杞殑鑼冨洿] ]]> Android NDK 寮鍙慜penGL ES 2.0涓浜涙敞鎰忕偣 http://m.shnenglu.com/billhsu/archive/2010/08/10/122914.htmlBill Hsu Bill Hsu Tue, 10 Aug 2010 03:37:00 GMT http://m.shnenglu.com/billhsu/archive/2010/08/10/122914.html http://m.shnenglu.com/billhsu/comments/122914.html http://m.shnenglu.com/billhsu/archive/2010/08/10/122914.html#Feedback 1 http://m.shnenglu.com/billhsu/comments/commentRss/122914.html http://m.shnenglu.com/billhsu/services/trackbacks/122914.html 鑷繁涔熻瘯浜嗚瘯鐢∟DK緙栦竴涓狾penGL ES 2.0鐨勭▼搴忥紝鍙槸錛岀紪璇戠殑鏃跺欏嚭鐜頒簡涓澶у爢閿欍?br> 濡傚浘錛屾弧灞忓箷閮芥槸 undefined reference to 閭d簺OpenGL ES鍑芥暟銆?br>鐪嬫潵鏄簱鏂囦歡娌℃湁閾炬帴榪涙潵銆?br> 榪欐槸NDK渚嬪瓙閲岀殑Android.mk鐨勫啓娉曪細
LOCAL_PATH: = $(call my - dir) include $(CLEAR_VARS) LOCAL_MODULE : = libgl2jni LOCAL_CFLAGS : = - Werror LOCAL_SRC_FILES : = gl_code.cppLOCAL_LDLIBS : = -llog - lGLESv2 include $(BUILD_SHARED_LIBRARY)
闂灝卞嚭鍦ㄧ敤綰㈣壊鏍囧嚭鐨勯偅琛屻?br> 鎶婇偅鍙ヤ慨鏀逛負錛?br>
LOCAL_LDLIBS : = - L$(SYSROOT) / usr / lib - llog LOCAL_LDLIBS +=- L$(SYSROOT) / usr / lib - lGLESv2
灝卞彲浠ユ甯哥紪璇戜簡銆?br> 榪樻湁涓浜涙敞鎰忕偣鏄細 緙栬瘧紼嬪簭鍓嶈clean錛屽惁鍒欑紪璇戜細鍑洪敊錛?br>姣忔鏇存柊浜嗚嚜宸辯殑.so鏂囦歡鍚庯紝鍦╡clipse鐨勯偅涓猨ava欏圭洰閲岃璁扮潃refresh涓涓嬨?br> ]]> 闈犲緱浣忕殑浼戠湢鍑芥暟XSleep http://m.shnenglu.com/billhsu/archive/2010/07/30/121679.htmlBill Hsu Bill Hsu Fri, 30 Jul 2010 02:55:00 GMT http://m.shnenglu.com/billhsu/archive/2010/07/30/121679.html http://m.shnenglu.com/billhsu/comments/121679.html http://m.shnenglu.com/billhsu/archive/2010/07/30/121679.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/121679.html http://m.shnenglu.com/billhsu/services/trackbacks/121679.html 浠婂ぉ鍦╟sdn涓婄湅鍒頒簡涓綃囨枃绔狅細http://blog.csdn.net/lanzhengpeng2/archive/2008/05/06/2401554.aspx 璁茬殑涔熸濂芥槸榪欎釜闂錛岃褰曚竴涓嬨?br> 鍦ㄤ嬌鐢╰imeGetTime()鐨勪唬鐮佸潡鐨勫墠鍚庡姞涓?span class="Apple-style-span" style="border-collapse: separate; color: #000000; font-family: Simsun; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">timeBeginPeriod(1)鍜?/span> timeEndPeriod(1)錛屽氨鍙互鎻愰珮 timeGetTime()鐨勭簿搴︺?br> 鍚屾椂錛屽彲浠ュ埄鐢╰imeSetEvent鍐欎簡涓涓潬寰椾綇鐨勪紤鐪犲嚱鏁癧浠g爜鏉ヨ嚜涓婅堪鏂囩珷]錛?br>
static void XSleep(DWORD dwDelay,HANDLE hEvent) { MMRESULT hTimer = timeSetEvent(dwDelay, 1 ,(LPTIMECALLBACK)hEvent, 0 ,TIME_ONESHOT | TIME_CALLBACK_EVENT_SET); MsgWaitForMultipleObjectsEx( 1 , & hEvent,INFINITE,QS_ALLINPUT, 0 ); // 褰撴湁Windows娑堟伅鏃訛紝榪樿兘緇х畫澶勭悊Windows娑堟伅銆傛晠閫夋嫨浜嗚繖涓嚱鏁般?/span> timeKillEvent(hTimer); }
娑堟伅寰幆[浠g爜鏉ヨ嚜涓婅堪鏂囩珷]錛?br>
MSG msg; DWORD dwLastTime; HANDLE hSleepEvent = CreateEvent(NULL,FALSE,FALSE,NULL); timeBeginPeriod( 1 ); dwLastTime = timeGetTime(); while (isActive()) { // 闇瑕佷竴鐩村鐞哤indows娑堟伅鍒版棤娑堟伅澶勭悊涓烘 for (;PeekMessage( & msg,NULL, 0 , 0 ,PM_REMOVE);) { if (msg.message == WM_QUIT) { CloseHandle(hSleepEvent); timeEndPeriod( 1 ); return ; } if ( ! TranslateAccelerator(msg.hwnd,hAccelTable, & msg)) { TranslateMessage( & msg); DispatchMessage( & msg); } } DWORD FrameDelay = max( 1 , 1000 / max( 1 ,GetMaxFPS())); DWORD dwTime = timeGetTime(); if (dwLastTime + FrameDelay > dwTime) { XSleep(dwLastTime + FrameDelay - dwTime,hSleepEvent); } else { update(); dwLastTime += ((dwTime - dwLastTime) / FrameDelay) * FrameDelay; // 褰撳疄闄呭撫鏁頒弗閲嶄綆浜庨鏈熷撫鏁版椂錛岃繖孌典唬鐮佸彲浠ュ畬鎴愯煩甯у姛鑳斤紱褰撳疄闄呭撫鏁板ぇ浜庣瓑浜庨鏈熷撫鏁版椂錛岃繖孌典唬鐮佷粛鐒跺彲浠ヤ嬌甯т箣闂寸殑鏃墮棿闂撮殧鍥哄畾銆備箣鍓嶈阿Boss娌℃湁澶勭悊濂界殑涓昏灝辨槸榪欎釜銆?/span> } } CloseHandle(hSleepEvent); timeEndPeriod( 1 );
榪欐牱錛屾椂闂磋宸氨浼氬湪1ms涔嬪唴浜嗭紝娓告垙涔熷氨涓嶄細鎶栧姩浜嗐?br> ]]> 鍩轟簬shader鐨勯楠艱挋鐨綆?/title> http://m.shnenglu.com/billhsu/archive/2010/04/01/111326.htmlBill Hsu Bill Hsu Thu, 01 Apr 2010 14:10:00 GMT http://m.shnenglu.com/billhsu/archive/2010/04/01/111326.html http://m.shnenglu.com/billhsu/comments/111326.html http://m.shnenglu.com/billhsu/archive/2010/04/01/111326.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/111326.html http://m.shnenglu.com/billhsu/services/trackbacks/111326.html 瀵誨瑙呰錛屾壘鍒頒簡 NVIDIA SDK 鐨別xample錛岀粓浜庤В鍐充簡銆? 闅鵑亾鎴戠殑鏄懼崱涓嶆敮鎸丅LENDINDICES鍜孊LENDWEIGHT?
鎶夿LENDINDICES鍜孊LENDWEIGHT鐢═EXCOORD[n]琛ㄧず鎵嶆甯搞傘? 涓嶈搴熻瘽錛岀洿鎺ヤ笂浠g爜銆?nbsp; 闃呰鍏ㄦ枃 ]]> GPU姘撮潰妯℃嫙 http://m.shnenglu.com/billhsu/archive/2010/03/23/110376.htmlBill Hsu Bill Hsu Tue, 23 Mar 2010 12:59:00 GMT http://m.shnenglu.com/billhsu/archive/2010/03/23/110376.html http://m.shnenglu.com/billhsu/comments/110376.html http://m.shnenglu.com/billhsu/archive/2010/03/23/110376.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/110376.html http://m.shnenglu.com/billhsu/services/trackbacks/110376.html 鏁堟灉姣旇緝綆鍗曪紝鍙槸妯℃嫙浜嗕笅姘撮潰鐨勫弽灝勬晥鏋溿傛姌灝勪笌Fresnel緋繪暟娌℃湁鑰冭檻銆?br /> 姘撮潰妯℃嫙澶ц嚧闇瑕佸垎榪欎箞鍑犳錛?br />1.鍓鎺夋按闈互涓嬬殑欏剁偣[gpu閲岀殑clipplane瑕佹敞鎰忚漿鎹㈠埌Clip Space]錛?br />灝嗘憚鍍忔満鏀懼埌鍚屽師鎽勫儚鏈哄叧浜庢按闈㈠縐扮殑浣嶇疆錛屾瘮濡傚師鏉ユ憚鍍忔満鍦?x,y,z)錛?br />姝ゆ椂灝辮鎶婃憚鍍忔満鏀懼湪(x,-y,z)錛寀p鍚戦噺涔熻璁劇疆鎴愬悜涓嬬殑銆?br />鍐嶆妸鍦烘櫙娓叉煋鍒癛ender Target鐨勭汗鐞嗕笂(鎴戠敤鐨勭汗鐞嗗ぇ灝忔槸256*256)錛屼笉鐭ラ亾涓轟粈涔圧ender Target鐨勭汗鐞嗗ぇ灝忎笉鑳借秴榪囩獥鍙eぇ灝忥紝瓚呰繃鐨勮瘽娓叉煋浼氬嚭閿欙紝鐭ラ亾鐨勫ぇ澶у憡璇夋垜涓涓嬪搱銆?br /> 浜庢槸錛屽氨寰楀埌浜嗚繖鏍蜂竴涓汗鐞嗭細 2.灝嗕笂闈㈠緱鍒扮殑綰圭悊涓庢按闈㈢殑欏剁偣瀵瑰簲. 鎶奦ertex Shader涓箻榪囧彉鎹㈢煩闃靛悗鐨勫潗鏍囦紶鍒癙ixel Shader, 鍦≒S涓綆?br />聽聽 聽聽聽聽 float2 clipspace = input.Coord.xy / input.Coord.w; 聽聽 聽聽聽聽 clipspace.x=((clipspace.x * 0.5f) + 0.5f); 聽聽 聽聽聽聽 clipspace.y = ((clipspace.y * -0.5f) + 0.5f); 聽聽 聽聽聽聽 clipspace.x=1-clipspace.x;
鏃㈠彲浠ヨ姘撮潰欏剁偣涓庣汗鐞嗗搴旓紝鐒跺悗鍐嶆兂鍔炴硶鎶婄汗鐞嗗潗鏍囨壈涔辨潵妯℃嫙姘撮潰娉㈠姩銆?br /> 3.鍐嶆覆鏌撲竴嬈″満鏅氨鍙互浜嗐?br /> 澶у涔熷彲浠ュ弬鑰冧笅Azure鐨勬按闈㈡覆鏌撴簮浠g爜錛?a temp_href=" http://www.azure.com.cn/article.asp?id=186" href="%20http://www.azure.com.cn/article.asp?id=186"> http://www.azure.com.cn/article.asp?id=186 ]]>鍙紪紼嬬閬撲笅鐨勫壀瑁佸鉤闈?/title> http://m.shnenglu.com/billhsu/archive/2010/01/20/106088.htmlBill Hsu Bill Hsu Wed, 20 Jan 2010 14:00:00 GMT http://m.shnenglu.com/billhsu/archive/2010/01/20/106088.html http://m.shnenglu.com/billhsu/comments/106088.html http://m.shnenglu.com/billhsu/archive/2010/01/20/106088.html#Feedback 2 http://m.shnenglu.com/billhsu/comments/commentRss/106088.html http://m.shnenglu.com/billhsu/services/trackbacks/106088.html
鍓騫抽潰
(Clip Plane)
鍦ㄥ浘褰㈠棰嗗煙鏈夌潃閲嶈鐨勪綔鐢紝姣斿姘撮潰妯℃嫙涓紝娓叉煋鎶樺皠綰圭悊鏃訛紝鎴戜滑灝卞繀欏誨皢姘撮潰浠ヤ笂鐨勯《鐐歸氳繃鍓騫抽潰鍓鎺夈?/span>
鍦ㄨ繃鍘葷殑鍥哄畾娓叉煋綆¢亾鏃朵唬錛屽壀瑁佸鉤闈㈢殑瀹炵幇杈冧負綆鍗曪紝姣斿鍦?/span>
DirectX 9
涓紝鍙互鍏堣瀹氬壀瑁佸鉤闈㈠湪涓栫晫鍧愭爣緋諱笅鐨勬柟紼?/span>
(ax+by+cz+d=0)
錛屽啀璋冪敤
SetClipPlane(DWORD Index,CONST float * pPlane)
榪欎釜
API
鍑芥暟灝卞彲浠ヤ簡銆?/span>
聽
闄勪笂渚嬪瓙紼嬪簭錛?/span>
vPosition=D3DXVECTOR3(0,0,0);
//
騫抽潰涓婁竴涓偣
vNormal=D3DXVECTOR3(0,1,0);
//
娉曞悜閲?span>
D3DXPlaneFromPointNormal(聽&clipplane,聽&vPosition,聽&vNormal聽);
//
鐢熸垚鍓騫抽潰
m_pDevice()->SetClipPlane(聽0,聽(
float
*)clipplane);聽
聽
鐒惰岋紝鍦ㄧ幇鍦ㄧ殑鍙紪紼嬬閬?/span>
(programmable pipeline)
涓嬶紝璁劇疆鐨勫壀瑁佸鉤闈細琚湪鍓鍧愭爣緋諱笅澶勭悊錛岃屼笉鏄湪涓栫晫鍧愭爣緋諱笅銆?/span>
瑙e喅榪欎釜闂鐨勬柟娉曟湁錛?br />
1錛壜?緇欒鍓鐨勯《鐐瑰仛鏍囪錛屽湪Pixel Shader涓妸瀹冨壀瑁佹帀銆?br />
2錛壜?浣跨敤榪戞枩騫抽潰瑁佸壀錛圤blique Near-Plane Clipping錛夛紝鍗充慨鏀規(guī)姇褰辯煩闃碉紝灝嗚鍓鐨勯《鐐規(guī)斁鍦ㄨ鎴綋涔嬪錛屼粠鑰岄伩鍏嶄簡璇ラ《鐐圭殑緇樺埗銆?br />
3錛壜?淇敼騫抽潰鏂圭▼錛屼嬌涔嬩粠涓栫晫鍧愭爣緋昏漿鎹㈠埌鍓鍧愭爣緋匯?span>
涓婅堪鏂規(guī)硶涓紝絎竴縐嶅拰絎簩縐嶆晥鐜囧茍涓嶉珮錛氬湪Pixel Shader 涓壀瑁佹病鏈夊噺灝戜換浣曚笉蹇呰鐨勯《鐐瑰鐞嗭紝鑰岃綆楄繎鏂滃鉤闈㈣鍓煩闃佃緝涓虹箒鐞愩傛墍浠ワ紝鏂規(guī)硶涓夋槸鏈浣抽夋嫨銆?/span>聽 瑕佸皢涓涓鉤闈粠涓栫晫鍧愭爣緋昏漿鎹㈠埌鍓鍧愭爣緋伙紝蹇呴』姹傚嚭榪欎釜鍙樻崲鐭╅樀銆?/span>
璁懼鉤闈㈡柟紼?/span>ax+by+cz+d=0 錛岀敤涓涓?/span>4 緇村悜閲忔潵 n 琛ㄧず (a,b,c,d) 錛岃騫抽潰涓婃湁涓偣 p:(x,y,z,1) 銆傛牴鎹鉤闈㈡柟紼嬬殑瀹氫箟錛屾湁錛?/span>
n T p = ax + by + cz + d = 0
璁劇煩闃?/span>R 鍙互璁╃偣 P 浠庝笘鐣屽潗鏍囩郴杞崲鍒板壀瑁佸潗鏍囩郴錛岀煩闃?/span>Q 鍙互璁╁鉤闈?/span>n 瀹炵幇鍚屾牱鐨勫彉鎹€傞偅涔堬紝鏈夛細
p '= R p
n' = Q n
鍏朵腑 p' 銆?/span>n' 鍒嗗埆鏄漿鎹㈠悗鐨勭偣涓庡鉤闈€?/span>
n ' T p' = 0
(Q n )T (R p ) = 0 n T Q T R p = 0濡傛灉錛?/span>Q T R = I
閭d箞錛?/span>
n T Q T R p = n T I p = n T p = 0
浜庢槸錛?/span>
Q T = R -1
Q = (R -1 )T
鍦?/span>DirectX 3D 涓紝灝嗕竴涓偣浠庝笘鐣屽潗鏍囩郴杞崲鍒板壀瑁佸潗鏍囩郴錛屾墍鐢ㄧ殑鐭╅樀涓鴻瀵熺煩闃典笌鎶曞獎鐭╅樀鐨勪箻縐紝鍗籌細
D3DXMATRIX聽聽TranMatrix聽=聽matView*matProj;
(TranMatrix 涓烘墍姹傜殑鍙樻崲鐭╅樀錛?span>matView 鍜?span>matProj
鍒嗗埆涓?/span>瑙傚療鐭╅樀涓庢姇褰辯煩闃?/span>) 聽
闄勪笂鍦?/span>D3D 涓彉鎹㈢殑瀹屾暣浠g爜錛?/span>
D3DXPLANE聽tempPlane聽=聽clipplane;
D3DXPlaneNormalize(&tempPlane,聽&tempPlane);
D3DXMATRIX聽聽TranMatrix聽=聽matView*matProj;
D3DXMatrixInverse(&TranMatrix,聽NULL,聽&TranMatrix);
D3DXMatrixTranspose(&TranMatrix,聽&TranMatrix);
D3DXPlaneTransform(&tempPlane,聽&tempPlane,聽&TranMatrix);
鍙傝冭祫鏂欙細
1.Back Face Culling Notes ,Jordan Smith (University of California, Berkeley)
http://www.cs.berkeley.edu/~ug/slide/pipeline/assignments/backfacecull.shtml 聽
2.GameDev Forum
http://www.gamedev.net/community/forums/topic.asp?topic_id=402381
3.Oblique Near-Plane Clipping with Orthographic Camera ,Aras
http://aras-p.info/texts/obliqueortho.html
]]>鍙戞棩蹇楃邯蹇祣~絎竴嬈″啓瀵煎嚭鎻掍歡 http://m.shnenglu.com/billhsu/archive/2009/11/25/101921.htmlBill Hsu Bill Hsu Wed, 25 Nov 2009 11:25:00 GMT http://m.shnenglu.com/billhsu/archive/2009/11/25/101921.html http://m.shnenglu.com/billhsu/comments/101921.html http://m.shnenglu.com/billhsu/archive/2009/11/25/101921.html#Feedback 2 http://m.shnenglu.com/billhsu/comments/commentRss/101921.html http://m.shnenglu.com/billhsu/services/trackbacks/101921.html
浠婂ぉ緇堜簬鎶婃ā鍨嬪鍑烘彃浠舵渶鍩烘湰鐨勫姛鑳?-瀵煎嚭緗戞牸緇欏啓濂戒簡銆?/p>
c++鍜宮ax sdk涓璧風(fēng)敤鐨勬劅瑙夊緢鎬紝緋葷粺宕╂簝浜哊嬈★紝涓嶈繃錛屾葷畻鑳藉鍑虹綉鏍間簡~
聽
鏈夊浘鏈夌湡鐩革紝鎴浘綰康
(娉ㄦ剰錛氭ā鍨嬫槸浠巚alue鐨刢sol涓紕鍑烘潵鐨?
鍦╠3d涓覆鏌撳鍑虹殑妯″瀷顱
鍦╠3d涓覆鏌撳鍑虹殑妯″瀷顱
鎴戠殑妯″瀷瀵煎嚭鎻掍歡顱
瀵煎嚭鏁版嵁鏍鋒湰錛?/p>
[榪欐槸涓涓甫璐村浘鐨勭珛鏂逛綋鐨勫鍑烘暟鎹甝
聽
8//銆銆8涓《鐐?br />
-6.70302 -21.2068 -5.46039
17.1883 -6.46757 0.162097
-22.4049 2.22378 -0.162097
1.48644 16.963 5.46039
-8.48039 -28.3257 20.7542
15.411 -13.5865 26.3767
-24.1823 -4.89514 26.0525
-0.290929 9.84411 31.675
12//銆銆12涓汗鐞嗗潗鏍?br />
0 1 0
1 1 0
0 0 0
1 0 0
0 1 0
1 1 0
0 0 0
1 0 0
0 1 0
1 1 0
0 0 0
1 0 0
12//銆銆12涓潰寮曠儲
0 9 2 11 3 10
3 10 1 8 0 9
4 8 5 9 7 11
7 11 6 10 4 8
0 4 1 5 5 7
5 7 4 6 0 4
1 0 3 1 7 3
7 3 5 2 1 0
3 4 2 5 6 7
6 7 7 6 3 4
2 0 0 1 4 3
4 3 6 2 2 0
]]> DirectX 3D 璁懼涓㈠け(lost device)鐨勫鐞?/title> http://m.shnenglu.com/billhsu/archive/2009/10/17/98823.htmlBill Hsu Bill Hsu Sat, 17 Oct 2009 05:10:00 GMT http://m.shnenglu.com/billhsu/archive/2009/10/17/98823.html http://m.shnenglu.com/billhsu/comments/98823.html http://m.shnenglu.com/billhsu/archive/2009/10/17/98823.html#Feedback 2 http://m.shnenglu.com/billhsu/comments/commentRss/98823.html http://m.shnenglu.com/billhsu/services/trackbacks/98823.html
浣庢墜浜ゆ祦錛岄珮鎵嬪嬁鍏?br /> 褰撳垵瑙夊緱DX涓澶囦涪澶卞緢璁ㄥ帉錛屽樊鐐瑰氨鎶曞OpenGL浜嗐?br />
涓嶈繃鐜板湪鍙戠幇鍏跺疄涔熸病閭d箞楹葷儲鍟︼紝鍐欑偣涓滆タ錛岀粰涓嶆竻妤?/font>
璁懼涓㈠け鎬庝箞澶勭悊鐨勫悓瀛﹀弬鑰冧笅銆?br /> 鍦ㄥ垱寤烘椂浣跨敤D3DPOOL_MANAGED鏍囧織鐨勮祫婧愬彲浠ヤ笉闇瑕侀噸鏂拌澆鍏ワ紝浣咲3DPOOL_DEFAULT鍔犺澆鐨勮祫婧愬氨闇瑕佸厛閲婃斁錛屽悗閲嶅緩銆?br /> 閫氬父闇瑕佽繖鏍峰鐞嗙殑鏈塈D3DXFont鍜孖D3DXSprite錛岃?X妯″瀷浠涔堢殑灝變笉闇瑕併?br />鍦ㄥ彂鐜拌澶囦涪澶辨椂錛屾垜浠璋冪敤 OnLostDevice( void ) 鍑芥暟璁〥3DPOOL_DEFAULT鍔犺澆鐨勮祫婧愰噴鏀炬帀銆?br />濂藉湪ID3DXFont鍜孖D3DXSprite鏈夎澶囦涪澶卞鐞嗗嚱鏁幫紝鐩存帴璋冪敤灝卞ソ浜?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">void 聽OnLostDevice( void ) { 聽聽聽 m_sprite -> OnLostDevice(); 聽聽聽聽m_font -> OnLostDevice(); } 鍙槸錛屾庝箞鐭ラ亾璁懼涓㈠け浜嗗憿錛?br />濡傛灉璁懼涓㈠け錛孭resent()鍑芥暟灝變細鈥滃嚭闂鈥濓紝榪斿洖鍊兼槸D3DERR_DEVICELOST銆?br />m_pIDirect3DDevice -> EndScene(); HRESULT聽hr; hr聽 = 聽m_pIDirect3DDevice -> Present(NULL,聽NULL,聽NULL,聽NULL); if (hr聽 == 聽D3DERR_DEVICELOST) { 聽聽聽 if (m_pIDirect3DDevice -> TestCooperativeLevel()聽 == 聽D3DERR_DEVICENOTRESET) 聽聽聽 { 聽聽聽聽聽聽聽 OnLostDevice(); 聽聽聽聽聽聽聽 OnResetDevice(); 聽聽聽 } }
TestCooperativeLevel() == 聽D3DERR_DEVICENOTRESET鏃訛紝灝卞彲浠ユ仮澶嶈澶囦簡銆?br />浜庢槸錛屾垜浠皟鐢?/span>OnLostDevice( ) 璁〥3DPOOL_DEFAULT鍔犺澆鐨勮祫婧愰噴鏀炬帀錛屼箣鍚庯紝璋冪敤OnResetDevice()鏉ユ仮澶嶈澶囧氨鍙互浜嗐?br /> 鎬庝箞鎭㈠璁懼鍛紵void 聽OnResetDevice( void ) { 聽聽聽聽 if (FAILED(m_pIDirect3DDevice -> Reset( & d3dpp))) 聽聽聽聽{ 聽聽聽聽聽聽聽聽 return ; 聽聽聽聽} 聽聽聽聽m_sprite -> OnResetDevice(); 聽聽聽聽m_font -> OnResetDevice(); 聽聽聽聽InitDevice(); }
鍏堣D3D璁懼reset錛岀劧鍚庤皟鐢?/span>ID3DXFont鍜孖D3DXSprite鐨勬仮澶嶅嚱鏁幫紝鏈鍚庯紝闇瑕佹妸D3D璁懼涓殑鐘舵佸晩錛岀煩闃靛彉鎹㈠晩榪欎簺閲嶆柊璁劇疆涓嬪氨瀹屾垚浜嗭紝涔熷氨鏄皟鐢?/span>InitDevice()銆?br />void 聽InitDevice() { m_pIDirect3DDevice -> SetRenderState(聽D3DRS_ZENABLE,聽TRUE聽); m_pIDirect3DDevice -> SetRenderState(聽D3DRS_AMBIENT,聽 0xffffffff 聽); m_pIDirect3DDevice -> SetSamplerState( 0 ,聽D3DSAMP_MAGFILTER,聽D3DTEXF_LINEAR); m_pIDirect3DDevice -> SetSamplerState( 0 ,聽D3DSAMP_MINFILTER,聽D3DTEXF_LINEAR); m_pIDirect3DDevice -> SetSamplerState( 0 ,聽D3DSAMP_MIPFILTER,聽D3DTEXF_POINT); D3DXMatrixPerspectiveFovLH(聽 & matProj,聽D3DX_PI / 4 ,聽 1.0f ,聽 1.0f ,聽 1000.0f 聽); m_pIDirect3DDevice -> SetTransform(聽D3DTS_PROJECTION,聽 & matProj聽); vEyeVec = D3DXVECTOR3( 0.0f , 0.0f , - 1.0f ); vLookatVec = D3DXVECTOR3( 0.0f , 0.0f , 0.0f ); vUpVec = D3DXVECTOR3( 0.0f , 1.0f , 0.0f ); D3DXMatrixLookAtLH(聽 & matView,聽 & vEyeVec,聽 & vLookatVec,聽 & vUpVec聽); m_pIDirect3DDevice -> SetTransform(聽D3DTS_VIEW,聽 & matView聽); }
鍟婏紝榪欐牱璁懼涓㈠け灝卞鐞嗗ソ浜?br /> // tag:DirectX 3D聽 d3d lost device TestCooperativeLevel OnLostDevice 鎭㈠璁懼 璁懼涓㈠け DeviceLost ]]> 娓告垙寮鍙戣呭勾浼?009 http://m.shnenglu.com/billhsu/archive/2009/10/11/98318.htmlBill Hsu Bill Hsu Sun, 11 Oct 2009 09:56:00 GMT http://m.shnenglu.com/billhsu/archive/2009/10/11/98318.html http://m.shnenglu.com/billhsu/comments/98318.html http://m.shnenglu.com/billhsu/archive/2009/10/11/98318.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/98318.html http://m.shnenglu.com/billhsu/services/trackbacks/98318.html
鐪嬪埌浜嗕笉灝戞瘮杈冮渿鎾肩殑鎶鏈?br />
鎰熻Е鏈娣辯殑榪樻槸Cry Engine3鐨勫睍鍙幫紝
浠栦滑鐨勬涓栦唬鏁堟灉澶己澶т簡錛岃繕鏈夐偅涓満鏅紪杈戝櫒錛屾劅瑙夋棤鏁屼簡=_=
鐙珛娓告垙灞曚笂鐨勪竴浜涙父鎴忓垱鎰忚繕鏄緢濂界殑錛屽彲鎴戠帺涓嶅ソ===
閯欒涓嬭吘璁父鎴忥紝鍗犱簡濂藉ぇ涓涓彴錛屽氨鎽嗕簡2涓樉紺哄櫒鈥︹?br />
鎷嶇殑鐓х墖 ]]> 3d緙栫▼鐨勬棤鏁岀粍鍚?/title> http://m.shnenglu.com/billhsu/archive/2009/08/03/91991.htmlBill Hsu Bill Hsu Mon, 03 Aug 2009 00:35:00 GMT http://m.shnenglu.com/billhsu/archive/2009/08/03/91991.html http://m.shnenglu.com/billhsu/comments/91991.html http://m.shnenglu.com/billhsu/archive/2009/08/03/91991.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/91991.html http://m.shnenglu.com/billhsu/services/trackbacks/91991.html
綆浠嬩竴涓?br />
1.Irrlicht
Irrlicht鍦ㄥ紑婧?d寮曟搸閲岀畻寰堝ソ鐨勪竴涓紝
鑰屼笖瀹冩槸LGPL( Lesser General Public License)鍗忚鐨勶紝浣犲彲浠ラ殢鎰忎嬌鐢ㄥ畠銆?br />
涓婚〉錛?a target="_blank">http://irrlicht.sourceforge.net/
2.IrrNewt
IrrNewt鏄妸Newton dynamic(涓涓墿鐞嗗紩鎿?鍜孖rrlicht(3d鍥懼艦寮曟搸)緇撳悎鐨勪竴涓簱錛?br />
鐢ㄤ簡瀹冪殑紜細璁╂父鎴忔晥鏋滃緢闇囨捈銆?br />
涓婚〉錛?a target="_blank">http://aresfps.sourceforge.net/irrnewt.htm
3.IrrKlang
瀹冩槸涓篒rrlicht璁捐鐨勫0闊沖紩鎿庯紝鏀寔3d鍜?d澹版晥銆?br />
涓婚〉錛?a target="_blank">http://www.ambiera.com/irrklang/ ]]> 鑷繁鍐欑殑3D娓告垙 http://m.shnenglu.com/billhsu/archive/2009/07/29/91578.htmlBill Hsu Bill Hsu Wed, 29 Jul 2009 05:04:00 GMT http://m.shnenglu.com/billhsu/archive/2009/07/29/91578.html http://m.shnenglu.com/billhsu/comments/91578.html http://m.shnenglu.com/billhsu/archive/2009/07/29/91578.html#Feedback 6 http://m.shnenglu.com/billhsu/comments/commentRss/91578.html http://m.shnenglu.com/billhsu/services/trackbacks/91578.html
榪欎釜娓告垙浣跨敤浜嗘垜鑷繁寮鍙戠殑寮婧?D寮曟搸Rap3d銆?br />
涓漢鎰熻Rap3d鐢ㄨ搗鏉ュ緢鏂逛究錛?br />
濡傛灉鎮(zhèn)ㄦ兂浣跨敤錛岃璁塊棶Rap3d鍦╯ourceforge鐨勯」鐩富欏點?br />http://rap3d.sf.net
娓告垙浠嬬粛錛?br />
鍦扮悆琚伀鏄熶漢鍗犻錛?br />
浣犻┚椹朵漢綾繪渶鍏堣繘鐨勯鑸光滅寷紱解濆彿錛?br />
鍐插叆浜嗙伀鏄熶漢鍩哄湴錛屽媷鏁㈠湴鎴樻枟錛?br />
鍦扮悆鍛借繍錛屽湪浣犱箣鎵嬧︹?br />
寮鍙戠幆澧冿細
Visual C++ 2003 & Directx9.0c SDK
鍦╳indows緋葷粺閮藉彲浠ヨ繍琛?br />
鎿嶄綔錛?br />
鐢ㄤ笂涓嬪乏鍙抽敭鎺у埗鎮(zhèn)ㄧ殑椋炶埞
鐢ㄦ帶鍒墮敭[Ctrl]灝勫嚮,鐢╗Esc]閿鍑烘父鎴?br />
鍏蜂綋鐜╂硶瑙佹父鎴廐elp.
涓嬭澆鐚涚浠誨姟錛?a > http://rap3d.googlecode.com/files/Rap3d%20Demo--RaptorMission.rar 鎴?br />
http://show.gameres.com/RaptorMission/RaptorMission.zip Win7/Vista浣跨敤鍓嶆妸鍖呴噷鐨刣3d9.dll鍒犳帀 ]]>鑷繁鍐欑殑Rap3d 寮曟搸 寮婧愬彂甯冨暒 http://m.shnenglu.com/billhsu/archive/2009/07/25/91123.htmlBill Hsu Bill Hsu Sat, 25 Jul 2009 07:00:00 GMT http://m.shnenglu.com/billhsu/archive/2009/07/25/91123.html http://m.shnenglu.com/billhsu/comments/91123.html http://m.shnenglu.com/billhsu/archive/2009/07/25/91123.html#Feedback 5 http://m.shnenglu.com/billhsu/comments/commentRss/91123.html http://m.shnenglu.com/billhsu/services/trackbacks/91123.html 鎴戝湪sourceforge涓婄敵璇蜂簡寮婧愰」鐩紝鍦ㄩ偅閲屽彲浠ヤ笅杞藉埌Rap3d SDK.http://rap3d.sf.net/
Rap3d SDK 涓湁寮曟搸鐨勪嬌鐢ㄨ鏄庡拰鍑犱釜渚嬪瓙錛屼笂鎵嬪緢蹇殑銆?br />What Rap3d can do?
1.Display 3d models
2.Bill Board,Sprite,Animation..
3.Music playing
4.Draw text on screen
http://rap3d.sf.net/
]]> Rap3d鏇存柊 http://m.shnenglu.com/billhsu/archive/2009/06/23/88346.htmlBill Hsu Bill Hsu Tue, 23 Jun 2009 02:12:00 GMT http://m.shnenglu.com/billhsu/archive/2009/06/23/88346.html http://m.shnenglu.com/billhsu/comments/88346.html http://m.shnenglu.com/billhsu/archive/2009/06/23/88346.html#Feedback 1 http://m.shnenglu.com/billhsu/comments/commentRss/88346.html http://m.shnenglu.com/billhsu/services/trackbacks/88346.html
澧炲姞浜?TextureManager鍜? BillBoard鍔ㄧ敾鎾斁,鏂逛究娓叉煋鐖嗙偢鏁堟灉 ]]> 娓告垙涓瑿PU浣跨敤鐜囩殑鎺у埗 http://m.shnenglu.com/billhsu/archive/2009/06/12/87472.htmlBill Hsu Bill Hsu Fri, 12 Jun 2009 04:00:00 GMT http://m.shnenglu.com/billhsu/archive/2009/06/12/87472.html http://m.shnenglu.com/billhsu/comments/87472.html http://m.shnenglu.com/billhsu/archive/2009/06/12/87472.html#Feedback 18 http://m.shnenglu.com/billhsu/comments/commentRss/87472.html http://m.shnenglu.com/billhsu/services/trackbacks/87472.html 搴旇鐢⊿leep(1)鎶婂浣欑殑鐗囨榪樼粰CPU, 鍍忚繖鏍鳳細while ( true ) { DWORD聽start_time聽 = 聽GetTickCount(); if (PeekMessage( & msg,NULL, 0 , 0 ,PM_REMOVE)) { if 聽(msg.message聽 == 聽WM_QUIT)聽 break ; TranslateMessage( & msg); DispatchMessage( & msg); } update( float (GetTickCount()聽 - 聽start_time)); while ((GetTickCount()聽 - 聽start_time)聽 < 聽 30 )聽Sleep( 1 ); }
update(float timeDelta)鏄父鎴忛昏緫涓庣敾闈㈡洿鏂扮殑鍑芥暟銆?br />鏁堟灉鍥撅細 ]]> 3D寮曟搸璁″垝 http://m.shnenglu.com/billhsu/archive/2009/06/10/87356.htmlBill Hsu Bill Hsu Wed, 10 Jun 2009 13:15:00 GMT http://m.shnenglu.com/billhsu/archive/2009/06/10/87356.html http://m.shnenglu.com/billhsu/comments/87356.html http://m.shnenglu.com/billhsu/archive/2009/06/10/87356.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/87356.html http://m.shnenglu.com/billhsu/services/trackbacks/87356.html
鍏跺疄涔熷氨鏄妸涓浜涚被灝佽涓涓嬶紝璁╁紑鍙戞洿綆緇擄紝浠ュ紑婧愬拰瀹炵敤涓虹涓鍑嗗垯銆?br /> ]]> 瀵昏礬綆楁硶鏁寸悊 http://m.shnenglu.com/billhsu/archive/2009/01/23/72513.htmlBill Hsu Bill Hsu Fri, 23 Jan 2009 09:22:00 GMT http://m.shnenglu.com/billhsu/archive/2009/01/23/72513.html http://m.shnenglu.com/billhsu/comments/72513.html http://m.shnenglu.com/billhsu/archive/2009/01/23/72513.html#Feedback 3 http://m.shnenglu.com/billhsu/comments/commentRss/72513.html http://m.shnenglu.com/billhsu/services/trackbacks/72513.html 1.DFS 浼樺厛娣卞叆姣忎釜鍥撅紝鐩村埌鎵懼埌鐩爣鑺傜偣 寰寰鍙互鎵懼埌鍒拌揪璺嚎錛屽彲寰寰涓嶆槸鏈浼樼殑銆?br /> 2.BFS 騫垮害浼樺厛鍦板鎵劇洰鏍囪妭鐐廣?br />寰寰鍙互鎵懼埌鏈浼樿礬寰勶紝浣嗚楁椂澶氥?br /> 3.Dijkstra 浣跨敤浜嗗姩鎬佽鍒掞紙鍘熸枃涓О涓衡滆竟鏀炬澗鈥濓級//璇ヤ負璐績錛屾湰浜虹姜榪?br />閫熷害杈冨揩 4.A* 涓嶥ijkstra鐩鎬技錛屼嬌鐢ㄥ惎鍙戝洜瀛?F=G+H)錛岄熷害鏄互涓婄畻娉曢噷鏈蹇殑銆?br />鍙互鐪嬬湅錛?br />http://hi.baidu.com/probill/blog/item/80d71f1b19e2fe1e8718bfe5.html 5.鍒涘緩瀵艱埅鍥?br /> ]]>鐢℅DI瀹炵幇3D http://m.shnenglu.com/billhsu/archive/2008/12/27/70517.htmlBill Hsu Bill Hsu Sat, 27 Dec 2008 09:18:00 GMT http://m.shnenglu.com/billhsu/archive/2008/12/27/70517.html http://m.shnenglu.com/billhsu/comments/70517.html http://m.shnenglu.com/billhsu/archive/2008/12/27/70517.html#Feedback 1 http://m.shnenglu.com/billhsu/comments/commentRss/70517.html http://m.shnenglu.com/billhsu/services/trackbacks/70517.html 涓嶈繃鎯蟲兂鐪嬶紝濂藉儚瀹炵幇璧鋒潵涔熷茍涓嶉毦銆傘傘?br />鍜屾墍鏈夊熀紜鐨?D紼嬪簭涓鏍鳳紝鍏堟妸瑙嗘鍙樻崲涓哄崟浣嶇珛鏂逛綋錛?br /> 鍙樻崲鐭╅樀涓猴細 褰撶劧錛孌irectX鍜孫penGL閲岄兘鏈夌幇鎴愮殑鍑芥暟錛?br />// OpenGL void 聽gluPerspective(GLdouble聽fovy, 聽聽聽聽GLdouble聽aspect, 聽聽聽聽GLdouble聽zNear, 聽聽聽聽GLdouble聽zFar); // DirectX D3DXMatrixPerspectiveFovLH(聽D3DXMATRIX聽 * pOut, 聽聽聽聽FLOAT聽fovY, 聽聽聽聽FLOAT聽Aspect, 聽聽聽聽FLOAT聽zn, 聽聽聽聽FLOAT聽zf );聽
鍗曚綅绔嬫柟浣撲腑鐨勭偣姝d氦鎶曞獎寰楀埌鐨?x,y,z)*瑙嗗彛鍙樻崲鐭╅樀 寰楀埌 (x',y',z')銆?br />(x',y')瀵瑰簲灞忓箷鐐癸紝z'涓哄叾娣卞害錛岀敤浜庣偣鐨勭珵浜夈?br />鎶婃瘡涓笁瑙掗潰鍖歸厤綰圭悊鐢℅DI鍩烘湰鍑芥暟鐢誨嚭鏉ュ氨鍙互浜嗐?br /> CSDN鐨勯偅涓▼搴?br /> ]]>A* (A-star A鏄?瀵昏礬綆楁硶 http://m.shnenglu.com/billhsu/archive/2008/11/01/65700.htmlBill Hsu Bill Hsu Sat, 01 Nov 2008 10:19:00 GMT http://m.shnenglu.com/billhsu/archive/2008/11/01/65700.html http://m.shnenglu.com/billhsu/comments/65700.html http://m.shnenglu.com/billhsu/archive/2008/11/01/65700.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/65700.html http://m.shnenglu.com/billhsu/services/trackbacks/65700.html 浠旂粏鐪嬩簡鐪媑amedev.net鐨勪竴鐗囨枃绔?A* Pathfinding for Beginners
http://www.gamedev.net/reference/articles/article2003.asp
)錛屽A*鏇翠簡瑙d簡涓鐐癸紝鍐欑偣涓滆タ璁板綍涓涓嬨?br />A*鏄竴縐嶅惎鍙戝紡鐨勭畻娉曪紝鎵璋撶殑"鍚彂寮?錛屽氨鏄姣忎竴涓悳绱㈢殑浣嶇疆榪涜璇勪及錛屼篃灝辨槸鎶婃壘鐨勪綅緗鐩爣鐨勮窛紱誨綋鎴愭壘鐐圭殑涓涓緷鎹紝鐒跺悗鐚滄祴榪欎釜鐐規(guī)槸鍚︽渶浣?"鍚彂寮?灝辨槸鐚滄祴)銆?br /> 涓轟簡鎵懼埌鏈浣崇殑閭d釜鐐?br />鍙互瑙勫畾錛?br />G = 浠庤搗鐐癸紝娌跨潃浜х敓鐨勮礬寰勶紝縐誨姩鍒扮綉鏍間笂鎸囧畾鏂規(guī)牸鐨勮窛紱匯?br />H = 浠庣綉鏍間笂閭d釜鏂規(guī)牸縐誨姩鍒扮粓鐐笲鐨勯浼扮Щ鍔ㄨ窛紱匯?br /> F = G + H F鏈灝忕殑鐐瑰彲浠ヨ涓烘槸璇ラ夌殑鐐廣?br />寮曠敤 涓涓嬪師鏂囩殑緲昏瘧錛?br />鎴戜滑浠ゆ按騫蟲垨鑰呭瀭鐩寸Щ鍔ㄧ殑鑰楄垂涓?0錛屽瑙掔嚎鏂瑰悜鑰楄垂涓?4銆傛垜浠彇榪欎簺鍊兼槸鍥犱負娌垮瑙掔嚎鐨勮窛紱繪槸娌挎按騫蟲垨鍨傜洿縐誨姩鑰楄垂鐨勭殑鏍瑰彿2錛堝埆鎬曪級錛屾垨鑰呯害1.414鍊嶃備負浜嗙畝鍖栵紝鎴戜滑鐢?0鍜?4榪戜技銆傛瘮渚嬪熀鏈紜紝鍚屾椂鎴戜滑閬垮厤浜嗘眰鏍硅繍綆楀拰灝忔暟銆?br /> 鏃㈢劧鎴戜滑鍦ㄨ綆楁部鐗瑰畾璺緞閫氬線鏌愪釜鏂規(guī)牸鐨凣鍊鹼紝姹傚肩殑鏂規(guī)硶灝辨槸鍙栧畠鐖惰妭鐐圭殑G鍊鹼紝鐒跺悗渚濈収瀹冪浉瀵圭埗鑺傜偣鏄瑙掔嚎鏂瑰悜鎴栬呯洿瑙掓柟鍚?闈炲瑙掔嚎)錛屽垎鍒鍔?4鍜?0銆備緥瀛愪腑榪欎釜鏂規(guī)硶鐨勯渶姹備細鍙樺緱鏇村錛屽洜涓烘垜浠粠璧風(fēng)偣鏂規(guī)牸浠ュ鑾峰彇浜嗕笉姝竴涓柟鏍箋?br /> H鍊煎彲浠ョ敤涓嶅悓鐨勬柟娉曚及綆椼傛垜浠繖閲屼嬌鐢ㄧ殑鏂規(guī)硶琚О涓烘浖鍝堥】鏂規(guī)硶錛屽畠璁$畻浠庡綋鍓嶆牸鍒扮洰鐨勬牸涔嬮棿姘村鉤鍜屽瀭鐩寸殑鏂規(guī)牸鐨勬暟閲忔誨拰錛屽拷鐣ュ瑙掔嚎鏂瑰悜銆傜劧鍚庢妸緇撴灉涔樹互10銆傝繖琚垚涓烘浖鍝堥】鏂規(guī)硶鏄洜涓哄畠鐪嬭搗鏉ュ儚璁$畻鍩庡競涓粠涓涓湴鏂瑰埌鍙﹀涓涓湴鏂圭殑琛楀尯鏁幫紝鍦ㄩ偅閲屼綘涓嶈兘娌垮瑙掔嚎鏂瑰悜絀胯繃琛楀尯銆傚緢閲嶈鐨勪竴鐐癸紝鎴戜滑蹇界暐浜嗕竴鍒囬殰紕嶇墿銆傝繖鏄鍓╀綑璺濈鐨勪竴涓及綆楋紝鑰岄潪瀹為檯鍊鹼紝榪欎篃鏄繖涓鏂規(guī)硶琚О涓哄惎鍙戝紡鐨勫師鍥犮傛兂鐭ラ亾鏇村錛熶綘鍙互鍦ㄨ繖閲屾壘鍒版柟紼嬪拰棰濆鐨勬敞瑙c?br />
絎竴姝ユ悳绱㈢殑緇撴灉鍙互鍦ㄤ笅闈㈢殑鍥捐〃涓湅鍒般侳,G鍜孒鐨勮瘎鍒嗚鍐欏湪姣忎釜鏂規(guī)牸閲屻傛濡傚湪绱ф尐璧峰鏍煎彸渚х殑鏂規(guī)牸鎵琛ㄧず鐨勶紝F琚墦鍗板湪宸︿笂瑙掞紝G鍦ㄥ乏涓嬭錛孒鍒欏湪鍙充笅瑙掋?/span>寮曠敤 涓涓嬪師鏂囩殑緲昏瘧錛?/span> 鎴戜滑鍋氬涓嬫搷浣滃紑濮嬫悳绱細 聽聽聽1 錛屼粠鐐笰寮濮嬶紝騫朵笖鎶婂畠浣滀負寰呭鐞嗙偣瀛樺叆涓涓滃紑鍚垪琛ㄢ濄傚紑鍚垪琛ㄥ氨鍍忎竴寮犺喘鐗╂竻鍗曘傚敖綆$幇鍦ㄥ垪琛ㄩ噷鍙湁涓涓厓绱狅紝浣嗕互鍚庡氨浼氬璧鋒潵銆備綘鐨勮礬寰勫彲鑳戒細閫氳繃瀹冨寘鍚殑鏂規(guī)牸錛屼篃鍙兘涓嶄細銆傚熀鏈笂錛岃繖鏄竴涓緟媯鏌ユ柟鏍肩殑鍒楄〃銆?br />聽聽聽 2 錛屽鎵捐搗鐐瑰懆鍥存墍鏈夊彲鍒拌揪鎴栬呭彲閫氳繃鐨勬柟鏍鹼紝璺寵繃鏈夊錛屾按錛屾垨鍏朵粬鏃犳硶閫氳繃鍦板艦鐨勬柟鏍箋備篃鎶婁粬浠姞鍏ュ紑鍚垪琛ㄣ備負鎵鏈夎繖浜涙柟鏍間繚瀛樼偣A浣滀負鈥滅埗鏂規(guī)牸鈥濄傚綋鎴戜滑鎯蟲弿榪拌礬寰勭殑鏃跺欙紝鐖舵柟鏍肩殑璧勬枡鏄崄鍒嗛噸瑕佺殑銆傚悗闈細瑙i噴瀹冪殑鍏蜂綋鐢ㄩ斻?br />聽聽聽 3 錛屼粠寮鍚垪琛ㄤ腑鍒犻櫎鐐笰錛屾妸瀹冨姞鍏ュ埌涓涓滃叧闂垪琛ㄢ濓紝鍒楄〃涓繚瀛樻墍鏈変笉闇瑕佸啀嬈℃鏌ョ殑鏂規(guī)牸銆?br /> 涓轟簡緇х畫鎼滅儲錛屾垜浠畝鍗曠殑浠庡紑鍚垪琛ㄤ腑閫夋嫨F鍊兼渶浣庣殑鏂規(guī)牸銆傜劧鍚庯紝瀵歸変腑鐨勬柟鏍煎仛濡備笅澶勭悊錛?br /> 聽聽聽 4 錛屾妸瀹冧粠寮鍚垪琛ㄤ腑鍒犻櫎錛岀劧鍚庢坊鍔犲埌鍏抽棴鍒楄〃涓?br />聽聽聽 5 錛屾鏌ユ墍鏈夌浉閭繪牸瀛愩傝煩榪囬偅浜涘凡緇忓湪鍏抽棴鍒楄〃涓殑鎴栬呬笉鍙氳繃鐨?鏈夊錛屾按鐨勫湴褰紝鎴栬呭叾浠栨棤娉曢氳繃鐨勫湴褰?錛屾妸浠栦滑娣誨姞榪涘紑鍚垪琛紝濡傛灉浠栦滑榪樹笉鍦ㄩ噷闈㈢殑璇濄傛妸閫変腑鐨勬柟鏍間綔涓烘柊鐨勬柟鏍肩殑鐖惰妭鐐廣?br />聽聽聽 6 錛屽鏋滄煇涓浉閭繪牸宸茬粡鍦ㄥ紑鍚垪琛ㄩ噷浜嗭紝媯鏌ョ幇鍦ㄧ殑榪欐潯璺緞鏄惁鏇村ソ銆傛崲鍙ヨ瘽璇達紝媯鏌ュ鏋滄垜浠敤鏂扮殑璺緞鍒拌揪瀹冪殑璇濓紝G鍊兼槸鍚︿細鏇翠綆涓浜涖傚鏋滀笉鏄紝閭e氨浠涔堥兘涓嶅仛銆?br />聽聽聽聽聽聽鍙︿竴鏂歸潰錛屽鏋滄柊鐨凣鍊兼洿浣庯紝閭e氨鎶婄浉閭繪柟鏍肩殑鐖惰妭鐐規(guī)敼涓虹洰鍓嶉変腑鐨勬柟鏍鹼紙鍦ㄤ笂闈㈢殑鍥捐〃涓紝鎶婄澶寸殑鏂瑰悜鏀逛負鎸囧悜榪欎釜鏂規(guī)牸錛夈傛渶鍚庯紝閲嶆柊璁$畻F鍜孏鐨勫箋傚鏋滆繖鐪嬭搗鏉ヤ笉澶熸竻鏅幫紝浣犲彲浠ョ湅涓嬮潰鐨勫浘紺恒?/span>
榪欐牱灝卞彲浠ユ壘鍒版渶浣寵礬寰勪簡銆?br /> ]]> 鍥涘厓鏁板叆闂?/title> http://m.shnenglu.com/billhsu/archive/2008/09/30/63099.htmlBill Hsu Bill Hsu Tue, 30 Sep 2008 11:34:00 GMT http://m.shnenglu.com/billhsu/archive/2008/09/30/63099.html http://m.shnenglu.com/billhsu/comments/63099.html http://m.shnenglu.com/billhsu/archive/2008/09/30/63099.html#Feedback 1 http://m.shnenglu.com/billhsu/comments/commentRss/63099.html http://m.shnenglu.com/billhsu/services/trackbacks/63099.html 浣嗘垜鐨勯偅鏈?D鍥懼艦瀛︿功涓婏紝鍦ㄦ病璁插洓鍏冩暟鏄共浠涔堢殑涔嬪墠錛屽氨鍒椾簡鍑犲紶綰哥殑鍏紡錛?br />澶ф鍥犱負鑷繁榪樺湪涓婇珮涓紝涓嶇煡閬撶殑澶錛岀湅浜嗗崐澶╂病鐪嬫噦銆傘傘?br />緇堜簬錛屽湪gameres涓婄湅鍒頒簡鏌愬己浜虹炕璇戠殑涓涓?鍏冩暟瀹濆吀 鈥濓紙鍘熸枃鏄棩鏈漢鍐欑殑銆傘傘傦級錛屾劅瑙夊緢濂斤紝鍒嗕韓涓嬨?br />鈽呮棆杞瘒錛?br />銆鎴戝皢璇存槑浣跨敤浜嗗洓鍏冩暟錛坰i聽yuan聽shu,聽quaternion錛夌殑鏃嬭漿鐨勬搷浣滄楠?br />錛?/span>錛?/span>錛夊洓鍏冩暟鐨勮櫄閮紝瀹為儴鍜屽啓娉?br />鎵璋撳洓鍏冩暟錛屽氨鏄妸4涓疄鏁扮粍鍚堣搗鏉ョ殑涓滆タ銆?br />4涓厓绱犱腑錛屼竴涓槸瀹為儴錛屽叾浣?涓槸铏氶儴銆?br />姣斿錛屽彨鍋歈鐨勫洓鍏冩暟錛屽疄閮╰鑰岃櫄閮ㄦ槸x,y,z鏋勬垚錛屽垯鍍忎笅闈㈣繖鏍峰啓銆?br />Q聽 = 聽(t;聽x,聽y,聽z)聽 鍙堬紝浣跨敤鍚戦噺聽V = (x,y,z)錛?br />Q聽 = 聽(t;聽V)聽聽 涔熷彲浠ヨ繖涔堝啓銆?br /> 姝h鍦扮敤铏氭暟鍗曚綅i,j,k鐨勫啓娉曠殑璇濓紝 Q聽 = 聽t聽 + 聽xi聽 + 聽yj聽 + 聽zk聽 涔熻繖鏍峰啓錛屼笉榪囷紝鎴戜笉澶т嬌鐢?br /> 錛?/span>錛?/span>錛夊洓鍏冩暟涔嬮棿鐨勪箻娉?br />铏氭暟鍗曚綅涔嬮棿鐨勪箻娉暵?br />ii聽 = 聽 - 1 ,聽ij聽 = 聽 - ji聽 = 聽k聽(鍏朵粬鐨勭粍鍚堜篃鏄驚鐜湴浠ヤ笅鍚屾枃)聽 鏈夎繖涔堜竴縐嶈鍒欍傦紙鎴戞昏寰楋紝榪欏氨鍍忔槸鍚戦噺縐紙澶栫Н錛夛紝瀵瑰惂錛壜?br />鐢ㄨ繖涓鍒欎竴鐐圭偣鍦拌綆楀緢楹葷儲錛屾墍浠ヨ鐢ㄥ儚涓嬮潰榪欐牱鐨勫叕寮忚綆椼?br /> A聽 = 聽(a;聽U)聽 B聽 = 聽(b;聽V)聽 AB聽 = 聽(ab聽 - 聽U路V;聽aV聽 + 聽bU聽 + 聽U脳V) 涓嶈繃錛屸淯路V鈥濇槸鍐呯Н錛屻孶脳V銆嶆槸澶栫Н鐨勬剰鎬濄?br />娉ㄦ剰錛氫竴鑸珹B <> BA鎵浠ヤ箻娉曠殑宸﹀彸瑕佹敞鎰忥紒 錛?/span>3 錛?嬈″厓鐨勫潗鏍囩殑鍥涘厓鏁拌〃紺?br />濡傝灝嗘煇鍧愭爣(x,y,z)鐢ㄥ洓鍏冩暟琛ㄧず錛?br />P聽 = 聽( 0 ;聽x,聽y,聽z)聽 鍒欒榪欎箞鍐欍?br />聽 鍙﹀錛屽嵆浣垮疄閮ㄦ槸闆朵互澶栫殑鍊鹼紝涓嬫枃鐨勭粨鏋滀篃涓鏍楓傜敤闆剁殑璇濈渷浜嬫墍浠ユ垜鎺ㄨ崘銆?br /> 錛?/span>錛?/span>錛夋棆杞殑鍥涘厓鏁拌〃紺?br />浠ュ師鐐逛負鏃嬭漿涓績錛屾棆杞殑杞存槸(偽,聽尾,聽緯) 錛堜絾聽偽 ^ 2 聽 + 聽尾 ^ 2 聽 + 聽緯 ^ 2 聽 = 聽 1 錛夛紝聽 錛堝彸鎵嬬郴鐨勫潗鏍囧畾涔夌殑璇濓紝鏈涘悜鍚戦噺(偽,聽尾,聽緯)鐨勫墠榪涙柟鍚戝弽鏃墮拡鍦幫級聽 杞歌鐨勬棆杞紝鐢ㄥ洓鍏冩暟琛ㄧず灝辨槸錛?br />Q聽 = 聽(cos(胃 / 2 );聽偽聽sin(胃 / 2 ),聽尾聽sin(胃 / 2 ),聽緯聽sin(胃 / 2 ))聽 R聽 = 聽(cos(胃 / 2 );聽 - 偽聽sin(胃 / 2 ),聽 - 尾聽sin(胃 / 2 ),聽 - 緯聽sin(胃 / 2 ))聽 (鍙﹀R聽鍙燪聽鐨勫叡杞洓鍏冩暟銆傦級聽 閭d箞錛屽瑕佸疄琛屾棆杞紝鍒櫬?font color="#ff6600">R聽P聽Q聽 = 聽( 0 ;聽絳旀) 聽 璇峰儚榪欐牱涓夋槑娌誨紡鍦拌綆椼傝繖涓肩殑铏氶儴灝辨槸鏃嬭漿涔嬪悗鐨勭偣鐨勫潗鏍囧箋?br />聽錛堝彟澶栵紝瀹為儴搴旇涓洪浂銆傝楠岀畻鐪嬬湅錛壜?/span>
渚嬪瓙浠g爜/// 聽Quaternion.cpp聽 /// 聽(C)聽Toru聽Nakata,聽toru-nakata@aist.go.jp聽 /// 聽2004聽Dec聽29聽 聽聽 #include聽 < math.h > 聽 #include聽 < iostream.h > 聽 聽聽 /// 聽Define聽Data聽type聽 typedef聽 struct 聽 {聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽t;聽 // 聽real-component聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽x;聽 // 聽x-component聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽y;聽 // 聽y-component聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽z;聽 // 聽z-component聽 }聽quaternion;聽 聽聽 /// / Bill 娉細Kakezan 鍦ㄦ棩璇噷鏄?鈥滀箻娉曗濈殑鎰忔?/b> quaternion聽Kakezan(quaternion聽left,聽quaternion聽right)聽 {聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽quaternion聽ans;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽d1,聽d2,聽d3,聽d4;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d1聽 = 聽聽left.t聽 * 聽right.t;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d2聽 = 聽 - left.x聽 * 聽right.x;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d3聽 = 聽 - left.y聽 * 聽right.y;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d4聽 = 聽 - left.z聽 * 聽right.z;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.t聽 = 聽d1 + 聽d2 + 聽d3 + 聽d4;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d1聽 = 聽聽left.t聽 * 聽right.x;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d2聽 = 聽聽right.t聽 * 聽left.x;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d3聽 = 聽聽left.y聽 * 聽right.z;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d4聽 = 聽 - left.z聽 * 聽right.y;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.x聽 = 聽聽d1 + 聽d2 + 聽d3 + 聽d4;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d1聽 = 聽聽left.t聽 * 聽right.y;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d2聽 = 聽聽right.t聽 * 聽left.y;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d3聽 = 聽聽left.z聽 * 聽right.x;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d4聽 = 聽 - left.x聽 * 聽right.z;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.y聽 = 聽聽d1 + 聽d2 + 聽d3 + 聽d4;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d1聽 = 聽聽left.t聽 * 聽right.z;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d2聽 = 聽聽right.t聽 * 聽left.z;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d3聽 = 聽聽left.x聽 * 聽right.y;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽d4聽 = 聽 - left.y聽 * 聽right.x;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.z聽 = 聽聽d1 + 聽d2 + 聽d3 + 聽d4;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return 聽ans;聽 }聽 聽聽 /// /聽Make聽Rotational聽quaternion聽 quaternion聽MakeRotationalQuaternion( double 聽radian,聽 double 聽AxisX,聽 double 聽AxisY,聽 double 聽AxisZ)聽 {聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽quaternion聽ans;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽norm;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽ccc,聽sss;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.t聽 = 聽ans.x聽 = 聽ans.y聽 = 聽ans.z聽 = 聽 0.0 ;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽norm聽 = 聽AxisX聽 * 聽聽AxisX聽 + 聽聽AxisY聽 * 聽聽AxisY聽 + 聽聽AxisZ聽 * 聽聽AxisZ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (norm聽 <= 聽 0.0 )聽 return 聽ans;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽norm聽 = 聽 1.0 聽 / 聽sqrt(norm);聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽AxisX聽 *= 聽norm;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽AxisY聽 *= 聽norm;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽AxisZ聽 *= 聽norm;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ccc聽 = 聽cos( 0.5 聽 * 聽radian);聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽sss聽 = 聽sin( 0.5 聽 * 聽radian);聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.t聽 = 聽ccc;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.x聽 = 聽sss聽 * 聽AxisX;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.y聽 = 聽sss聽 * 聽AxisY;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.z聽 = 聽sss聽 * 聽AxisZ;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return 聽ans;聽 }聽 聽聽 /// /聽Put聽XYZ聽into聽聽quaternion聽 quaternion聽PutXYZToQuaternion( double 聽PosX,聽 double 聽PosY,聽 double 聽PosZ)聽 {聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽quaternion聽ans;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.t聽 = 聽 0.0 ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.x聽 = 聽PosX;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.y聽 = 聽PosY;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ans.z聽 = 聽PosZ;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return 聽ans;聽 }聽 聽聽 /// //聽main聽 int 聽main()聽 {聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽px,聽py,聽pz;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 double 聽ax,聽ay,聽az,聽th;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽quaternion聽ppp,聽qqq,聽rrr;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " Point聽Position聽(x,聽y,聽z)聽 " 聽 << 聽endl;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽x聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽px;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽y聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽py;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽z聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽pz;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽ppp聽 = 聽PutXYZToQuaternion(px,聽py,聽pz);聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 while ( 1 )聽{聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " \nRotation聽Degree聽?聽(Enter聽0聽to聽Quit)聽 " 聽 << 聽endl;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽angle聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽th;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (th聽 == 聽 0.0 )聽 break ;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " Rotation聽Axis聽Direction聽?聽(x,聽y,聽z)聽 " 聽 << 聽endl;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽x聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽ax;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽y聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽ay;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " 聽聽z聽=聽 " ;聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cin聽 >> 聽az;聽 聽聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽th聽 *= 聽 3.1415926535897932384626433832795 聽 / 聽 180.0 ;聽 /// 聽Degree聽->聽radian;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽qqq聽 = 聽MakeRotationalQuaternion(th,聽ax,聽ay,聽az);聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽rrr聽 = 聽MakeRotationalQuaternion( - th,聽ax,聽ay,聽az);聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽ppp聽 = 聽Kakezan(rrr,聽ppp);聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽ppp聽 = 聽Kakezan(ppp,聽qqq);聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽cout聽 << 聽 " \nAnser聽X聽=聽 " 聽 << 聽ppp.x聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 << 聽聽 " \n聽聽聽聽聽聽Y聽=聽 " 聽 << 聽ppp.y聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 << 聽聽 " \n聽聽聽聽聽聽Z聽=聽 " 聽 << 聽ppp.z聽 << 聽endl;聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽}聽 聽聽 聽聽聽聽聽聽聽聽聽聽聽聽聽聽 return 聽 0 ;聽 }聽聽
http://staff.aist.go.jp/toru-nakata/quaternion.html http://bbs.gameres.com/showthread.asp?threadid=73511 ]]> 瓚呰秺3D錛?D鏉ヤ簡銆傘傘?/title> http://m.shnenglu.com/billhsu/archive/2008/09/15/61846.htmlBill Hsu Bill Hsu Mon, 15 Sep 2008 03:56:00 GMT http://m.shnenglu.com/billhsu/archive/2008/09/15/61846.html http://m.shnenglu.com/billhsu/comments/61846.html http://m.shnenglu.com/billhsu/archive/2008/09/15/61846.html#Feedback 6 http://m.shnenglu.com/billhsu/comments/commentRss/61846.html http://m.shnenglu.com/billhsu/services/trackbacks/61846.html
瀹炵幇鏂規(guī)硶
鍑嗗涓や釜鎽勫儚鏈猴紝瀵瑰噯鍚屼竴鐐癸紝浜ゆ浛娓叉煋綰㈠拰緇跨殑鐢婚潰錛屽甫涓婄孩緇跨溂闀?img src="http://m.shnenglu.com/images/cppblog_com/slowhand/glass.jpg" class="blogimg" small="0" border="0" width="67" height="35">鍗沖彲瑙傚療鍒?D鐨勫満鏅簡錛?br>
澶у鍙互鐪嬬湅閭h繖閲岋紝鏈夋簮浠g爜(C++&D3d瀹炵幇鐨?
http://bbs.gameres.com/showthread.asp?threadid=73818
涓涓?D鐨勪緥瀛?/div>
]]>
irrlicht--榪欎釜寮曟搸寰堝己澶с傘傘?/title> http://m.shnenglu.com/billhsu/archive/2008/08/23/59735.htmlBill Hsu Bill Hsu Sat, 23 Aug 2008 09:53:00 GMT http://m.shnenglu.com/billhsu/archive/2008/08/23/59735.html http://m.shnenglu.com/billhsu/comments/59735.html http://m.shnenglu.com/billhsu/archive/2008/08/23/59735.html#Feedback 0 http://m.shnenglu.com/billhsu/comments/commentRss/59735.html http://m.shnenglu.com/billhsu/services/trackbacks/59735.html 涓婃鍦╯ourceforge.net(澶у悕榧庨紟鐨勫紑婧愪唬鐮佺綉绔?涓婄湅鍒扮殑錛岃繖涓猧rrlicht鐪熷緢浜嗕笉璧鳳紝 铏界劧鏄紑婧愮殑錛屼笉榪囨劅瑙夊凡緇忚揪鍒伴偅浜涘嚑涓囩編鍏冪殑鍟嗕笟綰х殑3D寮曟搸涓婂叿鏈夌殑鐗規(guī)с傝屼笖璺ㄥ鉤鍙幫紝鍐欎竴嬈′唬鐮佸彲浠ュ湪澶氱鎿嶄綔緋葷粺涓婄紪璇戙?br>
鏀寔.3ds, .md2, .obj, .pk3, .ms3d, .bsp, .x, .bmp, .tga, .jpg, .psd, .pcx 絳夌瓑鏂囦歡錛岄熷害蹇殑娌″緱璇達紝姣旀垜鍐欑殑閭d簺3D娓叉煋搴撶被蹇ソ鍑犱釜綰у埆銆?/span>閭d釜UI搴擄紝涔熸槸鏃犳晫鐨勩傘傘?/span> 寮婧愮殑鍔涢噺澶己澶т簡銆?br>