directx游戏编程基础教程

directx游戏编程基础教程

ID:15176083

大小:15.75 MB

页数:294页

时间:2018-08-01

上传者:U-14522
directx游戏编程基础教程_第1页
directx游戏编程基础教程_第2页
directx游戏编程基础教程_第3页
directx游戏编程基础教程_第4页
directx游戏编程基础教程_第5页
资源描述:

《directx游戏编程基础教程》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

ᐰ☢ᙢ Ḅᔜ☢,⌕ᑁᒹ:!"#$%&'(Ḅ)Ạ+,、0»^^<./ᐵ12ᢈ45〜^^0#87Ḅᐵ、08930:;12<=>?@、A᱄C…DE⚣?@、08A1GHᐭᜐᳮ500LM᪾OPᑁ。R᜜,TUVWX YZ[Ḅ]^M<_`a!,5/bḄc9ṹ^10>^%8☢,@AᙠCD0^E19:#ᢈGH,IJKᵨ:#ᨵᡠNOPQRSTUᐭ,᝞WXᩭZᜓ]^_ᜧ`ab8OcᩖefᓄhijkḄ:#,R◤⌕nop▅/rᐵtᧇ,Sv▅/e8wxyUᐭz{ᝈ}~ḄẠ。IJZᜓᵨ07^8᱄n$ᓫḄKᵨ:#>^81(^8ᢈGẠḄ:#ᕒ,Ḅᑁ4T。⌕ᵫᑏ。ᔺ、ᖆ ¡、¢£、¤¥¦、§ᱣ、ᑢª、ᡚ¬、ᑢ᳝®、¯᧽±、ᕜ᧽³、¯´µ¶·¸¹%ᑖ»⁚Ḅᑏ8Otᧇ᦮ᳮ、¿ᑴ、᪥¶ÃÄ。ᨬxR⌕ÆÇwÈ᱐ÊÈËÌÍÎḄ¥»ÏÐ。ᙠᑏvÑÒᡃÐÔÕÖ×ÕÖ,Ôw/ὅ᜽ÙoÚÛḄÜ,ᡂwz{01^89:#ḄÚÛᦟᩞ。PQᵫJÄὅàáᨵ▲,ÒãäᨵSåᜐ,çè/ὅᢇêᢣì。Äὅ2010ß7ᨴ 。ᦟçè&íîï᣸ᦟzᑁ4z{⌕AOᦟz⌕Õñízîòzî•07E8᱄Ḅᭆù÷ᢈGúᨬó1»•0û£^÷(^^0[、᱄^8O…ᓹþåÿḄᐵjô⑵^9÷abÑ•0^^19Ḅᡂ2C•⑶8᱄Ḅï÷•ᳮ⑶E8᱄÷ab:#åÿḄᐵj______________________________•ᔣ、▣8Oá☢Ḅᭆù÷•៉0309Ḅᦪzᦪó2»•ᕖÈ32ÑḄ:#p2~4⚜ᜓ •ᳮ^?1ÑḄ$!ᳮ-^McowMM^m____________________________________________•07"830Ḅ#j$᪀ó3»•0^6^30⊤☢ḄᭆùOrᐵᑁ4210^«€130Ñᐭ]•'^^30(ᜓḄᨵᐵᑁ4Oᐸ*+ᓄvÑ•078309£-᡽/Ñ______________________________________•ᳮ0ᢕ830ᙶ᪗j•0«^130ᐗ5`•ᳮ01ᕸ130ÒḄ7⁐⊤9ó4»•ᣜ᝞<ᵨ⚔A>?@A>?¿ᑴ41ᐗᦻ¿ᑴ•0È^30ÒBCᦻḄ¿ᑴ•ᳮ01D130EFG᝱•IJK______________________________________________________________•ᳮ0^^130⚔ALᣚ÷ᐝ᯿Oà+ó5»•ᳮ07^830▣5`21⚔Aᙶ᪗Lᣚ•0P0⚔ALᣚḄᐹ#R_______________________________•ᳮ0ᦈ830ᐝ᯿TU`ó6»•ᳮ0^^830ᐝV÷ᩞW21ᐝ᯿•07X830ᐝ᯿ᦔWḄZ_______________________________*ᔠ^•[ᳮI^Ḅ_`ó7»•ᳮ[ᳮva>bcᙬUb2~31[ᳮ᧜]•ᳮ[ᳮ▤fgᔠ•ij[ᳮ᧜]___________________________________________________________•ᳮ1k8gᔠḄlᳮ•ᵨ0^gᔠRmnᦔWó8»•ᳮ01^830oᓄlᳮ2~3101(^30EFᢈ•p0^30oᓄᦔWḄR•0⛭(^30UrstḄvÑ÷lᳮ•01^<^30UrutḄKᵨ____________________________________ VI(é)íîw^i________ᦟzᑁ4z{⌕vOᦟz⌕Õñízîò¥^•ᳮ07830yzU`Ạ•/ᓫ|<#}Cᦻyz~`•ᦻyzU`Ḅ¹Fó9x•ᳮyzU`Úᓄ4~62yzU`•ᣜyzU`5•ᳮᱥ#ÿG᝱Ḅᑴ•ℳÎyzU`___________________________________•ᳮjkḄlᳮó10»•ᳮ÷AÖᮣ22AÖᮣ÷jk•jkḄᐺ`R•jkḄSR>b________________________________•ᳮ}CᙢUḄlᳮ•ᙢUó11»•ᣜᓄḄᜩU>42᪀⌼•ᳮaḄlᳮ•ᳮ᤬!5OᐸR___________________________________•¢^0^1ᦪ£5`•1«^1^¤ ¥ó12»•ᳮ¦15ᓃᦪ2HLSL⁐ ¡•81^0§©。ª^0^1Ḽ⁐ᘤḄp_____________________________^^^⚔Aₛ⁐ᘤḄᭆù⚔A¯~~~•°ᵨ⚔AḼ⁐ᘤḄp•ᳮᵨ⚔Aὅ⁐ᘤRᐝᖮTU`4~62ó13»•ᳮ²Ḽ⁐ᘤḄᭆùḼ⁐ᘤᦔᩴ•pᵨ²⁐ᘤḄp•ᳮᵨ²Ḽ⁐ᘤR³´µ9•ᳮᦔWḄᭆù÷ᵨ•ᵨᦔW¶ᳮ&᝱________________________________________•T_DircctX“10ḄᢈG¾᪀Oᐸ¿ᢝḄ¹⚣zb•ᳮ9(^Ḅᡂ8Oᭆù•ᵨ901001ᑴį¹Ḅp42ó14»•ᵨ90^Âï¹ḄpDirectX0¸0¹⚣•ÄÅÆî7Ç】OÑ•"ṹÉÎḄ907API•ᳮ“102Ḅᭆù•^»^102Ḅ*+ᓄ8Oᵨ9^1102Âï¹Ḅp•tVÊ~ᦻzb8O᝞<ᵨ91^102¹Ë¹⚣ᦪ£•ᳮ@0ᦈB1C᝞ḄFGᓄó15»•ḄÏÐ,Ñ᪗Òᐭᜐᳮ0Ì81ÍD÷Ê2-31•ᳮabᩚÒᐭᜐᳮΕÔÌḄlᳮᐹ#R______________________________•ᳮô9ô×᪾—ᡂ、^Ø8OlRó16»•ᵨ091^᪾¾Ḅp2-3101_^Ñ᪾¾•¢᝞<ᵨô9ô×᪾¾Fᦻ•᝞...................36DirectX........................................93.3.2⚔@AB....................................371.5.50^^ᕂ ]^M……103.3.3ç"30[ᜓv...........371.6113.3.4[ᜓCᜫ.ឮF.......................41m...................................................................123.4ᨬíᓫḄA3〇M...........................41Î2U⚜ᜓ+,................................................133.4.1M)᪀...........................422.1ᦪ)Ạ................................................J33.4.2jᵨIäJ...............................422.1.1ᔣ............................................133.4.3KLᓄ1^A30.......................422.1.2▣.............................................153.4.4MN12....................................432.1.3☢............................................183.4.5OA30M...................452.2%432ᓹ1)Ạ................................19*3.5A309£J᡽¯.......................452.2.1?@>^2ᜐ1MḄ)20ü:¹óḄý⁚w⌱/ᑁ4。 VIII3.5.20^309RKLᓄ...............465.3.4{ᣚ....................................723.6........................................................475.4ᙶ᪗{ᣚ]^M................................72^M.....................................................................475.5........................................................14Î4U)1ᐗ<ᦻUᑴ...........................48m>]..............................................................754.101"30ᙶ᪗........................................48Î6Uᐝ᯿........................................................764.208A30)1ᐗ....................................486.1ᐝ᯿Bi>........................................764.30ᓄ30ÊḄX⁐⊤]............................496.1.8᛻ᐝ........................................764.3.1ᵨ03ᓹ0^0äJX⁐……506.1.2mᐝ....................................764.3.2ᵨ0300^0{^Cᓃ0£äJ6.1.3☢mᐝ...............................77X⁐............................................506.1.4@ᐝ.......................................774.3.3ᵨ03ᓹ᱄0^0äJX⁐...506.2ᐝc........................................................784.4ᵨ⚔@Z[Uᑴ12.......................516.2.1ᐝc=>....................................784.4.1⚔@᪀<⚔@56...............5】6.2.2ᐝcឋ....................................794.4.2ᑁ[=>................................526.2.3[÷.zᵨᐝc.......................804.4.3ç⚔@Z[............................526.2.4vᐝcḄ@×...................8J4.4.4MN⚔@Z[12...................546.3ᩞ........................................................8!4.5ᵨ]Z[Uᑴ12.......................556.4ᐝ᯿<ᩞ]^M...........................824.5.1ç⚔@^[<]^[……566.5vᐝ᯿<ᩞḄ@×...................844.5.2ᵨ]^[Uᑴ12……“.576.6........................................................844.6_;ᦻUᑴ........................................58a、^1.....................................................................844.6.1ç1030᱄ᓹ0⛭v...............58Î7Uᳮ᧜................................................854.6.2ᵨ1030᱄?0b" Uᑴ_;7.1ᳮᐗ4.ᳮᙶ᪗...........................85X^-............................................597.2çᳮv.............................•.……854.6.3cd᳛B...............................607.3ᳮ6.........................................864.7MNf᝱................................................607.3.1ᨬ@v᪵................................864.7.1Ḽ⁐i6....................................617.3.2ឋᳮ...........................864.7.2ej2kᐙi6.......................6/7.3.3ᔜᔣឋᳮ...................87*4.812mno............................................627.3.4ezᳮ...................S74.B.Ipq[ᜓᔲsᢝeuv᪵…y7.4ᳮᙬi6........................................884.8.2çᵨeuv᪵Ḅ080307.4.1u⌕ᳮᙬi6...................89[ᜓv....................................627.4.23ᳮᙬi6...................S94.8.3zᵨeuv᪵............................6J7.4.3ᜳ ᳮᙬi6...................904.9........................................................637.4.4j᪾X⁐ᳮᙬi6...........90ᑴ.....................................................................637.5ᳮ᧜]^M................................9!Î5U⚔@ᙶ᪗{ᣚ........................................647.6ᳮ▤¢£ᔠf᝱...............................925.1⚔@ᙶ᪗{ᣚ<ᐝ᯿~ᭆ……647.6.1ᳮ▤¢¤ᔠf᝱[¥……"925.2▣=>................................................<557.6.2ᳮ▤¢£ᔠf᝱]^M…¦5.2.1D3DMATRIX...........................657.7eᳮ᧜........................................945.2.2D3DXMATRIX...........................657.8.........................................................965.2.3D3DXMATRIXA16...................67m........................................................•............975.3ᙶ᪗{ᣚ................................................67Î8U01□(^30MNᢈ§................................985.3.1{ᣚ....................................678.1C¨1^£ᔠ................................................985.3.2{ᣚ....................................708.1.1C¨^^£ᔠ©ᳮ.......................…ª5.3.3ᢗ{ᣚ....................................778.1.2C«1^£ᔠᦪ...........................99 8.1.3C1ᓹᓄ£ᔠ]^............................999.8.........................................................1418.2¬ᓄᦔ®................................................101a!.................................................................1418.2.1¬ᓄᦔ®¯°©ᳮ...................101Î10U@Yᮣ.μ............................1438.2.2)w²Ḅ¬ᓄ.......................10210.1μ)©ᳮ...........................1438.2.3¬ᓄᦔ®]^M...................W310.2μ<@Yᮣ....................................1448.2.4v¬ᓄᦔ®Ḅ@×...........10410.2.1@Yᮣ⚔@᪀<⚔@56…/ᒺ*8.3i³´............................................10410.2.2@YᮣḄᜧ4.....................—“1448.3.1i³´...........................10410.2.3@YᮣḄᳮᙶ᪗...............1458.3.2iᩗZ[....................................10510.2.4@YᮣḄMN.......................1458.3.3i³µ[÷............................10610.3μḄᐹg¯°.......................1468.3.4☢▢....................................10710.3.1μ᪀.⚔@᪀...........1468.4.........................................................11010.3.2μ=ḄäJ...............146a!.................................................................iw10.3.3μḄç<├Ô……147Î9U·5¸>................................................11110.3.4μḄÕ...................1489.1·5i>)Ạ........................................lU10.3.5μḄMN.................../509.1.1¹º»....................................11110.3.6μ]^M.............../529.1.2·5¼,<ឋ^[...............U210.4Ö×iØ............................................1549.1.3½"º»....................................JJ310.4.1ÖÙμ᪀.......................J549.1.4Uᑴ·5i>...........................U310.4.2ÖÙμA=ḄÇᑴ...........1549.1.5¾◖·5i>...........................11410.4.3⌾NÖÙμ.......................1559.1.6ç·5i>............................11410.5....................................................1569.2íᓫ¹g<:;ᦻ·5i>……115a!.................................................................1569.2.1çíᓫ¹g·5i>……】15Î11U)ÛØÜ×᪀⌼............................1579.2.2ç:;ᦻ·5i>...........11611.1:;ᙢ2iØ....................................1579.3ᦻh·5i>........................................lV711.1.1)ᙢ2·5Ḅ᪀Þ...........1579.3.1i>ᦻh56...........................U711.1.2ß01.ßᦪ¸...............1619.3.2ᵨJᦻh·5i>...............11811.1.3ᙢ2àÑá@ß0ḄB".I629.3.3v·5i>Ḅ@×...........12111.1.4¨ḄB............................1639.4·5i>ᓄ........................................72211.1.5ᙢ2iØ]^M...............1649.4.1ᓄÀᦪ<ᓄ6...............72211.2ᜩÆUᑴ............................................1659.4.2ឋ⊤........................................』2311.2.12ᜩÆ................................1659.4.3ᐸó·5i>ᜐᳮÀᦪ...........m11.2.2ᜩÆã....................................1669.4.4·5ᓄ]^M...................12511.2.3ᳫ2ᜩÆ................................7679.5ᦻh·5i>=....................................12611.3ÛØ᤬3½.ÛØÜ×{...........1689.5.10Áᓃ^8&=ḄäJ...........12611.3.1ÛØÜ×{)©ᳮ……1689.5.20ᡬ16^8ÄḄ¯°...............12711.3.20^æ6⎋=............................1699.5.3ᵨ€᱄?^^^8»1=MNᦻh11.3.3ÛØÜ×{Ḅ¯°...........m·5i>....................................12911.4....................................................1739.6ᱥgÆ1f᝱ḄÇᑴ............................J30a!.................................................................174*9.7ℳÉÊË=>·5i>...................7J2Î12U^^31ßḼ⁐èé...........................1759.7.1ÊË=>)©ᳮ...................7B12.1ᦪ¸=ᛯ............................................1759.7.212£ᔠᢈ4............................13412.1.1᪗ãᦪ¸=>.......................V759.7.3ℳÉÊË=>·5i>=12.1.2ᔣ...................................mÌ............................................13612.1.3▣........................................177. X12.1.4Fᩖᦪ¸=>.........................17914.2.2ᵨC0^0。1ᑴmôE…#/ý12.1.5{Ḅ$ì...........................18114.2.3CᓚLKLᓄ.......................219】2.2ABî<èï....................................J8J14.2.4ᵨ᱄C(^þÿôE...........22112.2.1ABî....................................18114.2.5ᵨCᓚLþÿ~ôE……22512.2.2=>;ᣚ................................M214.2.69ṹ=ḄC01Cᓹ1〜22912.2.3èï........................................M214.3XAudio2................................................22912.3Àᦪ....................................................】8314.3.1C“102........................22912.3.1äJÀᦪ...........................J8314.3.2C0À02KLᓄ...................23112.3.2ᑁ¥Àᦪ................................!83*14.3.3ᵨC0À02bE⚣12.4èJ....................................................183........................................23212.5ᑏ1^51Ḽ⁐ᘤ................................M514.3.4ᵨ᱄C^^02þÿôE……23512.5.1òbᦻh................................J8514.4....................................................23712.5.2ᑏḼ⁐ᘤ9ṹ...................185a!.................................................................23712.5.3óḼ⁐ᘤ9ṹ...................186150  ᨬ....................23912.6....................................................18715.107^^1Í8*+ᓄ.................................239a!.................................................................ᥟ15.1.1_`0781Í⛭I^...........239Î13UḼ⁐ᘤ<ᦔ®....................................】8815.1.2Hᐭ[ᜓ.......................240•13.1⚔@Ḽ⁐ᘤ........................................18815.1.3_`8v81Í·(ᜓI^-24113.1.1⚔@Ḽ⁐ᘤ...................18815.1.4[÷[ᜓv.......................24113.1.2⚔@ô×.................................!8915.1.5Hᐭ[ᜓḄ«ᩗ……24313.1.3ᵨ11151⚔@Ḽ⁐ᘤḄ)15.2Hᐭᜐᳮ....................................244........................................19015.3᪗Hᐭᜐᳮ....................................24613.1.4ᵨ⚔@Ḽ⁐ᘤ¯°)ᐝ15.4{|ᩚHᐭᜐᳮ................................249᯿᥎>....................................194*15.5....................................................25/13.234Ḽ⁐ᘤ........................................19915.5.1 ḄB...................Z5213.2.134Ḽ⁐ᘤ...................79915.5.2 Ḅ{ᣚ...................25313.2.2ᵨ34Ḽ⁐ᘤḄ)ö〜79915.5.3 .ᱥg7@ḄB…#13.2.3ᵨ34Ḽ⁐ᘤ¯°÷ø015.5.4]^M.......................254ù]..........................................20215.6....................................................25513.3ᦔ®....................................................203a!.................................................................25513.3.1ᦔ®................................203•Î16U。᱄M᪾O................................25613.3.2çᦔ®................................20316.10᱄1^M᪾Oᒈ᪆............................25613.3.3ᵨᦔ®................................20516.1.1007᪾Oᦻhñᡂ<ïð25613.3.4eú¨ᦔ®............................20616.1.2ᓹ。L᪾OÿÀᦪ...........257*13.3.5ᵨᦔ®#ᳮf᝱................20916.2ᵨ£0071᪾....................................26013.4....................................................21216.2.1¯°[÷ÿÀᦪ...........260a!.................................................................2/216.2.2KLᓄ0。L.......................26114DirectX^0⚣................21416.2.3ᐸó00L[£...................26114.1DirectXC^1。 ............................21416.2.4ç................................26214.1.1ᓹ^Cûᓄᢈ4O᪀.......21416.2.5ç01930[ᜓ...............26214.1.208"C0À0sᢝḄE⚣16.3ᵨ0᱄LUᑴᦻ............................26356........................................2/516.4ᵨ0LÇh....................................26514.2XACT....................................................2!616.4.1KLᓄv᪾........................26514.2.1CᓚL ...........................2J616.4.2MNÇh................................266 XI16.4.3ᜐᳮÇh²h........................26716.5.5¯°Ü×{.......................27216.4.4ÿv᪾............................26716.6....................................................27316.5ᔠ¯^............................................268a!.................................................................27416.5.1$ᡂM᪾O.......................269▬CDirect3D10.08□3011……27516.5.2᪀⌼)Ü×.......................26916.5.3òb×E.......................277ὃᦻ.............................................................25216.5.4òbHᐭᜐᳮ.......................27/ ·ᙬ:http://www.hzbook.comᦟsᢝ:010ý8353079,88378995207&9ÑSQab8OឋØiÝ#Kᵨ:#ᕒᡠ完念◤ᐹᜓḄᢈØ, ᡂwᡠᨵ〜4(^0%3:#ᕒ◤⌕ḄᢈGẠ。8ô7□(^☢,ᑁ4ᐰ☢、Ïឋ£,Ö(TᜧḄ9Ñíx{,ᜧ8Ḅ9Û,e8ᙢA*zὅᐭ]。游戏编程基础教程⌕ᑁ4•00^<ḄᢈGú、ᡂ÷Ø、ï÷。•z{ô7□^᱄ᡠ◤ḄᦪzẠ、Win32ᓹ7ÑẠ、C0MᵨẠ。•07□(^30ÎÑ,ᒹ:ᐗ¿ᑴ、⚔ALᣚ、ᐝ᯿、[ᳮ᧜]、113gᔠ、oᓄᦔW、Urst、yzU`、jk、a、Ḽ⁐ᘤᦔW¶„_0^(^<1^0¹⚣Ñ,ᒹ:07□0^<1^0ᢈG¾᪀8O¿ᢝḄ¹⚣zb、XACT、᱄^702:#¶。•07□᝞Í117Òᐭᜐᳮ÷ÊÎ,ᒹ:ᵨôᡷ᝞Í8ᜐᳮÏÐÑ᪗,8OabᩚÒᐭ、ÔÌḄlᳮR¶。•091^Ñ᪾¾,ᒹ:09ô×᪾¾ḄᡂØ、ᵨ0᱄1^᪾¾¿ᑴᦻ¶。¾ᢣ:T!/ISBN978-7-111-31561-2()*+:(010)88378991,88361066*+:(010)68326294,88379649,68995259ᢗ.*+:(010)88379604/ὅ12:hzjsj@hzbook.com¥»yþhttp://www.hzbook.comÿyB:www.china-pub.comIMttmm* Î1U01□^.{|í»✌ᐜCD8^89ḄᭆùᢈGú,/ὅI0^819ᨵo=ᜧḄᳮ。ᯠxCD07(^9ḄØ、07D19÷ab:#、07^89Ḅï÷¶ᑁ4,/ὅØT^᦮#01^8Oᐸrᐵᑁ4,wxyz{ᝈ}Ạ。1.10#(^^3.1I、¯¹ᜐᳮØÔḄS,Äwo=▬¹Ãᐹᒹ,ᵨJᙠ^1^0~8á'(#ab。Rᙠ07"(^(ᡂw〜^^(^8jk)HḄ@⌕ᡂ%ᑖ,8¿ᢝᔜ*R"µᓱ,,ᡂwI᦮=iÝ#jkḄᔜ>☢-ᨵ.}ឋ/0Ḅ:#1ô。IJ23ᡠÛḄ8"8᱄▭ᨵ5*SḄõ©:o*õ©Qᢣ07“9SDK(67“8(^:#Ãᐹᒹ”)^*SDirectXAPI(8(^KᵨÑÑ1ô),8Q9:;<ḄoᝅᵨJ:#ឋØiÝ#ÑḄÑ1ô,=᜜o*õ©Qᢣ07(^(X_11^(DirectX$?),8QoÎ᝱@1?,Q$ᵨ8(:A80X:#ḄÑᡠ◤⌕ḄÎ᝱?。ᙠïabÑî,3BCÈo=9᪾,DEᵨᡝQᔲïH᱐Ḅ07"(^(,JîᡠᑮḄ889Qᢣ0L89᝞ᕲ^1^0IJ:#ᕒᩭÛ,8"8᱄⌕Qᢣ8(^(SDK,Òᑮᓹ789î,᝞NᱯPÛ·Qᢣ07Q8950R。=᜜,IJ*S1T88᱄ḄᵨᡝᩭÛ,RKüUᑖ889÷8ᕸᕸ,07DᕸQ9:;<:#ḄiÝ#íᑴÄ:。VwBὅḄ#¹rD,ᡠ8*zὅ4᧕gX。01"(^(,SQo=ᓫ³Ḅ?1,8⌕ᒹõ0^^1᱄0。?1^8、DirectXAudio、DirectX11^8}ᜧ%ᑖ,Zo%ᑖ-ᒹõi=Ø,ᐳ᪀ᡂoᝅ[᦮ḄiÝ#:#1ô。Jᝅ:#1ô⌕Q8001ḄbÑᕒᵨḄ。ᐸÒ](^0『Í^D]_`(8OÎ〉ᜐᳮ、07"^9“〗0IW¯¹ᦔWḄ¿ᢝ,DirectX1Í8Iᔜ*Òᐭ(ᜓḄ¿ᢝ。ᨵᐵ889ᔜØḄᐹ#Ø,ᙠ»x☢RB]CD。ᙠ078950XḄciØÒ,8830Q]_`:#Ḅo=,·Q889Òᨬ@⌕,ᨬcᩖḄ。dḼ0^^830᱐ḄSefH,ᐸØgᩭg£ᜧ,hI07^830Ḅ¿ᢝ·gᩭg。iiᙠH᱐Ḅ8^830jj#Sk,hᔆᖪBnoÈ¿ᢝᨬH᱐8^830ØḄµᓱ。pû07830ᡂw}C:#⚞r_Ḅ᪗Z,stᙠᨬHḄᑩ^0᝘Vista、〜^(^57vÄjkÒX0ᓄ830ÄwvÄjkḄAw,ÃxvyozᵨḄ08/001+。 2oooÎ1U*1.2OpenGL、XNA^WPF|zᩭÛ,⁚ᑁ4S}JḄᶖ,PQJᑁ4÷8(^ᑗrᐵ, ·QpûO$Ḅ8O☢ÑᢈG。ÄwᢈGú,TWOpenGL、XNA8OWPFQ,8O8Ð÷0189åÿḄᐵj,e¹UI889Ḅᳮ。1.2.1OpenGLOpenGL(OpenGraphicsLibrary,:Ãឋ?)VJ501;☢。•:#á'>☢。0?E01á'¿ᢝ,e8ᵨJìûᔜ*O$ḄvÄjkå,᝞ᑩ1^0ê8、Linux、UNIX、Mac(^¶。0^830¦ØᵨJ>^^0>^vÄjk。JQ(^^0rIJ07830ᨬ⌕ḄÚA。•Kᵨ⚞r>☢。ᨬ*OpenGL⌕KᵨJ ⚞r,.0〖^^30⌕KᵨJ>^ᓄ(^8á'Ḅab:#。SvpûJ*Sµ8(^30·⌲pN ⚞r,ᨬ|ÈRḄ¡i :#á',᝞9ᓄ0018,ᙠjQJ01"830:#Ḅ。ᙠ8û, :#á',᝞9£&、”×〖¶,ᙠj-QJOpenGL:#Ḅ。•W$¤>☢。ᨬ*0?ᓺ0ᓃ⌕ᐵüḄQW,8^830⌕ᐵü$¤。wû¦8080"µᓱᔆ§¨ᔠÄ,w0^830cᩖ[ᳮ᧜]、ᱯPᦔW(᝞mn)8O}Cᡠ◤Ḅh¹¤Ø。Sv,)^2002#0©%1309.08ᩭ,0^^130ᙠW>☢ᨵµḄ,ᐸW,S0?ᑗ0ª,ᨬ ÈḄ01^830lC^PDirectX11,ᙠW>☢-ᨵ«Ḅnp。•1ôb>☢。0^830Q80(^^1ôḄbḄ,0?ᢕ01Q8Î᝱@1?ḄbḄ,¬ᵨl+ᓚ ¡ᦪḄ&ᵨ>b。ᡠ80!^0[rIJ0^(^30,z{®ᩭ⌕rI4᧕,PQᙠᐹ#ᵨîᑣS᝞8ᕸ130>¯。û☢ᑮv,07830Q07"(^(Ò]_`%ᑖḄØ。◀07ᕸ130å᜛©,Rᨵ_`¹⚣:#Ḅ8(^(Audio,8OᵨJᜐᳮÒᐭḄᓹ7^89hput。(^ᓺ0·ᨵoᝅ]ᵨJ¹⚣:#Ḅ(^^11Ñ1ô。᪵,0?ᓺ[rIJ8(^9“〖0ᐸ⌕ÚAQe8á',PQᙠ¹⚣W>☢⌕8ᕸA^0³⁐´i。1.2.2XNA9:ᙠ20006ᨴµ^£×ᡊᶍ,.〜£1Q9:;<ḄHᡊᶍ,ᡠᨵ9:;<Ḅo¸-X¹J=ᡊᶍ:#。”£×á'Iº»Ḅ:#á'n$µ℉½£,o*ᐰHḄ: 01「6(^.{|íOOO3:#Ub᪗Z。)^20029:#óo=᱐Ḅ^£×?^6〜0ᓄ(d%5¿1Studio5£×o#)8ᩭ,5£×¯À☡oî,ᡂwᨬO$Ḅ:#á'åo。pû¡iᖪBS:#Ãᐹᒹ,⌲p^lᩭḄ03Â:#᪗Zà ¬ᵨ〜£×:#᪗Z。9:wÄᔠ)ÅḄ"£×ᡊᶍ,ozᙠÆÔX0^^^9ᑮ“£1᪾¾Ò。dḼô7^(^(9Ḅ#,ᙠ0^^19Ò¹ᐭ43Ḅ8648891.0。ÇÈÉ©,^¿86(107E8Q9£×á'Ḅ8^^9,8Êô7^9ÒḄᜧ%ᑖØ,|ËRᦪ1ôḄooIK,8¯:#ᕒᙠ”£×á'ᑏឋØiÝ#KᵨÑ。▭9:ᙠ:#⑶(^8.1Ḅx»,ᨵo=Ì7åw⑶89forVisual8&ÍḄ⚗p,ì5£×Ḅóo=&6【&᱐ÈRx,J=⚗pLᡂ07(^.NET,·QManagedDi^ectXḄÏ。9:ᙠ200510ᨴ#Ḅ07"89SDK*,MATManagedDirectX2.0Ḅóo=ᓃᕸ᱐,PQᙠJåxÐÑ^3¿8&〇7"(^(ḄoᑗTᑜ。xᩭ9:µÃxManagedDirectX,Ì"åḄQ9^。XNAQJ.NETḄ、ᵨJab:#Ḅ?1。Managed0L8QI0^89Ḅo=“£×ᒹ,WQ&ᵨ8"(^᱄?1。XNAÓᯠ·QJDi^ectXRḄ,PQÔᨵManaged0々<^9Ö᪵z1&ᵨ0L(^:API,XNAIDirectXfjSḄÊ。᪵9·Sᓫ³Qoᝅ?1,8¿ᢝ、¯¹、Òᐭ8Oyضi>☢ḄØ,ᐸÒ}CÎᜐᳮ·QXNAᨬ@⌕ḄØ。ᵫJᙠab:#⚞r,oz⌕Q¬ᵨ00+Äw:# ¡,ᡠ8ÃwᵨXNAn$ab:#◤⌕o=vÑ,Ù¹5£1ÑᙠឋØi´⌕00+ѳ⁐o,ᡠ8^pûᩭÚJ=vÑRQÛ>᠒。Sv␺J^£1:#ḄÞiÚA,¬ᵨXNA:#ឋØiÝ#Ñ·Qo=S┯Ḅ⌱à。ᵫJXNAᙠjQJDireCtX:#Ḅ,Vûᙠz{ᵨXNAåû,0^᝞9ḄẠ RQᨵ⌕Ḅ,z{~£×:#◤⌕o}Ḅᑩ“0〜8ᓹ1Ạo᪵。pûXNAḄᨬH᱐Q3•1,ᐸjQJ8"8᱄9:#Ḅ。1.2.3WPFrIJOpenGLXNA,〜??÷Ḅ⚪âã´fä。␺J〜??Qèᩭᵨᡝ☢:#ḄOᢈG,,ᙠj·QJ07"(^9:#Ḅ,ᡠ8〜??Ḅêæ,IJᳮ01^<^(JoᡠçḄ᪗ZRQᨵ×ᜐḄ。⌕CD〜ᓹþ,R´ᐜ^〇01/〇01+Û®。GDI(GraphicsDeviceInterface,(ᜓ1ô)Qº»”01(^^Ḅjk,8_`ᙠf⚣µ9ᘤᡭᓺ!µ9ᦻ。0〇1Q^1^0>^3@⌕Ḅᡂ%ᑖ,SPÑᕒw^!^(^3ᑏḄKᵨÑᙠµ9fé1êî◤⌕ᵨ0ô1,ë〜ᓃ¹>^vÄjkH·Qᵨ001ᩭµ9ᵨᡝ☢I^Ḅ,᝞ìᓫ、íÎᩩ、᪗Ñ᪗ᐝ᪗¶。Óᯠ0013£ᜧḄØ, ᵨ001ᙠïô¿ᑴ·Ûᓫ,PQ001¦Qo=☟᝱Ḅµ9jk,¦ᨵᨵ▲Ḅοᢝ,û᜜001¦¿ᢝBC:#。ᡠ8001S〉ᔠ:#ឋØiÝ#KᵨÑ,᝞abÑ,ñQ9:8o=▬¹:#ÃᐹᒹḄb,07ᕸ19。åx>^1^(^8á'Ḅ:#,òḼ5ᩩ⍝ôᔣû#/,oᩩQ〉ᵨñBC☟᝱(⌕Qᵨᡝ☢):#Ḅ001,=᜜oᩩ¯Q〉KJ}CÎ:#Ḅ0ᓄ830。 4oooÎ1UᐸÒ001⌲p#/w001+,001+Qº»õ^1(^8jkAw001Ḅö÷ὅ,Q>^“0〜8᱄?¥11^0〜858"『2003vÄjkḄA°。pû3ᵨḄKᵨÑ:#á',NàQJ5£×Ḅ^“0^ï#,RQ8û%5¿18354ÒḄï#ᡈJ0+"ṹḄ«^,8O06ø1^0+8᝞᝞『ÒḄï#,ᙠj-Qᵨ001/001+_`ᵨᡝ☢Ḅµ9。=o>☢07^830Ḅ#/⌕001/001+Ḅ#/ù¤´i,᱐Seᓣ, ᩽ᜧᙢÎhḄ#/。hḄü¤#/Ivᩭ-ᙠo}ÑÎᢈGḄ#/,wýOᩭ¦þ▲JឋØ⚞rḄ0&^30hẠ。Ù¹ÿ、fé☢#ò◤ÕḄü¤½¹,´ᩭÄw▬¹%ᑖḄ8^830ᓾ⌲ᡂwO。IJo7810〜8vÄjkHḄAw,UWindows%D:+ᙠj·Q¬ᵨ0^830,Ãx20iᩭoz¬ᵨḄ001/001+。᝴Q0ᓄ830ì᝞ᨬ*(T8ḄpḄ,⌕☢ᔣឋØiÝ#KᵨÑ。Vw8ᩭcᩖ,ᡠ80^^30|ËNᵨJ:#k5`Ḅ^1^0^8KᵨÑ(᝞ᖪ:)。,ᵨjḄ0^^130:#1ô᪀`ᵫᔜ*ᡂḄᵨᡝ☢,SQo4᧕Ḅ_ê,ñQ^^^¯K n。WPF(WindowsPresentationFoundation,〜〗^0〜5ᕈRẠ),Q^。᝞#5^13>^1^(^87Ḅjk,᦮ᔠᵨᡝ☢Ḅ[᦮>ᫀ,ᒹBC÷}C、ᦻ᫏8OᦪÜÝ#。ᙠ>^^Ò,jḄᢈGSÙQ001/001+,Q0^830。S¶_`*ᵨᡝ☢,ᑈ??KᵨÑᙠj-Qᵨ07^(^30。JUᕡḼ,S¶Q(TcᩖḄ}C(JQ04^130Ḅᱯ«),RQ¿ᑴ|=ᢥ8OᓫḄᦻ,ᡠᨵ¿ÃÄ-Q2vDirect3DMAS(pipeline)[ᡂḄ。Vû,ᓽQᨬý2Ḅᖪ KᵨÑ,·ØTᵨÿḄᦔW,᝞mnI᪵。ᵨ”??Re8×Jh¹¤,wឋØ07"830Ñ23XeØiḄÃÄÊ?0(ᜐᳮᓫᐗ,µᓱᵨḄᜐᳮᘤ)n$ᜐᳮ,wû◤⌕n$¡icᩖḄᜐᳮ,>^??ᓄJoᜐᳮvÑ。1.1µ9^1^(^8ᢈGḄ#/Lᓄêæ:ᨬ*Q001/001+0᝞830,ᑡ#/,Rᙠ⌲p#/w8Direct3DwẠḄWPFÌ"lᩭGDI/GDI+_`Ḅ⚞r,8^830ḄkKᵨ⚞r,◀1^D30Hå᜜,-ÈRWPPvvtrrXNATXNA。ìᯠWPFXNA-QJ•NETḄGDVGDI+Direct3D^>Dircct3Ur*w>^<^m:#ᢈG,0ᓄ^30QJj?1Ḅ!:#ᢈG。Ùå8^^30RᙠSÙQo=ᵨ11.17^^0〜812ᢈ4Ḅ@¯{ᓄJᱯP⚞rḄ▬¹:#Ãᐹᒹ,ᡂw᦮=ᑩ1^(^8jkḄẠ。9:%??Äw^1^0A8ᵨᡝ☢Ḅ:#ᢈG,Ì"J001/001+Ḅᵨᡝ☢:#ᢈᩈ·◤⌕o=vÑ。J001/001+Ḅ☢:#ᢈGrIJ〜?ᓹf¹ᡂ,,¡iᱯRÔᨵ[ᐰᡂᑮ〜??ÃᐹᒹÒ。1.307□(^(Ø88950&QoᝅÿḄ:#1ô,ᒹõSḄØ,8(^(501^Ḅᔜ=Ø,e8^᦮#0^EA50&ḄØ。dḼ07(^^50〖᱐ØḄSeᓣ,07^(^9ḄØ·ozᙠSeLᓄ。Rᙠô7"^9ḄØÌᑜᑖ}ᜧ%ᑖ:DirectXGraphics、DirectXAudic^pDirectXInput。 08□(.{|íooo59:^078᱄9.0:+,ᵫJᔜ=ØḄ᱐fHSÙo, ᨵØ,᝞07830,RÈRi=᱐ᐳ?Ḅêæ。ᡠ807"8᱄Ḅ᱐Rᙠ·SÙ8ᦪÜn$᪗,Qᵨ#»n$᪗,᝞ᵨḄQ20098ᨴ#Ḅ07"(^᱄50〖,ᓽDirectXSDK(August2009)。1.3.1DirectXGraphics0^890^0'8Q0L(^50XÒ_`:#Ḅ%ᑖ。ᙠ0^(^Ḅº»᱐Ò,ᜐᳮ%ᑖᒹ_`BC:#Ḅ8"(^>&^_`}C:#Ḅ07830。WDirectX8.0᱐åx,BC}Ckoᵫô7Èôᜐᳮ,SÙᓫä88ᓹ^…,îX_`ᜐᳮḄᔜ=(ᒹo#)ko7w0^^᱄0^ô1^8。ᵫJ07"(^30Q0^890^1^Òᨬ⌕Ḅ,,·ozQ889ÒᨬcᩖḄᡂ%ᑖ,8tJ3X01"(^30Ḅ᱐Äw078᱄Ḅ᱐,᝞ᨵîX$ᨵ8"83〇10Ḅ0^“9᱐7w0^8910,stᨵî07830·ᡂ8(^Ḅ"È%。ᙠô789SDK(December2006)᱐Ò#883010,Direct3D10Qo=ᐰHḄo¸,SQ0^8309Ḅᓣ᱐。£^D301081^1309ᙠjᢈG¾᪀[ᐰS,ñQóoSÈR5=᱐,?Ḅêæ,ᐸÒ0〖"83010¦Øᙠ>^1^0^5%8'8OᨬHḄWindows7vÄjk$。ᙠ07"89SDK(March2008)᱐Ò,Direct3D10ᓣᑮDirect3D10.1。ᙠ0^^1᱄50X(August2009)᱐Ò9:-#0^^3011,Direct3D11ᙠAᐭHᢈGḄî&ᶇ8⑷ô10.1Ḅᐰ%ᱯឋ。ᣚ¥)Û,Direct3D11▭Q0L(^3010.1Ḅ᡽/,ᡠᨵ07ᕸ【3010.1hᡠ⍳+Ḅ?1,IJ0783011᪵〉ᵨ。ᵫJ883011Q07"(^3010.1Ḅ᡽/SQᓣ,K&Direct3D11SØ[ᐰÌ"0L0^3010.1, Direct3D11·¦Ø$Jᑩ'0*8%81&8O,0(10^7vÄjk。JQpûQ8ᕸ〖309、Direct3D10/10.WtJDirect3D11}=᱐ᐳ?。ᵫJpû^8^^^9?-ᯠQOḄvÄjk, 0^8309SØ$Jᑩ1^0*$XP&&Windows2000jkå, ᙠ〜.(!(^^%513^^0*87vÄjkå·e8$。¹åIJ៉0^8309Ḅ:#ᕒᩭÛ,z{0^830100ᓄ(^3011|ËQ@H:+。ᡠ8889-ᯠQpû0L830ḄO᱐。µᯠ¦ᨵ¶ᑮ^^0〜8%8138Oᑩ'0A87ᡂwOḄvÄjkåx,Direct3D10ᓹᓄ83011B⌲p"/07ᕸ1309ᡂw8830ḄO᱐。␺JpûḄJ*RG,888309w,îὃ⇋ᑮ8xḄ#/,ᙠ▬2ÒI07830100᝞<^3011n$⌕CD。1.3.2DirectXAudioDirectx'70Q]_`¹⚣:#Ḅ%ᑖ。ᐸÒᒹõᵨJᑴ᱄3-360^810^8á'¹⚣:#Ḅ?1ᦪ,,rKḄÃᐹ,ᵨJnᡂṹJᡬᦪe8ᵨḄ¹⚣ᦪ£。ᙠ8(^¹⚣:#⚞r,ᨬ℉ÈḄ:#1ô5vJ071^850^^,8Qᙠ0^·^(ÒᨬºḄ¹⚣Ñ。£^^^561^IWℏ¯¹ᦔWḄ¿ᢝ,◀ØTÂÃÌc9zbḄ¯¹ᜐᳮg¹å᜜,Re8wÑ8¹᩽ᐹiÆḄ}C¯¹ᦔW。û᜜,DirectSmmd&^)9ᡈᐸ¦Òᐭ(ᜓᣓ;〜^¯¹ḄØ。 6oooÎ1U᪷£0^(^(50〖ᦻ᫏,RᙠS<ᡂᵨ8“50¿(^Ì"åḄQ9…7(>2。XAudio2eÑ?1,:#ᕒe8ᵨJ?1:#)ÅḄ¹⚣Aw。ᙠ07"89Audio*,Rᨵo=᪀`J᱄“702åḄ᱄<^pû᱐Q᱄0×3.0。9ᓚ×ᒹo=¹⚣(TÃᐹoᝅ÷årᐵḄ?1,ᵨJX¹⚣tVᡂnab。ᙠô7^“9ᓄ…ÒRᨵᐸ¦oÃᐹ?1,⌕ᵨJ▬¹Ø。ó14»X]CD0^^^(“10¹⚣:#。:ᙠ ᨵ!"#$0% 4᝘4Ḅ⚣()*+,0-0〖?^/1(:12345Wave、MIDI6Di^ectMusicProducerᑴ8Ḅ9Ḅ:᦮<=>ᫀ,Di^ectMusic@450&(^0A4᪀CḄ。Eᙠ0- ^8ᓃGHI0J02^XACT3ᡠ%L。1.3.3DirectXlnputDirectX1MNOᜐᳮᵨᡝSᐭ,ᒹV᱄1X60%^ Y!*+。ᨬZᙠ0%(^᱄50〖]ᨵ0^1 ,᱄1 @ᙠ0- ᱄50〖(October2005)᱐_`JEḄ。Xhputᵨa*ᜐᳮᩭcd1^360eᑴᘤḄSᐭ。0^/1 ?1123ghSᐭiᜓḄkᢝ,ᒹVmn、o᪗、qrᩚ、tuᩚ6>ᔣnw。ᑭᵨ0-(^^^^yeᑴz{✄iᜓ,}~ᵨὅḄiÆé,᝞ª=>7?Òô⌶ḄAB,ÌCᘤDÒîH#Ḅ◫ζᱯPᦔW。:*DirectXInputfpDirectlnput。1-3.4ᐸ*+◀F⌕Øå᜜,DirectX50〖Rᒹõo#,᝞0ᓄ^〖560^、DXUT、03098Oᔜ*#Ãᐹ。0^(^6〖Í8“9XG〖70^Ḅ)ÎïØ。IJÔᨵï070〖9᝞¹70^ᡈὅïÛº᱐ᓹ7HAI⑷JḄjk,:#ᕒe8ᵨ0^%61ÍᨬH᱐07ᕸ19Xᕸ711^Ḅ)ÎïØ。DXUT^feDirectX50XḄo=KᵨÑ᪾¾,K᪾¾ᓄ abḄ:#,,ᵨ090×:#Ḅabf¹LᏉ。DirectX50NÒḄ9Ñ、ᔜ*Ãᐹ,-QJ0᱄0×:#Ḅ。ᨬxo»,B]CD091×。030QᵨJᓄ0L830ÑḄ᡽/?,ᒹOojᑡ0^1ô、ᦪ、$᪀、Pp、Q、3¶。᝞0309ᵨJ⊤9▣、ᔣ8Oá☢Ḅ$᪀,,÷årᐵḄᦪ。0309Ḅᑁ43ÿ,ᙠÒB$ᔠrᐵᑁ4Ḅz{I0309n$CD。ᙠ ^ dḄ),ᨵ*+EᙠGH₞ᙠqr()ᵨ2,ᙠᨬḄ^(^:ᕂᓹ1*+。◀2☢ᑮḄDirectDraw6DirectMusic#᜜,ᨵ0%ᓃ0*60-(^^。0ᕸ151^13gᦪ¡¢Ḅ£¤¥ᣓᣍ6¨©kᢝ,ªkᢝghg«¬,ᒹV5?、MPEG、AV1、”?36〜dw。ᙠ()Ḅqr°±,²³C´⌕ᵨ ^5“〜*+。01^(^>1&712¶·¸¹gqrº»¼º、¶·½¢Ḅ¾¿À᛻,ᓽ0^(^^712ÃÄ#ÅḄᦪ¡¼ºÆy。²³ÇÈC´ᙠ()Ḅ°±⌕ᵨ0-0〖?1&>%C´ᵨÉᓄ0〜8SocketsSWindowsFirewall?15ËEÃļºÆy。:〜^^(^8500&5Ì5 -00(,ÍJ2_ÎḄÐ,ÑᐶÓḄÔὅÕ ÖὃØᐵ 01□00(.{|íooo7Ü。ᨵᐵᓹ7"*&11Ḅrᐵᑁ4,e8¸ὃ[)7"8᱄ᦻ᫏ÒḄ07"(^950«:×60^©&1Articles/Gamesandᓹ^^^ᓄ%ᑖ。1.407□(^÷ab:#pûab(#Qo=3RSḄ⚞r,¡i*zὅÙQTU2voḄz{:#abḄᔜ*ᢈG ,ᯠ ab:#NOi>☢Ḅᑁ4,ᑴÄoVab·WSQ=ᡠØ[ᡂḄ,◤⌕¡iḄᔠÄ。ᡠ8ab:#NOḄᑁ4,ᨵJz{p᪗,·ᨵJ8x=Ḅ#/>ᔣ。:#oVabt´⌕ᒹXᑜ、Ñ、YùᦔZ>☢Ḅᑁ4^ᐸÒXᑜᵫXᑜᕒ_`,⌕Q}abḄ5`⊤Rb。ab5`o[QJ|=5`ᩭ},᝞ÎÄ5、Xᶍ5、U5、⁐]^5¶。abḄ⊤RbQᢣ30⊤RbRQ20⊤Rb,ᐸø30⊤Rb-ᑖwf、ó}7f、_f,20⊤Rb-ᑖw⚔f、45°af。ᙠab:#Ò ᯠ⌕ᵨ¡i}CU`ᱏ([ᳮc),ᑴÄ}CU`[ᳮcQᵫYÃᕒ_`Ḅ。abÑ:#ÒᵨḄU`[ᳮc,23⌕ᙠÖdÑYeÑåÿn$á⊝。ᙠgfé⌕ÕḄû,eØhiU`ḄÖdÑ8O[ᳮḄᑖj᳛,VwÖḄU`ᑖj᳛Ḅ[ᳮ◤⌕ᓰᵨfiḄᑁ?,,◤⌕fiḄFîÿ,^Bµ/0ÑḄ$¤。◀U`[ᳮå᜜,R◤⌕wab8¹ᔜ*¯¹ᦔW。¹ᦔᕒ_`ᔜ*¹⚣ᦻtVḄᑴÄ。abXᑜåx,,Zᜓᔜ*U`、c¯¹,ᨬxḄÃÄQᑏabÑ。ᑏabÑQab:#Ḅ⌕ÃÄ,JQᵫÑ:#ᕒ_`ḄÃÄ。abÑ:#pû⌕¬ᵨô^^9(#1ô。2v☢Ḅᑖ᪆,e8ÚÈ:#ab◤⌕ᔜ>☢ᕒḄᐳᔠÄ。23ᩭÛ,o=ãÖ2JZ=>☢Ḅ 。·¦QCD8"89Ñ>☢Ḅ ,,SNOabXᑜ、YÃ(U`[ᳮᑴÄ)¹ᦔ(¯¹ᑴÄ)>☢Ḅᑁ4。1.501「6($<ï÷DirectX50〖23ᔠᵨ%8¿15〖8110n$:#,wᵨ0^8950I:#abÑ,◤⌕ï%8¿150^00L(^SDK,,n$rKḄ。Òᵨ%8¿15᝞(170.NET20088(^50〖(August2009)n$:#。☢✌ᐜCD÷88950〖ïrᐵḄᑁ4。Û:07"^9Q800p1ô>bḄJ〜71^0>¥8jkḄ:#1ô,ᔜ*3qḄ^“0^Ñ:#Ãᐹ,᝞%8¿15È0、Delphi#&C++Builder*,-e8ᵨ0ᓄ89:#abÑ,Sv23ᵨ^¿10+n$:#。1.5.1jk⌕Õwᵨ0^D950〖n$:#,jk◤⌕go}Ḅ⌕Õ。IJ8(^50X(August2009),jkḄᨬi᝞:•lGHzCPU 8—oooÎ1U•5124ᑁ?•108eᵨhÐÿ•WindowsVistaSWindowsXPSF2•VisualStudio2005•÷07^899.0r4Ḅµᓱ,¿ᢝ2.0᱐Ḅ²Ḽ⁐ᘤ⚔AḼ⁐ᘤ9:ᨵᐵ²Ḽ⁐ᘤ÷⚔AḼ⁐ᘤḄᭆù8Orᐵᑁ4,Xᙠó13»ÒCD。wᐙᑖᑭᵨ0^8ḄØ,´ᑮᨬḄ#ò,IJ078950X(August2009),₞᝞:•20D᪶0?"•lGBR#•108eᵨhÐÿ•Windows▽1513ᡈ〜ᓄ(1(^5XPSP2•VisualStudio2005Service?v。w1ᡈ915¿1Studio2008•÷ᓹ^“᱄10.0r4Ḅxᓱ•ᐹᨵy¯ᘤḄ¯ᓱ,ᵨJ¹⚣:#st1.5.207□(^9ï01"89ḄïvÑÛᓫ,Iñ~11^0〜8᱄?jk,zDïᒹ$ïÑ,ᯠx᪷£ïᔣḄ9[ᡂïᓽe。ᙠᑩ…(^^Vista&&Windows7jkÒï8"<^SDKB+,◤⌕ᵨ¶ᳮᕒᩗ▲n$ï,ᔲᑣïBᜫ}。ᐹ#>w:~D04^19ïᒹ,ᙠCÈìᓫÒ⌱à“8¶ᳮᕒH$”,ᯠx᪷£9n$ï。1.5.3⌱à&t?#?ï8(^50〖åx,o=@⌕ÃÄQ⌱àᔠD;fectX»5_o^-------------〉Ḅ>7?,ᓽQ⌱àᵨ&t᱐(debug)$?,jAndioDirtct3XI10.yUj0ir«cUb*«»RQᵨ#᱐(rdease)$?。aCupu;0ebug-R«4l0309ftjnOr>e:#ᕒᵨ&t$?e8⚗pÒḄ®U*D*yflV^wicrf0rocl309gVwonoattoA;eR»n^npRwtenxv-:&iab*ciShaderDtix^ngᙠ:#abî,`Úᵨ&t$?,[ᡂ⚗pwnceRdrt*BreakonWenwyLeak,Breakon03D9Efw:#xÙᑗᣚᑮ#$?n$ᨬxḄst。wᙠ0re«kOnAioclC0J5*$?åÿn$ᑗᣚ,ᓫD:+ìᓫÒḄ【ᡠEn9kMᨵÑIMicrosoftDirectXSDK(August2009)IDirectXUtilitiesIDirectXControlPanel]ìᓫ⚗。ᙠCÈḄ“0^^^}ឋ”I)᪾Ò,⌱à“Direct3D9”⌱⚗ᓱ,᝞1.2ᡠ9。ᙠ1.2ᡠ9ḄI)᪾Ò,e8ᙠ“Debug/Retailᕸ-D3D9Runtime”ᑖ᪾Ò⌱àᵨ=$?。IJ1.2ᓹ^^9}ឋI)᪾ 01「6(^(.{|íOOO9*»ḄÑ:#,`Úᵨ&t$?。¬ᵨ&t$?Qw¯J&t8^(^309KᵨÑ,ìᯠ,ÑB)ÎrKḄ}ឋ。᝞,&t$?Bw07^8309ḄZ=I^CÈ&t1ê,⊤98Q᝞<ᵨḄ,-Q᝞<³ÃḄ。Z=d9Ḅª´-Bᨵµ2,V hiKᵨÑḄ$ᦔ᳛。w;´0^8309&tᘤᡠonḄ&t1ê,e8ᙠ“Direct3D9”⌱⚗ᓱÒ·Ḅ0ᓄÍ0£8。"1¸ᙽn$&⁚。ºᨵfḄ&t¶,B´ᑮfiḄst1ê。`Ú¸ᙽ»ᑮ~¼,J᪵e8ᙠÑ:#Ò´ᑮeØiḄ&t1ê。ìZᜓ#⚗pî,¦◤ᙠJ=I)᪾Òᑗᣚ$?ᓽe。ᯠxᙠ“DirectXM#”I)᪾Ò,⌱à“Audio”8O“Directhput”⌱à⚗,n$rḄ(。9:᝞Wᡭ:0700(}ឋI)᪾î#RKDebug/RetailD3D9Runtime”“DebugOutputLeverᑖ᪾QἭᵨḄ,JQVwᙠ〜.€10〜8/5>^632p2´rKḄÎ᝱?ᦻ,JKKQᵫJô^8950X(August2009)ïᒹḄᓃÍ⌼ᡂḄ。^ô78᱄ïp2XrᐵÎ᝱?ᦻÎcᑴᑮ^1^0ᕖ/578〖632p2,ᓽe.KE⚪。1.5.4ᙠ^ḄStudio^[ÚÛ□⑶᱄ᓹ^^^᱄QoᝅjḄ:#1ô,SQo=:#ú᛻,ᡠ8ᵨ01(^50R:#Ñî,R◤⌕rKḄ:#ú᛻,23ᵨ%8¿15¹(170:#ú᛻。ᙠï8^(^(åx,ᐹ#n$:#åû,R◤⌕I%8150^70n$rKḄ。᝞Wᙠï8^9åû,⚜ᐜï%5¿150^0,ᑣ07"(^ïÑ23B)ÎVisual5È(^0:#ú᛻,(rᐵḄᦻÅÆôÇ。᝞Wᐜï8"(^(,xï%8¿1Studio,◤⌕Î:#ú᛻。ìᯠᨵîᓽᐜï%8D1Studio,0^(^ïÑ·eØÔᨵì%□&15È(170:#ú᛻,Jî᪵◤⌕n$Î。᪷£ᓹ^89ᦻ᫏,DirectXSDK(August2009)¦¿ᢝ975¿15᝞È02005%8D1Studio2008o9ѬᵨḄQ%8¿7Studio2008,ᡠ8☢CD᝞<ᙠ%8¿1Studio2008Ò8^89,ᙠ%8¿1Studio2005ÒḄvÑ5D。✌ᐜᙠ%8¿18ᡷ(1102008ᡂ:#ú᛻Ò,ᓫD【Ãᐹ1⌱⚗】ìᓫ⚗,JîBCÈ“⌱⚗”I)᪾,᝞1.3ᡠ9。ᙠ“⌱⚗”I)᪾·¼Ḅ᪛GfÒᨵo=“⚗p.>ᫀ”⁚A,ᓫDK⁚AÒḄ“VO+p2”⁚A,I)᪾Ḅ~¼Bµ9rᐵôÇ。ᙠ“⌱⚗”I)᪾Ḅ~ᨵo=“µ98ᑁ4Ḅp2”Êᑡ⊤᪾,ᙠûe8AᵨḄS5`Ḅᦻ。2vÊᑡ⊤᪾⌱}o*ᦻ5`x,rKḄÅÆôÇBµ9ᙠI)᪾ÒËḄÖ=ᜧrÒ。ᙠû◤⌕ᒹõᦻ?ᦻḄÅÆôÇ。᝞WᙠÊᑡ⊤᪾Ò⌱à“ᒹõᦻ”⌱⚗,ᑣÅÆôÇᑡ⊤ÒḄóo⚗KwuC:^>rogramFiles'vMicrosoftDirectXSDK(August2009)Unclude”。᝞WSQ,ᑣH`o=ÅÆôÇ,,(w☢ḄôÇ。᝞WᙠÊᑡ⊤᪾Ò⌱à“?ᦻ”⌱⚗,ᑣÅÆôÇᑡ⊤ÒḄóo⚗Kw“CAPmgramFiles^4icrosoftDirectXSDK(August2009)lUAx86”。᝞WSQ,ᑣH`o=ÅÆôÇ,,XôÇ(w☢ḄôÇ。 10oooÎ1$«ÌᦻÍ>^4Mttᵭ.&'⁚@|HTMLi3xtnXfEa^rt*i^SMZMraswi*ᖾᦻÏrᓄ11.3VisualStudio2008“⌱⚗”v᪾9:᪷£0^^^950Iïp2ḄS,FôÇeØBᨵᡠ。ᙠûÈḄôÇQ,ìï^8950Rî¬ᵨÒAïôÇî,ᒹõᦻ?ᦻḄÅÆôÇ。1.5.5Þß0□(^(30<á°9:ᙠDi^eCtXSDKÒ▬$ᜧḄ9Ñ,J9Ñ-3ᐺ, 9:RwJ9Ño=ÓÔÑ,8¯ÅÚ9ÑḄrᐵ1ê。IJ*zὅ,SÕᐜÓÔJ9Ñ,o>☢e8I8^89ᨵo=ÆឋA,=o>☢·e8#B0^^^(Ḅ£ᜧØ。ᙠ:+ìᓫÒᓫD【ᡠᨵÑlMicrosoft'DirectXSDK(August2009)IDirectXSampleBrowser】ìᓫ⚗,ᓽeÖÎ0^(^9ÑÓÔᘤ,᝞1.4ᡠ9。⌱þ+]Ḅ=,⌱þ]^M᣸M6⌱þᔲ=b.]^M×ᦻ᫏11.4£^᝞]^M0ᘤ 08「6(^(.{|íOOOᙠKÓÔᘤÒ,e8×⌱ZᜓÅÚḄ9Ñ、ᢣ}9ÑḄ᣸>b,8O$9ÑîQᔲ)ι9ÑḄÛᦻ᫏。᝞ᙠ1.4Ò⌱àÅÚ0^^13099Ñ,,᪷£9ÑḄãn$᣸,$9Ñî)ιᐸÛᦻ᫏。2vKÓÔᘤeÅÚZ=9ÑḄ$ᦔW、rᐵᦻ᫏Û¶。ᙠ9ÑÓÔᘤÒ,ᓫDZ=9Ñ⌕Û☢Ḅ“Executable”@1,e$K9Ñ,᝞1.5ᡠ9。MuRiArumation(^«^««0________________UjBtegywttump4otAratesmeshsnrra,tJonwthnOtK^anmatwnsrtsusing^1¾skrrtng^ndOX>X*sanf%^ttkwwtrc^rItVA#fltwncar.rcrxfcf30.wnatonbyut*2ngD3DX*sarimattcr.iMXMft.03DXKasAPlr.tha1tha!>^ndeGthek>adnQr.of^e^omatabiefne^h,aswdasthebieodngofmabpteonraoonG-7bc,wnaconcontrokfsuppoits*MnatKXitr?biendngofmat3p^orrtwtwnG-1bcarvnaconcontro^fsuppo«ts«racfc;for;for-k^vipjrpo5^..wytf^yti%trjr51bonr>gfromoneaomaDontoary>^efsmooWyfxroilabtrᓫDû@1,ᵭ.Dû@ê,ᡭ:KᓫDû@1,ï$K9Ñ9ÑḄÛᦻ᫏K9Ñ1.5$MultiAnimation9Ñ◤⌕üUḄQ,᝞WìûhS¿ᢝ⌱àḄ9Ñ,ᓫD“Executable”@1$9Ñî,¢^Sv^chirvaKott>eD»©c430itltfoncctft^ww.awftvwie6v^ztijthd(tnriefnery.*theenbfeDirec(3DfeaturetH.bJitjr%veiystov^y、âDo>KXJwithlocof^rue?BᐜCÈo=ØÙI)᪾,᝞1.6ᡠ9。i..᝞11~~ḛûî,᝞WᓫD【No】ᢥ,ᑣS$9ÑQfionlshowd^an,᝞WᓫD【Yes】ᢥ,ᑣ$K9Ñ,PQᵫJhS¿ᢝrᐵØ,ᡠ8X¬ᵨ:n1.6æÙI)᪾$U,JîF¤B3>᠒。9:᝞®xyp2A<^3010W&Direct3D11]^M,ᑣm%&nᓃ(105181&ᡈà᱐,4*Windows?5sᢝ^A3010*Direct3D11。ᓫD9Ñ⌕Û☢Ḅ“Documentation”@1,Bµ9K9ÑḄÛᦻ᫏。ᓫD“InstallProject”@1,ᑣCȓ^tnstall'MultiAnirndtion'I)᪾,᝞1.7ᡠ9。&>sta*ogrenamesthesampletothegivenname•andcop*sa*ofthcprojectHcsndujngthcm«iaandcommonftesᙠKI)᪾Òe8ÒᐭH⚗pḄÈ7ïintothcsdcctcddrectory.p2。ᓫD【Install】ᢥ,Xᙠᢣ}p2^Namc:l|^^;ManAfwac«n8ᢣ}Ḅ⚗pÈnᡂo=[᦮ḄÑ。KÑ•:,、_ᥟi:^Sk^.mLocattor:⌱àḄ9Ñ[ᐰr,^e8ᙠûiT^t.yà'H:、•••fẠn$Úᦋ,[ᡂ)Å◤⌕ḄØ。i^ki….l^^^j^ᨵJ᪵o=Ãᐹ,e8ü¤ÓÔ8<^(|H:V^JttArwa^ori9ÑḄrᐵ1ê。Sv,ÓᯠJ9ÑI'X..…Ø£ᜧ,PQÑHrìcᩖ,"ṹ1.7ï0^^^99Ñ·STÜᨎ,S〉ᔠ*zὅᐭ]z{。1.6Þ$&^^9Qoᝅ3ÚÛḄឋØiÝ#ÑÑ1ô,8wab、}CÑ:#ᐰ>ßḄ¿ᢝ。»⌕CD0189onḄúOᐸᭆù、889Ḅï、01^(^(ḄØ,,CD÷01^^9rᐵḄᔜ*☢ÑᢈG,CDab(Tr 12oooÎ1UᐵḄᑁ5ᓹ8Aᙠ{|[⚞~67Ḅ8⁐。9UḄ!,:v08A、{|[5T$〜8“(^8;Ḅ12ᢈ4ᨵ᦮gàḄ 。U=ᵨA50>ᑏM%&ᐹᜓḄ)Ạ+,。a!1.õÚö÷[ySDK。2.ᵨ0^(^]^Mᘤp20^<^WXḄ]^M。3. A(^、OpenGL、XNA5WPF#1Ḅᐵ。 Î2U⚜ᜓ+,z{ᵨ8(^9(#abÑåû,◤⌕ᐹᜓoᐸ¦>☢ḄẠ 。w¯Jz{,»IJẠ Òn$CD。᝞WJᑁ4,ᑣe8ᶍv»,z1nᐭo»Ḅz{。Ù#¡,ᙠz{ᵨ8^(^(n$ab:#åû,◤⌕ᐹᜓḄẠ ᒹ8|>☢:C+ᓝ ¡、WindowsAPI、0^ᵨẠ、ᦪzẠ。ᡃÐᎷ}/ὅᐹᜓḄ0+¡Ạ,»¦ÒCDᦪz、^^^0^8?100^ᵨ}>☢ḄẠ 。2.1ᦪ)Ạ8^^9Ñ⚞rNO¡iᦪz,⌕ᒹᔣ、▣8Oá☢rᐵḄ。▭J-÷ÿ᪆|ᔣḄ。ᙠᦪz23ᵨoᩩᨵ>ᔣḄ+f(ᓽᨵᔣ+f)⊤9ᔣ。ᨵᔣ+fḄ«⊤9ᔣḄᜧÞ,ᨵᔣ+fḄ>ᔣ⊤9ᔣḄ>ᔣ。ᙠ▭E⚪Ò,ᨵᔣï÷®Aᨵᐵ,ᨵᔣ÷®ANᐵ。ᵫJᡠᨵᔣḄᐳឋQᐹᨵᜧÞ>ᔣ,Vûᙠᦪz23¦Ẇñ÷®ANᐵḄᔣ,,7J*ᔣw)ᵫᔣ(8x7ᔣ)。IJ)ᵫᔣ,᝞W5=ᔣḄᜧÞr¶、>ᔣr,ÛJ5=ᔣQr¶Ḅ。VwᔣḄßS/0ᐸ}ឋ,ᡠ8e8Xᔣn$á。᝞WXᔣḄ®+AÎᑮᙶ᪗lA,ᑣ⊤9ᔣḄÐAᙶ᪗÷ᔣQooIKḄ。JQe8ᵨo᪗ᙶ᪗ò,᝞U,y,z),⊤9ᔣ,óFᔣḄᔜᙶ᪗7wᑖ。ᔣ23ᵨÞᑏḄô#Üõ⊤9,ᨵî·ᵨᜧᑏḄô#Üõ⊤9。1.ᔣḄU÷öᓄᔣḄᜧÞ£÷ᔣḄU,ᓽᨵᔣ+fḄ«。᪷£ᔣḄᔜᑖ,e82v"ᦪ>TᔣḄU。(ᔣ^⑷,〜…),ᑣᔣ8ḄUᓃ7eᵨbT:lwl=、|8“】+u2y+U2Z(2-1)U¶J1Ḅᔣ£÷ᓫßᔣø。U¶J0Ḅᔣ£÷Äᔣ。ÄᔣḄ®AÐA@ᔠ,ᐸ>ᔣe8ÚÄQ÷UḄ。 14oooÎ2UᔣḄöᓄQᔣḄULw1,ᓽᔣLwᓫßᔣ。ᙠ8^^30Ò3ᵨᓫßᔣ⊤9>ᔣ。e82vXᔣḄZ=ᑖ-◀8ᔣᨠḄU,8RᔣḄöᓄ,᝞ᡠ9。i=Jf_=K,^,M(2-2)u^lMlu\u)、}2.ᔣḄ+ឋᔣḄ+ឋᒹ¹、ïᦪý。ᑭᵨᔣḄᙶ᪗,e´ᑮᔣḄ¹、ï8OᦪýḄ,öᑣ᝞。(“=(^,^,“2),V=(vxtVrvz),û1]222/(345vjr看M+V=(ux+VxtUy+Vy,Uz+Vz)■yX—N.fiM—V=(ux-VxtUy-Vy,U-Vz)yJ/fku=(kuxikuyikuz)v隱ᔣr¹rïḄ|ᔣSL,᝞W÷_ᦪrý,ᑣᔣḄ>ᔣ÷lᩭḄ>ᔣrI。3.ᔣḄᦪÿᔣḄᦪÿ-7Aÿ。5ᔣḄAÿSQo=ᔣ,Qo=ᦪ,ᐸöû11᝞:u•v=uxvx+uyvy+uzv=u•lvl•COS0(2-6)ᐸÒ0w5ᔣḄᜳ。5ᔣḄᜳQᢣ5ᔣåÿSvᑍḄᜳ。᪷£b(2-6)e,᝞WMVᙳwᓫßᔣ,ᑣM•V¶JKVᜳḄ¤。᪷£b(2-6)e´:uv«xWy+wzvzCOS0(2-7)llvl>»】4»;᪷£b(2-7)e:“•v=0,ᑣMvìÊ,ᓽavrÎᚖz;《•v>0,ᑣ《、”åÿḄᜳw┦:“•v<0,ᑣ《、”åÿḄᜳw。4.ᔣḄᔣÿᔣḄᔣÿ-7ÿ。ÿḄ$WQo=ᔣ,(ᔣpwᔣttvḄÿ,ᑣ:P=uXV=[(UyV-U,Vy),(u2vx-uxvz)t(uxv-uyvx)](2-8)ᔣ᜛ḄUw:lpl=lwl•lvl•sin8(2-9) ⚜ᜓ+,OOO15ᔣpḄ>ᔣᚖzJK÷vᡠ}Ḅá☢(ᓽ᜛îᚖzJ^-ᚖzJv)。IJ~ᙶ᪗j,PḄ>ᔣᢥ~öᑣ^WÃᔣVᩭÌ}。Iñ·ᙶ᪗j,PḄ>ᔣᢥ·öᑣ^MÃᔣVᩭÌ},᝞2.3ᡠ9。·ᙶ᪗j12.3ᔣ×Ḅᔣ@5.03。9ᔣw>¯ᙠ8^^30ÑÒᵨᔣ,0309?ᑖᵨJ⊤9BC、}CZCᔣḄ$᪀5`:D3DXVector2、D3DXVector3,D3DXVector4。ᐸÒᵨᨬiḄQD3DXVect0r3。ᙠᔣ$᪀Ḅ}©Ò,ᵨ0+Ḅ¤@ᱯ┐Iᔣ+ឋn$@,^ f¹>¯ᔣḄ+ឋ。e8⊤2.13ᵨḄ030᱄ᔣᦪ¸ὃᦻ᫏ÒJᔣ$᪀Ḅ}©,ᦪÈ____________________Û____________fiḄd⁚。D3DXVec3LengthT}CᔣḄ«030᱄◀J}=ᔣ$᪀5`åD3DXVec3Normalizeöᓄ}Cᔣ᜜,R┐IZ*ᔣ$᪀5`rKḄD3DXVec3AddT5}CᔣḄD3DXVec3SubtractT5}CᔣḄªᦪ。8}Cᔣw,0309ḄD3DXVec3ScaleþÃ}Cᔣᨬ3ᵨᔣᦪ᝞⊤2.1ᡠ9。ᨵᐵJD3DXVec3DotT5}CᔣᦟḄᦪ᤬ÿᦪḄl`8Oᐸ¦ᔣᦪḄrᐵd⁚,èD3DXVec3CrossT5}Cᔣ᤬ḄᔣÿÅÚᦻ᫏。2.1.2▣o=^1><|1▣Qᢣᐹᨵ$〃ᑡḄᦪ,᜜%ᵨo=>®ᩭ,$ᦪᑡᦪᢣ}▣ḄCᦪ。23ᵨᜧᑏḄô#Üõ⊤9▣,ᵨ$ᑡᡂḄ᪗᪗▣Ḅᐗ²,ᐸÒóo=᪗Qᡠᙠ$Ḅ@A,óB=᪗QᡠᙠᑡḄ@A。☢ᑖQ|=▣Ḅ:3x3▣©、2><4▣_><2▣^。'^13C11CI2b'1bob1bA1Bc=C21C22b.22'23C31C32$ᦪᑡᦪrḄ▣7w>▣。I+ᐗ²ᐰw1,ᐸ¦ᐗ²ᐰw0Ḅ>▣7wᓫß▣,ᓫß▣23ᵨ/⊤9。Iñ▣,ᓫß▣rìJ᪗ÒḄ“1”。᝞W5=▣Cᦪr,,IKḄᐗ²·r,ᑣJ5=▣r¶。1.▣Ḅ+ឋIJCᦪrḄ5=▣e8n$¹ï。▣ḄQ5=▣IKᐗ²r¹ᡠ´ᑮḄ▣,▣ḄªQ5=▣IKᐗ²rï´ᑮḄ▣。᝞ᨵ5=&2▣41 16oooÎ2Uan11^p'i<^▣,ᑣ▣©▣Ḅýÿ^Qo=ᡠᜎþ▣,ᐸÒ6^]ó/$ó7ᑡᐗ²~¶J4Ḅó/=$ᔣℏ÷5Ḅó^=ᑡᔣḄAÿ,pô:C/y=a,•bj᝞,Ꮇ(:b'a\a7ai3Ab2a7a22.a23b,a\^ll+a2^2+a3^3al^l2+aZ^22+°13^32ᑣC^AB(2-13)a2l^\+a22^2+fl23^31a2^2+a22^22+fl23^329:▣rýo[SgÊᣚ᳛,ᓽ5ᐵ^43.▣Ḅ⌮▣IJ>▣©,᝞W?ᙠ>▣5gD=/,©]?=/,ᑣ▣4we⌮▣,▣7w▣©Ḅ⌮▣。o[▣4Ḅ⌮▣ᵨ^⊤9。᪷£☢Ḅ}©e:¦ᨵ>▣ᨵ⌮▣,o=><〃▣Ḅ⌮▣·Q^><〃▣,▣÷ᐸ⌮▣Ḅýÿwᓫß▣。,SQᡠᨵḄ▣-ᨵ⌮▣,ᑨeo=▣ÔQᔲᐹᨵ⌮▣Ḅ>Q,T▣Ḅ$ᑡb“1,᝞W141*0,ᑣ▣9e⌮,ᔲᑣSe⌮。▣Õ⌮Q▣ýḄ⌮。ᙠ30⚞r,23ᵨ▣n$ᙶ᪗Lᣚ,▣©Ḅ⌮▣©-1,ᵨJn$▣9[ᡂḄᙶ᪗LᣚḄ⌮Lᣚ。ᨵᐵ▣Õ⌮ḄÛcᩖ,ᙠûSÄCD。ᑭᵨD3DXḄD3DXMatriXInverse()ᦪe8>¯ᙢ´ᑮo=▣Ḅ⌮▣。4.▣ḄÃ▣ḄÃQX▣Ḅ$LwÃ▣ḄIKᑡ,µᯠ,o=><«▣ḄÃQ〃9⛭▣。23ᵨ7⊤9▣^ḄÃ。᝞,ᨵ᝞23▣4。 ⚜ᜓ+,ooo17lIIu2û1】:A1=al2a22(2-14)ana2ᙠT!zÒ,Ã▣o[ᵨᩭ᪀⌼ᙶ᪗jLᣚḄ}☢Ḅᔣ。5.▣÷Lᣚᙠ30Ñ(#Ò,23ᵨ4><4▣⊤9o=30Lᣚ,ᵨJI}CAḄᙶ᪗}CÿÒḄ>ᔣᔣn$Lᣚ。oÚ,ᵨ33▣⊤930Lᣚfᔠᳮ,PQ▭¡i5`Ḅ30LᣚNᵨ3<3▣óF,᝞á、nfᢗ/8OI](·7I7LᣚᡈLᣚ),4x4▣e8⊤9ᡠᨵḄ30Lᣚ。LᣚQ2vI⊤93ôÿḄA>ᔣᔣýrKḄLᣚ▣RḄ。wg▣Ḅýöᑣ,◤⌕XAḄᙶ᪗ᡈᔣḄᔜᑖÃᐭᑮo=40$ᔣÒ(40$ᔣe8ÚÄ1><4Ḅ▣)。Vw30ÿÒḄA>ᔣ-Q}CḄ,wû◤⌕½¹ó4=ᑖ(23ᵨ^⊤9)。ìXA᡽/w40$ᔣî,X>^ᑖ(w】,J᪵ØT&IAḄáLᣚìn$。ᔣ¦⊤9>ᔣ,ᡠ8ÔᨵIᔣ}©áLᣚ,IᔣáLᣚḄ¦Ø´ᑮo=NU©Ḅᔣ。w■ÑIᔣn$áLᣚ,ìX30ᔣℏᐭ40$ᔣî,X^ᑖ(w0。᝞,Aᡝ'^ᓄ^^ᐭ$ᔣxKw'^〜ᓄ7],ᔣ》^>^2,^3)ᐭ40$ᔣxKw©1,v2,v3,0]。᡽/xḄ40ᔣ7w#Sᔣ,ᓽᵨ40#Sᔣî⊤9Aᔣ。ì⊤9ᔣî,$>^ᑖw0,⊤9Aî,$^ᑖw1。ᨵî▣LᣚBᦋL#SᔣḄ^ᑖḄò,ᓽÄᑖSÙ¶J0ᡈ¶J1,JîᡃÐ7LᣚxḄᔣᜐJ#Sÿ(homogenousspace)Ò,8J30ÿ。X#SÿÒḄᔣ᧜]%30ÿḄ>Q,ᵨ^ᑖ&y◀K#SᔣḄZo=ᑖ。᝞,X#SÿḄᔣU,y,z,vv)᧜]ᑮ30ᔣ'Ḅ>᝞:(Xyzw、(XyZA(Xyz!11^^^^^―■_■1J2S■■■'■■'•I■S3I^~^M,—■■Vw*vv’vv’wJ、vv’vv’w’>/w*w*w)XA(y,z)ᑏw(ml)b,^ᢈGÚ,▭Qᙠ40ÿÒᵨo=40á☢(w=l)ᩭóF30ÿ。(üU,40ÿÒḄáᓴQ30Ḅ,30ÿÒḄá☢Q20á☢o᪵)。ᡠ8,ìX…(w)=òî,¯âãâá☢^=1。w@H᧜]%Ká☢(IKJᡃÐ៉Ḅ30ÿ),¦◤⌕X#SᔣḄZ=ᑖ◀8〜9:ᙠ3012Ê,AB5CᢗDEj◤⌕=ᔣᵫHáÆ1Iᑮ30Æ1。6.ô30᱄▣Vwᙠ30ÑÒᵨ4x4▣⊤9⊤2.2çᑖéᵨḄ030᱄ê▣ìᦪLᣚ,ᡠ8D3DXD3DXMATRIXÀᦪý×____________$᪀5`⊤94><4▣。w>¯▣Ḅ+D3DXMatrixIdentity᪀⌶ᓫL▣ឋ,ᙠ▣$᪀Ḅ}©Ò,ᵨ0+ᓝḄD3DXMatrixlsIdentityᑨN▣ᔲᓫL▣¤@ᱯ┐I▣Ḅ+ឋn$@D3DXMatrixMultiplyùO▣ḄP@D3DXMatrixInverseù▣Ḅ⌮▣。û᜜,0309R¡i÷▣rD3DXMatrixTransposeù▣Ḅ;÷▣ᐵḄ#ᦪ,ìᯠJ#ᦪ¦ØᵨJᜐᳮ4><4▣。⊤2.2ᑡÈ|=3ᵨḄ030᱄▣ᦪ,◀J3ᵨḄ▣ᦪå᜜,d 18oooÎ2UḼz{ḄUᐭ,ᙠx☢RBᑮ¡iᐸ¦3ᵨḄ0309▣ᦪ。9:ᨵᐵᙶ᪗Lᣚ030\4×X8$᪀Ḅᑁ4,ᙠó5»ÒRBn$*dCD。2.1.3á☢ᙠ07^830ÑÒ,·¡áSᔣ▣ᵨ´Öâ+,PQᙠ¡iêæo÷á☢rᐵḄ Q3ᨵḄ。1.á☢Ḅ}⊤9ᡃÐ-⍝}=A'、P.。e8}o=á☢,◀2v}=A}o=á☢᜜,·e8ᵨo=ᔣ,-á☢ḄoA᜜}o=á☢。ᐸÒá☢Ḅᔣe82vb}。n=^y-Po)xU^2-Po)(2-15)á☢QᡠᨵgbḄAâḄᔠ。n•0>-Po)=0(2-16)ᵫJᔣ᤬Äá☢ḄA^^Q}Ḅ,ᡠ8be8ᑏᡂ8f3ᵨḄb。n•p+c/=0(2-17)ᐸÒd=-n.p0◀☢Ḅ⊤9>bå᜜,R3ᵨá☢>Ñ⊤9á☢,á☢>ÑḄo[b᝞。ax+by+cz+d=O(2-18)á☢>Ñᵫ4=jᦪ〜b'c、“}。D3DXḄá☢$᪀D3DXPLANEQ2v4=jᦪᩭóFá☢Ḅ。ᱯᑩ◤⌕ᢣÈḄQ(Ahc)Qá☢Ḅᔣ,^·Qᔣ⊤9bᓽb(2-17)ÒḄ12.á☢Ḅöᓄ᝞Wá☢Dᓝ^^+ᡷ0Ḅᔣ《=(^&,0)wᓫßᔣ,ÖKá☢7wöᓄá☢。ûî,ÿÒ÷U--Aþ÷á☢ᑁ÷UoAþ。᪀ᡂḄᔣ÷ᔣ《ḄAÿ《•0?-᜜)¶JA^ᑮá☢Ḅᨵᔣ.ã。Xá☢öᓄS◤⌕öᓄᐸᔣ,ᓽÚᦋjᦪ1byc,R◤⌕îÚᦋjᦪ4ᐹ#>QXá☢>ÑḄZ=jᦪî◀8ᔣ《ḄU。3.z+á☢ḄÊA᝞2.4ᡠ9,(vA^^Ḅz+á☢ḄÊAw^•ᵫñA^ßJz+,Vû?ᙠ)=ᦪ/,bᡂ:p=tp2+(~t)p^(á☢Qᵫᔣ《á☢ḄoA}Ḅ,Vwþᙠá☢,ᡠ8bᡂ。n.Q)-Po)=0^ᨵn•(02+(l—^i-Po)=O ⚜ᜓ+,OOO19JQeᵨ/bT~t=(n•po-n•py)/(n•p2-n•px)(2-19)TÈ£åx,ÊA^e82v¸ᦪ£ḄòTÈᩭ。4.Aá☢ḄÿᐵjIJo=}ᔣᡭᑁ%oA^Ḅá☢,÷UoA^÷Ká☢Ḅßᐵjeᵨ5ᔣḄAÿ《•'-᜜)n$ᑨe,ᑖw8}*ê。•ᡭ.0?-ᓹ0)>0,ᑣA^ᙠᔣḄo0:•”.0?-ᓹ0)=0,ᑣAþᙠá☢;•《*0-')<0,ᑣAþᙠᔣḄI0。IJ8>Ñ^^++^+^=0⊤9Ḅá☢,e8z1ᑭᵨ0^+^+^Ḅ¤}A^(1,y,2)á☢Ḅßᐵj。•D+6>,+6^+£?>0,ᑣA^ᙠᔣḄo0;•gar+^+cz+d=O,ᑣA^ᙠá☢;•gor+^y+cz+^<0,ᑣA^ᙠᔣḄI0。5.D3DX^mᵫJá☢ᙠ0^“9ÑÒḄ@⌕Äᵨ,ᡠ8D3DXD3DXPLANE$᪀⊤9á☢。D3DXPLANE$᪀ᵨá☢>ÑḄZ=jᦪ⊤9á☢,w>¯,R2v0++Ḅ¤@ᱯo┐Iá☢Ḅ。û᜜,0309Ro÷á☢rᐵḄ#ᦪ,⊤2.3ᑡÈ|=3ᵨḄá☢ᦪ。D3DXPLANE$᪀Ḅ}©8Orᐵ#ᦪḄ*d1ÙØ,èxÚᦻ᫏。⊤2.3éᵨḄ030d¾☢ìᦪᦪm_________________________D3DXPlaneDot☢40ᔣḄ"#D3DXPlaneDotCoord☢30ᔣ%:Ḅ"#,(Ꮇ*ᔣ+Ḅ…ᑖ+.】D3DXPlaneDotNormal☢30ᔣ0Ḅ"#,(Ꮇ*ᔣ2Ḅ〜ᑖ4.0D3DXPlaneNormalizc5ᓄ☢D3DXPlancFromPointNormal᪷E"Fᔣ+᪀H☢D3DXPlaneFromPoints᪷EI"᪀H☢D3DXPlanelntersectLineJK☢ḄL":030?13001()Àᦪ9jᵨwᑨN☢^¹%jkḄ?1。ᵨ00++ ¡z1&ᵨ2'^3?1ᦪQᨬl+、ᨬᮣR、·QØᨬ£ᜧḄÑ>b。J*>bḄAQÑÃÄᓫ&3ᕡ、ᦔ᳛i,ᯠ 8"8᱄ѬᵨḄQJ*>b。ᵨ8^89ᑏabÑ,◀0789HḄ:#1ô᜜,ᯠR⌕ᵨoḄ%432?1ᦪ。 20oooÎ2U2.2.1:#〜L32c?7ÑḄpᵨ952008:#%432?1Ñ,ᒹZ=p:•H`⚗p•8¹"ṹ•8¹tV•@1☢$ᔠ9Ñ“SimpleWinApp”,CD:#ᑩ“2?1ÑḄZ=p。9:▭·e8ᵨ%5¿1€++6.0%5¿15ÈÈ02003ᑏ^32?1Ñ,PQ₞ᵨ%8¿1Studio2005、VisualStudio20088OVisualStudio2010。VwᨵoHḄWindowsᓹ1ᦪᙠ^¿1C++6.0ÒS¿ᢝ。1.H`^o32⚗pᡭ:952008,ᓫD【ᦻ1H`1⚗p】ìᓫ⚗,CÈ“H`⚗p”I)᪾,᝞2.5ᡠ9。ᙠ“H`⚗p”I)᪾·%Ḅ⚗p5`᪛Ò,⌱à%8¿1€++☢Ḅ”432⁚A,ᙠ~%ḄUrᑡ⊤Ò⌱à“〜432⚗p”,ᙠ%ḄÈ7Ï᪾Ò,Òᐭ5^1^^^^??,,⌱àᔠ〉Ḅ&?ß,ᯠxᓫD“}”ᢥ。miS0r^rHc?V9ft_i___>W^nW5..⌱àK⌱àK⚗p⁚AᙠûÒ⚗pÈ7[.^e,.SU#vViftA^p“2.5H`¥432⚗p9:ᙠ☢ḄvÄÒBÒA_`È7w“SimpleWinApp”Ḅ.>ᫀ,᝞2.5%ᡠ9。^ᭆùñ,.>ᫀQ⚗pḄÏ4ᘤ,ᵨJ¶ᳮrᐵḄ⚗p。o=.>ᫀe8ᒹõi=⚗p,SvÒḄ9Ñ-¦ᒹõo=⚗p。4D2.5ÒḄ“}”ᢥåx,BÈR“”432KᵨÑᔣ”。j:+ᔣᜐᓟ“ᭆF”⚓,JîᓫDᔣïô·0Ḅ“KᵨÑ(”@1,ᡈᓫD“op”ᢥ,ᑣnᐭ“KᵨÑ(”⚓,᝞2.6ᡠ9。ᙠKᵨÑ(⚓Ò,KᵨÑ5`ÒAw“>^8^^5KᵨÑ”。ᙠ“▬¹⌱⚗”Ò⌱à“⚗p”c⌱᪾,ᓫD“[ᡂ”ᢥ。tû,[ᡂo=⚗pḄ_`。 ⚜ᜓ+,OOO219:᝞WS⌱à“7⚗p”c⌱᪾,B)Înᡂo=ᓫḄ〜432Ñ᪾¾,ᒹḄV"ṹᔜ*tV。PQ`Úᐜnᡂo=⚗p,)Å8¹"ṹ,J᪵e8¹Uᳮ。ÒḄ9Ñ-Qᐜ_`⚗p。_`⚗påx,e8.>ᫀ¶ᳮᘤïô,e8ÚÈ.>ᫀ、⚗pÑᦻåÿḄᐵj,᝞2.7ᡠ9。£ᵨ《»«ewtfl1»33iU*ᫀtV¶ᳮᘤÒ~D“SimpleWinApp”⚗p,ᙠCÈìᓫÒ⌱à【8¹7H`⚗】ìᓫ⚗,ᡈὅᓫD【⚗p:¹1H⚗】ìᓫ⚗。JîBCÈ“8¹H⚗”I)᪾,᝞2.8ᡠ9。^sa#^S!^»-—_■■ImJ3window*ca^HTMl5CMm«LTᦻ《4]jH»s*«Jl«»iia»7-*i-e5x:3ᵨ&*»ᕲ^gwpl^nApp.cpp^CJi(l):h:v#t*t*0W8W5'>0irectXj?itW88*fxT>^ftyS^mpi#Wi^AppSimpl#Wi#>AppW»B‘12.8n⚗µòb⚗ᙠ8¹H⚗I)᪾Ò⌱à8¹“O+ᦻ(.cpp)”,,Òᐭᔠ〉ḄᦻÈ7,᝞“Main”,ᓫD“8¹”ᢥ。Jî⚗pÒᨵo=Ḅ0+"ṹᦻ,ᙠKᦻÒᑏ0++"ṹᓽe。2vrḄ>,Re88¹ᜮᦻᐸ¦0+"ṹᦻ。9Ñ570^16>¥4??Ḅ[᦮V"ṹqoÞ⁚。 22oooÎ2U3.8¹tVtVᓽᦪ£,᪗、ᐝ᪗、ìᓫI)᪾-QtV,8ÐÌ;?ᙠÑḄ᱄6ᦻÒ。wᵨ)Å}ᑴḄ᪗Ñ᪗ᐝ᪗,◤⌕ᐜw^&2⚗p8¹rKḄtVᦻ。8¹tVᑏ"ṹ,Ôᨵ|zḄᐜx<,23Qᙠ◤⌕ᵨtVî8¹tVᦻ,ᯠxᙠÑÒ2vrKḄ?〖ᦪᵨJtV。ᙠḄᜧ%ᑖ9ÑÒ,ᵨḄQÒAḄ᪗ᐝ᪗,·ÔᨵᵨìᓫI)᪾,ᡠ8ᙠûSCDtVḄᵨ。4.@1ᑏV"ṹåx,ᓫD【nᡂ1nᡂ.>ᫀ】ìᓫ,ᡈᢥÏÐḄ^7Ï,@1⚗p。᝞W"ṹH⚗p(ÔᨵE⚪Ḅ),BnᡂrKḄe᡻$ᦻ,᝞WV"ṹᡈ⚗p(?ᙠE⚪,ᑣBᙠÒÈïôÈ@1┯8O>Ù。nᡂ.>ᫀ⊤☢¦ᨵo=vÄ,PQ▭ᔊ5=vÑ:@1。S¶QV"ṹ?ᙠ E⚪(JîSØ2v),RQ@1ᨵE⚪,᝞ÆSᑮᔠ〉Ḅ@1?ᦻ,☢ḄvÄ-SBᡂ。wØTìᙢ@1ᑮ^“0>^?1ḄR"ṹ(JR"ṹßJrKḄ.È1ᦻÒ),◤⌕rKḄ.¿?ᦻ。IJo3ᵨḄ.1ᓄ?ᦻ,ᙠH`⚗pîÒA8¹ᑮ⚗pÒ,J·Qᙠ“SimpleWinApp”⚗pÒ,ÓᯠᡃÐᵨᑮ?1ᦪ,PQÔᨵ(.1Èᦻᓾ-ᯠØT@1ᡂḄlV。⌕ÅÚw⚗p8¹Ḅ.1È?ᦻ,ᡈ8¹ᐸ¦.1Èᦻ,ᙠ.>ᫀtV¶ᳮᘤÒ~D⚗p,ᙠCÈḄìᓫÒ⌱à【}ឋ】,BCÈ⚗pḄ}ឋI)᪾,᝞2.9ᡠ9。ᙠ·¼Ḅp2᪛Ò⌱à“06}ឋ”☢Ḅ“@1ᘤ”ÒḄ“Òᐭ”⁚A,ᯠxᓫD~☢Ḅ“▬¹@A⚗”,JîBᙠ~¼ÈR-=ᢥ,ᓫDKᢥBCÈ▬¹@A⚗I)᪾,᝞2.10ᡠ9。ᙠKI)᪾Òe8Òᐭ◤⌕Ḅ.1ᓄᦻ,·e8ÅÚ⚗pÒA(Ḅ.1Èᦻ。ᩡᡷ@》♍«DḄòktTrvel32.Wbuscr32.fibgdi32Jibwirspoo!.libcomdlg32JibV^᱄ᡂFp»^5««D(kS'•2.9⚗p}ឋI)᪾2.〗08¹÷xÚ.¿?ᦻwᵨ8G0(ᔜ=ØḄᦪ,◤⌕8¹rKḄ.1ᓄ?ᦻ,ᙠx☢ᐹ#ᑏ8^9Ñî,B98¹.1ᓄᦻ。û᜜⚗p}ឋNO¡iᑁ4,☢ᑮḄ.7ᓄᦻ(¦QᐸÒḄo=(。`Ú/ὅHdᑖ᪆,៉ᐸ¦⚗p}ឋ,JIJ½¹I⚗pḄᳮAQᨵḄ。 ⚜ᜓ+,ooo232.2.2…7…åᓹ7Ñ᪆Þ⁚2v*dᑖ᪆ᕂᓄᕸ…^^^ᓹÑḄV"ṹ,Jᳮ¥432?1Ñ$ḄvÑ!ᳮ。☢✌ᐜÈ570^^〜70??ÑḄ[᦮V"ṹ。#include#include//ïôvѯLRESULTstdcallWndProc(HWND,UINT,WPARAM,LPARAM);//ᐭôᦪintstdcalltWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstancePTSTRszCmdLine,intiCmdShow}//}©ïô5WNDCLASSEXwndClassEx;wndClassEx.cbSizesizeof(WNDCLASSEX);wndClassEx.styleCS_HREDRAW|CS_VREDRAW,wndClassEx.lpfnWndProcWndProc;//ïôvÑwndClassEx.cbClsExtrawndClassEx,cbWndExtra=wndClassEx.hInstance:hInstance;wndClassEx.hIcon:LoadIcon(NULL,IDI_APPLXCATION);wndClassExhCursor:LoadCursor(NULL,IDC_ARROW);wndClassExhbrBackground=(HBRUSH)Getstock0bject(WHITE_BRUSH)wndClassExlpszMenuName:NULL;wndClassExlpszClassName:L"SimWinClass";wndClassExhIconSm=NULL//TU^|=if(lRegisterClassEx(&wndClassEx)){MessageBox(NULL,"üLïô5ᜫᦝ1",L"SimpleWinApp"return0;>//_`ïôHWNDhwnd=NULL;hwnd=CreateWindowEx(NULL,//ïô᡽/ÀzL"SimWinClass"•//ïô5È7L"SimpleWinApp",//ïô᪗⚪WS_OVERLAPPEDWINDOW,//ïôÀzCW_USEDEFAULT,//ïô*+᱄ßNCW_USEDEFAULT,//ïô*+?ßCW_USEDEFAULT,//ïô*+OCW_USEDEFAULT•//ïô*+NULL,//᱄ïô¥PNULL,//ïôìᓫ¥PhInstance,//Ñ¥PNULL)://_`¸ᦪif(hwnd==NULL){MessageBox(NULL,1"_⌳ïôᜫ}!",L"SimpleWinApp",0);return0;} 24oooÎ2U//».9ï]ShowWindow(hwnd,iCmdShow);UpdateWindow(hwnd);//WXYMSGnsg;while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);>returnmsg.wParam;>//ïôvÑLRESULTCALLBACKWndProc(HWNDhwnd,UINTmessage,WPARAMwParam,LPARAMlParam){switch(message){caseWM_CREATE:break;•caseWM_KEYDOWN:if(wParam==VK_ESCAPE)//ᢥ£80Ï⌨ÈÑPostQuitMessage(0);break;caseWM_DESTROY:PostQuitMessage(0);break;>returnDefWindowProc(hwnd,message,wParam,lParam);>ᙠ▅/Þ⁚Ḅxyᑁ4î,`Ú$ᔠ☢V"ṹÒḄü³。1.ᜮᦻᙠ☢ḄV"ṹÒ,✌ᐜᒹõ5=ᜮᦻ:\^(10〜8.11101^『。ᡠᨵ\^€10〜5Ñ-◤⌕ᒹõ^1^(^5ᜮᦻ,Kᜮᦻ}©〜4(^^^Ḅᡠᨵᦪ£5`、>^^(^5ᓹ1ᦪ、ᦪ£$᪀3ᦪ᪗¤。2vᒹõ”78^^8ᜮᦻ,ᙠÑÒe8ᵨ~7'(^8Ḅᦪ£5`1ᦪ。ìᯠ,wᡂ@1ᑮrKḄ?1ᦪḄR,R◤⌕ìᢣ}.?ᦻ。14&^ᜮᦻQ€ᜮᦻ,ᐸÒ}©÷UNICODEܤṹrᐵḄܤT5`8OܤTᦪ,᝞☢"ṹÒḄᐭôᦪ_1”71^᝞()Qᙠ1ᓄ&1^ᜮᦻÒ}©Ḅ。9:ܤṹQÑ(TÒḄo=@⌕E⚪,ᙠᡠᨵ9ѬᵨḄQUNICODEṹ。᝞W/ὅSܤṹḄᑁ4,`Ú▅/rᐵḄtᧇ,8VÜW〜432?1Ñ(TÒḄܤṹ、ܤT5`¶ᑁ4。2.ÑᐭôWinMain()ᙠ^1^0〜8ÑÒ,WinMainḄᙢß÷ý2CÑÒḄmainᦪ[ᐰr,8Q2'0〜8ÑḄᐭôA,ᐸl`᝞: ⚜ᜓ+,OOO:25intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPWSTRlpCmdLine,intnShowCmdᐸÒ:’•ᓃ11^L&^06K¸ᦪQìûKᵨÑḄ¥P,o᪗ìû$ḄKᵨÑ。•ᓃᓹ^91ḄL3¹6K¸ᦪQwº»Ḅ16ß>¥7^(^5Ñrr4&ᶇḄ,ᙠ32ß>^0᝞A5ÑÒSᵨK¸ᦪ,ᐸòÙQNULL。•^&^·^ÇX$$¸ᦪܤT。•nSh0wCmdᢣ}KᵨÑÖÎîïôḄµ9b,Qì3µ9、ᨬᜧᓄRQᨬÞᓄ。ìᵨᡝÖÎo=ᑩ“0^Ñî,>^^0^8jk&ᵨ>^!^]^0ᦪ,,wᐸ⌴4=¸ᦪ。ᯠx:+᡻$^^^ᔯᦪÒḄ"ṹ。W]:ᙠÊᵨḄWinMain()ÀᦪḄUNICODE᱐,S_tWinMain()。3.}©üLïô5ïôÙQᙠïô5ḄẠ_`Ḅ。ïô5e8ÚÄQ_`ïôḄUr,}©ᵨKïô5_`ḄᡠᨵïôḄoᐳᱯ8OïôvÑ。e8᪷£o=ïô5_`o=ᡈi=ïô。ï^5ᵫWNDCLASSEX$᪀⊤9。ᙠ_`ïôåû,◤⌕ᐜ}©o=K$᪀5`ḄL,,(ᐸᡂᕒ,ᯠx&ᵨX6#5^[138È9()ᦪüLo=ïô5。åxe8᪷£üLḄïô5_`ïô。WNDCLASSEX$᪀Ḅ}©OᔜᡂᕒḄᐹ#õ©᝞。typedefstruct{UINTcbSize;//K$᪀ḄᜧÞUINTstyle;//ᢣ}ïô5ḄÀzWNDPROClpfnWndProc;//ᢣ}ᜐᳮ_êḄïôvÑintcbClsExtra;//23SᵨintcbWndExtra;//23SᵨHINSTANCEhInstance;//KᵨÑ¥PHICONhIcon;//wïôᢣ}᪗HCURSORhCursor;//wïôᢣ}Ñ᪗ᐝ᪗HBRUSHhbrBackground;//wïôᢣ}úᨬLPCTSTRlpszMenuName;//wïôᢣ}ìᓫLPCTSTRlpszClassName;//wìᙠ_`Ḅïô5(o=È7HICONhIconSm;//wïôᢣ}Þ᪗}WNDCLASSEX,*PWNDCLASSEX;4._`µ9ïôïô5}©ïôḄo[ᱯ,e8᪷£oïô5_`¡iSḄïô。_`ïôᵫ〔"3〖6¥71^0〜£()ᦪ_`,ᙠ&ᵨ0^6&16ᑈ440〜£()_`ïôî,Re82v0^v6¥^^0〜£()ᦪḄ¸ᦪᢣ}÷ᱯ}ïôrᐵḄf¹*dḄ1ê,KᦪḄ¸ᦪÛi,ᙠ☢ḄV"ṹÒIᔜ¸ᦪḄõ©n$ü³,ᙠûSÙ³。ᙠ0^16^^0A£()ᦪ&ᵨᡂ]%x,o^(^5jkwᡃÐ_`1ïô,PQïôRÔᨵᙠµ9ᘤ᧎9Èᩭ。wµ9ïô,◤⌕&ᵨ5=ᦪ:o=Q5^〜>^1^(^(),KᦪḄóo=¸ᦪQZᜓµ9ḄïôḄ¥P,óB=¸ᦪᢣ}᝞<µ9ïô;=o=ᦪ 26oooÎ2U^UpdateWindow(),KᦪfHïôḄµ9。5._ê+úᡠᨵ^ᓄ᝞^^Ñ-Qᵫ_êÉÎḄ,>^1(^8ᨵî·Ì7w“J`Ḅ、_êÉÎḄ”vÄjk。ᙠ^81(^8ÑḄ᡻$vÑÒ,¦⌕ᵨᡝn$/0ïôḄvÄ—᝞ᦋLïôḄᜧÞᡈὅÎ、ᓫDÑ᪗¶,JvÄBT#rKḄ“_”。vÄjkZSbsᑮo=_î,BÑ#〈o=“_ê”,KᵨÑ2vᜐᳮ_êIᵨᡝḄvÄ÷ÈIK,JQ〜ᓄ(10d8ÑḄ$!ᳮ。ᙠᑩ0᝞〜8ÑÒ,ì&ᵨUpdateWind0w()ᦪåx,ïôÈRᙠef。ÑRᙠZᜓ/ᐭᵨᡝ2vÏÐ、Ñ᪗8Oᐸ(ᜓÒᐭḄᦪ£。^ᓄ1(^8jkwìû᡻$ḄZ=”1^(^8ÑCgo=“_êhᑡ”。ᙠ#nÒᐭ_åx,^1^0~8X_Ãᣚw“_ê”,,X_êÃᐭÑḄ_êhᑡÒ。Ñ2v᡻$oᙽ7åw“_ê+ú”Ḅ"ṹ^_êhᑡÒÌÈ_ê,,X_êᑖ#ᑮrKḄïôvÑn$ᜐᳮ。3ᓄᡷ6^1^^^9ÑᵨḄ“_ê+ú”᝞ᡠ9。while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}■_ê+ú^&ᵨGetMeSsage()ᦪ:+,Kᦪ^_êhᑡÒÌÈo=_ê。☢Ḅ0&^D&60ᦪ&ᵨ2vóo=¸ᦪw>^81(^&jk⌴o=^0$᪀L0^Ḅᙢᙬ。óB、ó}óZ=¸ᦪ(wNULLᡈ0,⊤9ÑX1ᦈ8ᡠ_`ḄᡠᨵïôḄᡠᨵ_ê。…^^^#kᵨ^_êhᑡÒÌÈḄo=_êiᐙ_ê$᪀Ḅᔜ=Üf。¦⌕^_êhᑡÒÌÈḄ_êḄmeSsageÜfSQWM_QUIT,0v^^8&66()ᦪ]%o=Äò。〜^0。j_êX0&^86ᔯᦪ]%0,^⌨È_ê+ú,n$kÑḄ$。᝞W061^8&86()ᦪ;Ìᑮᮞ^1×_ê,ᑣ᡻$^L+úÒḄ"ṹ。ᐸÒ"ṹTranslateMessage(&msg),IÏÐ_ên$Ãᣚ。RSDispatchMessage(&msg);▽^^5jkX_ê#〈〉ìḄïôvÑ,^e8I_ên$ᜐᳮ。·QÛ,Windowsjk&ᵨïôvÑI_ên$ᜐᳮ。ᙠ8᝞m”71^>?Ò,J=ïôvÑQ〜81?G0ᦪ。ᜐᳮ[_êåx,o“?1(^()ᦪ]%ᑮ〜4(10〜8jk。ûî,〜ᓃ(10〜8jkRnᶇᙠ018ô3ᜐ16883£6()&ᵨᜐ。ᙠ$k07303^^1^883§6()&ᵨḄᜐᳮåx,Wind0WSjk]%ᑮ5—0©ᓄ?0Ñ,1Ḽ^o=GetMesSage()&ᵨ:+_ê+ú。◀☢ᵨḄ_ê+úå᜜,Rᨵ=᜜o*Û3qḄ_ê+ú,"ṹ᝞。MSGmsg;while(TRUE){if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){if(msg.message-=WM_QUIT)break;TranslateMessage(&msg);DispatchMessage(&msg);>else ⚜ᜓ+,OOO27//n$ᐸ¦ᜐᳮ>>☢Ḅ_ê+ú570^^^^?0ᵨḄ_ê+ú5ὅåÿḄ⌕Q,☢Ḅ_ê+úᵨPeekMessage()ᦪSQGetMessage()ᦪ^_êhᑡ;Ì_ê。J5=ᦪḄQ,GeMessage()ᦪSBXᑴ]%Ñ,zᑮ8^ÑḄ_êhᑡÒ;Ì_ê,PeekMeSSage()ᦪÙQo]%,S¶Qᔲ;Ìᑮ_ê。ì_êhᑡÒᨵ_êî,PeekMeSSage()®ᦪḄ]%òwTRUE(0),ìhᑡÒÔᨵ_êî]%FALSE(0)。ᵫJT!Ḅ$¤3ü,ᡠ8ᙠÑḄ$vÑÒ,3BÈR_êhᑡwḄêæ,2vᵨPeekMesSage()ᦪe8ᐙᑖᑭᵨJîÿn$ᐸ¦ᜐᳮ。Hdᑖ᪆☢Ḅ_ê+ú"ṹe8#R,᝞W_êhᑡÒᨵ_ê,?6ᓄ^^386()]%X1£,Jîᢥ᯿23Ḅ>bᜐᳮ_ê,᝞W_êhᑡÒÔᨵ_ê,?6'^8&£6()Bᓽ]%?[5£,ᙠXᑴ]%>^1^0~5jkåû,Re8n$ᐸ¦oᜐᳮ。᝞ᙠabÑÒ,23¬ᵨJ*_ê+ú,ì_êhᑡwî,KᵨÑBSeᙢᙠïô¿ᑴ,SefH,^ ´ᑮëyḄÎᦔW。9:_ê+úḄ᡻$vÑÛcᩖ,ᱯQ_êQ᝞<Ì#〈ᑮïôvÑḄ。_ê+ú·Q\^^(^^Ñ$!ᳮḄᐵÏᡠᙠ,`Ú/ὅHdᑖ᪆JovÑ。6.ïôvÑ÷_êᜐᳮ8øàḄᡠᨵᑁ4-QZᜓឋḄÃÄ,_ê+ú"ṹSeᙢ^_êhᑡÒÌÈ_ê#〈ᑮïôvÑ。▭Ḅᜐᳮ#nᙠïôvÑÒ,ïôvÑQᜐᳮ_êḄᙢ>。ᙠ5^1^^¥4??9ÑÒ,ïôvÑQÌXÈw〜“?□0Ḅᦪ。o=>^'0%8Ñe8ᒹõi=ïôvÑ。o=ïôvÑÙQ÷&ᵨ&6#316ᑍ1388£üLḄᱯ}ïô5rᐵὶ。Ñ23Sz1&ᵨïôvÑ,ïôvÑ23ᵫ>^!^(^8jk&ᵨ。ᡠç&ᵨïôvÑ,▭Qᔣïô#〈_ê,ᔣïô#〈_ê,ᨬxB᡻$ïôvÑ,ᓽ&ᵨïôvÑ。ïôvÑᡠ1ᦈᑮḄZ=_êQᵨo=ᦪò᪗Ḅ,·QïôvÑḄ《^8§6¸ᦪ。”1&(^8ᜮᦻwZ=_ê}©8“WM”(ïô_ê)wûqḄ᪗¤ᵨJ᪗_ê。23ᵨ5〜71(^r$᪀}ïôvÑ1ᦈḄQ_ê,8O᝞<ᜐᳮ_ê。ïôvÑᜐᳮ[Zᩩ_êx,᡻$break ¥,⌨È3〜Lᶂ1e,1ᩭwjkÒAᜐᳮ_ê。ïôvÑStᜐᳮḄᡠᨵ_êKK〜1^^(10¥?[000ᦪ。^06^^᝞^?【0(^)]%ḄòᵫïôvÑ]%。ᙠ57?4>¥ᓄ009ÑÒ,〜1^ᓹ[0(:¦ᜐᳮ}=_ê:WM_CREATE、WM.KEYDOWN*WM_DESTROY,᝞û☢Ḅ"ṹᡠ9。ᙠïôvÑÒᨬx&ᵨ06!>^(10^『0ᔯᦪwïôvÑStᜐᳮḄᡠᨵ_êᑁᜐᳮ,JQ@⌕Ḅ。ᔲᑣ,IJovÄ,᝞⌨ÈÑ,XSBì3᡻$。9:S⌕uµᜐᳮ>^_0£5×X0v_ê,,&ᵨPostQuitMessageOᦪ,ᔲᑿᐵyïôî,ÓᯠïôBÌᐵy,PQ_ê+úᓾSB$k。Jîᡭ:>^1^(^8÷z¶ᳮᘤ,-ᯠe8ÚᑮnÑᙠ$。 28oooÎ2U2.3〇0ᵨ)ẠDirectX?1ᦪQ80041ôḄ>bÑᕒᵨḄ,ᡠ8ᵨ0^^^({$:#,◤⌕I03"ᨵo=。◤⌕üUḄQ,ᙠû¦◤⌕᝞<ᵨ00”I^,SQz{᝞<:#009I^。:#00pI^QocᩖḄ_ê,᝞<ᵨ00^1I^,rIᓫ´i,⁚Ḅᑁ4T。2.3.100?^I^ᭆF0(^^I^ᙠÌKᵨÑ&ᵨî,=|}。0(^^I^i=>KᵨÑ&ᵨᩭ[ᡂ8ᡠ¿ᢝḄvÄ。1.〇01^I^〇++I^᝞Wz{v€++ ¡Ḅ),KKI0++I^,S~n。☢2vᑖ᪆0€^1I^0+I^åÿḄ,¹UIᓚ0?^I^Ḅᳮ。•00^1I^o[Ḅ0+I^Ê´fw|z。<^^^I^Ḅ;ᨵ>ÌÒᑮo=ᡈi=1ôÒ。wᵨ)=>,ᐜ_`00^4I^,,^KI^;ÌាìḄ1ô。o=1ôo[ᒹorᐵḄ>,ᵨJEI^Ḅᱯ}ᱯ。᝞,e8ᵨ-ᓄ8O〜1ôḄ>,vÄ[ᳮtV。•0(^^I^Ḅ_`>÷0++I^S。e8ᵨ|*SḄ>_`00pI^,Pᡠᨵ>-NOᱯ}Ḅ<^^^ᢈG。DirectX?1i#ᦪ,ᓄᜧ%ᑖ÷889rᐵḄ0^1I^Ḅ_`。•ᵨᱯ}Ḅ00^1ᢈGᑴ€01I^ḄnX»。•00^I^N◤¹。00ᾢI^23ßJo=01^Î᝱?Ò,Pwᵨ00“I^,N◤¹IKḄÎ᝱?ᡈ@1ᑮ☟᝱?。Z=00pI^-ᨵo=oḄ᪗¤ᵨJ_`I^。001^1B)ιìḄ00^Î᝱?。•0(^^I^QJBnᑴ᪗ZḄ。e8ᵨᔜ*Ñ ¡E0€»^I^,S◤⌕⍝KI^ḄV"ṹQᵨ ¡ᑏḄ。᝞,e8ᙠ%8¿18HᓃKᵨÑÒᵨᵫ0++ᑏḄ0^I^。2.〇0"I^1ôᳮ0^^4I^1ôåÿḄ@⌕。ᨵîBᵨ⌕1ôḄÈ7Äw031I^ḄÈ7。ᯠ ,^|zU©ñ,5ὅQSḄ。o=(^^4I^eØᐹᨵi1ô。᝞,ᡠᨵCOMI^- IUnkn0wn1ô,23RBt´o=(23Qi=)◀^1ᦑ8^1^^᜜Ḅ1ô。wᵨ)=ᱯ}Ḅ>,S◤⌕_`0(^^I^,R◤⌕´ᑮᔠ〉Ḅ1ô。o=1ôQo>,ᵨJᜐᳮo5ᱯ}ḄvÄ。1ô}©¦ᢣ}J>Ḅ 8ÐḄØ。ᡠᨵḄ00pI^-2vᔠ〉Ḅ1ôᩭ8пᢝḄᱯ}vÄ。ᨵ1ô¦2vo=ᐹ#ḄI^,ᨵ1ôᑣᙠiêæ-Bᵨ,,ᵫ¡iI^。᩽ḄQ^Jnkn0wn1ô,ᡠᨵ0^1I^K1ô。Û:᝞Wᓚ0pI^o=1ô,ÖK0^I^R8ᡠḄ1ôÒ}©Ḅᡠᨵ>。ᣚ¥)Û,e8&ᵨ1ôḄ÷<>,,e8}8}?ᙠ。tJ>ḄRd⁚,eØBVwRI^ḄSS。᝞,SḄ00^[I^eØᵨSḄ ⚜ᜓ+,ooo29´ᑮᨬxḄ$W。SØ&00^1I^8Ḅ>b¿ᢝ)=>。ᨵîo=I^o=3ᵨḄ1ô,PQ¦◤⌕¿ᢝ1ô}©Ḅ>ÒḄo%ᑖ,Jî-e8&ᵨᐸ¤Ḅ>,PQB]%£_1^0×1«^。ᡠ8KK¸ὃÛᦻ᫏,ÅÚ1ôḄRêæ。〇0p᪗Z⌕Õo=1ôḄ}©#åxSØÙᦋL。᝞,SØo=Rᨵ1ô8¹HḄ>,_`HḄ1ôÌ"å。ÓᯠÔᨵ▲ᑴo=1ôᒹõ>,PQ23Ḅ÷Q,w1ôᒹõ᱄1ôḄᡠᨵ>,ᯠx8¹H>。1ô23ᨵi=",ᡠᨵ"Ḅ1ôᙠW᡻$rḄ÷z,P8Ðᙠd⁚eØᨵᡠS。o[,03^I^ᔜ"Ḅ1ô。J᪵oᩭ,ḄKᵨÑe8öyᵨ0^4I^Ḅ1ô,HḄKᵨÑe8ᵨ(^^1I^ḄH1ô,8ᵨH1ôḄᱯ。23,o=1ô§ᵨrḄÈ7,,¹o=᦮ᦪ⊤9"。᝞,ᨬ*Ḅ1ôXÈwlMyInterface,Öx5"KìXÈwIMyInte^face2IMyIme^face3。07"8923ᵨDirectXḄ᱐᪗1ôḄ"。9:ᡠç1ôḄ>▭Q1ôḄᦪ,¦Svᙠ0(^^10Ò237w>,ᙠ0+5Ò237wᡂᕒᦪ。3.HRESULTjI0ttᡠᨵ0011ô>-]%o=7åw11X£5。1^Ḅ32ß᦮ᦪ。Iñᜧiᦪ>¡,HRESULTWQᒹõ5%ᑖ⌕1êḄ$᪀。J5%ᑖ1êQ:•1ô>᡻$Qᔲᡂ;•÷>vÄrᐵḄfid⁚1ê。.ᨵ1ô>]%ᙠWinerr0r•hᜮᦻÒ}©Ḅ᪗ZHRESULTò。ᯠ ,w]%fiᱯ}Ḅ1ê,1ô>e8]%÷U)}©ḄHRESULTò,J)}©Ḅ1^£8^1>×ò23µ2ᙠ>ḄÛᦻ᫏Ò。Û:ᙠ1ô>Ûᦻ᫏ÒᑡÈḄ¦X£51^ò,23QeØ]%òḄo%ᑖ。Kᑡ⊤23¦ᒹõÖᱯ}JK1ô>Ḅ]%òÖIJK1ô>ᨵᱯ}õ©Ḅ᪗Z]%ò。ᡠ8ᓽᙠÛᦻ᫏ÒÔᨵÛ,·KìᎷ}1ô>B]%ᔜ*ᔜ᪵Ḅ^1X£5⛭^ò。Óᯠ^^£5。^3ᵨᩭ]%È┯1ê,P8ÐSQÈ┯"ṹ。▭,ᢣ91ô>&ᵨᡂRQᜫ}Ḅ᪗ß÷ᒹõ*d1êḄ᪗ßQrÎᑖãḄ,2vᒹõ*d1êḄ᪗ß,HRESULTòe8ᒹõ÷UᦪḄᡂÈ┯"ṹ。᪷£},ᡂ"ṹḄÈ7ᐹᨵûqS_,ᜫ}"ṹᐹᨵûq£_。᝞,5=ᨬ3qḄ"ṹQ$_0&£_^^|,ᑖ⊤9ᓫḄᡂᡈὅᜫ}。_,(^^>eØ]%ᔜ*ᔜ᪵Ḅᡂᡈὅᜫ}"ṹ,JUᕡḼ,ÞbxHRESULT^。᝞,eØBᎷ}o=>]5_(^<⊤9᡻$ᡂ,]%£_?⊤9ᜫ}。PQo=>·B]%ᐸ¦ᜫ}ᡈᡂ"ṹ。☢Ḅ"ṹÛᵨJ*ᓫᑖ>Ḅᓻ◅。&⊤9>]%Ḅ1^£51^×ò。if(hr*=E_FAIL){//Handlethefailure}else{//Handlethesuccess>᝞W>¦]%£^^⊤9᡻$ᜫ},J=stXØì3$。P>·eØ]%ᐸ¦ 30oooÎ2U┯ò,᝞,E_NOTIMPL*E_INVALIDARG。IJ☢Ḅ"ṹ,JòXÌÚᡂQ᡻$ᡂ,^eØBKᵨÑ$ᜫ}。᝞W◤⌕>᡻>7$WḄ*d1ê,◤⌕IZ=HRESULTn$ᑖ。P23¦ᐵ>Qᔲ᡻$ᡂ。ᑖHRESULTòQ⊤9᡻$ᡂRQᜫ}Ḅ>Q,ᵨ☢ḄQIHRESULTòn$Ãᓄ,JQQᙠ>^î0^1^ᜮᦻÒ}©Ḅ。•ì11X£501(×ò⊤9᡻$ᡂî,SSUCCEEDED®0TRUE,ᔲᑣ]%?15。•ì1^31^×ò⊤9᡻$ᜫ}î,QFAILED]%TRUE,ᔲᑣ]%?ᓃ5£。Rᙠ,e8ᵨ☢ḄFAILEDQ"ṹf/"☢Ḅᑨe"ṹ。if(FAXLED(hr)){//Handlethefailure>else{//Handlethesuccess>Jf"ṹe8ìᙢ£o>^07^4?!^ᓹ£_1>^^^10&0ÚᡂQ᡻$ᜫᦝ。ÓᯠᜧiᦪCOM>]%$᪀ᓄḄHRESULTò,P·ᨵoÞ%ᑖ>ᵨHRESULT]%ᓫḄ᦮ᦪò。J¦]%ᓫ᦮ᦪòḄ>,ᨩõḼ>ÙQBᡂ᡻$。᝞WXJ*HRESULTltffji^SUCCEEDED^,8ÙQ]%×Xô。o=3qḄQ⑴û᝞〜ᓄ:1^1^()>,K>X0(^!I^ḄAᵨTᦪï1,ᯠx]%ìûḄAᵨTᦪ。00%I^ḄAᵨTᦪᵨᩭᑴ〔0”I^nX»,ᙠx☢RBn$CD。2.3.2çCOMvᨵi*>e8_`00pI^,ᨬ3qḄ5*>᝞:•z1,2vX001I^Ḅ5᪗¤(CLSro)0^ᦊ1î&1^0ᦪ_`€(^1I^。KᦪX_`00”I^Ḅ,,]%ᢣ}1ôḄᢣ┐。•ÿ1,2v&ᵨo=01(^(>ᡈὅᦪ_`0^^I^。K>_`0(^^I^,,]%03“I^Ḅo=1ô。ì8J*>b_`ᓚ0pI^î,23Sᢣ}ᐹ#]%=1ô。23ᵨÿ1_`889I^,2vÿ1_`ᓚ0^^^Ûᓫ,¦◤⌕1ôᢣ┐ḄᙢᙬrKḄ0(^^^^_`>e8,ᯠxK>B_`(^^^I^,]%1ôᢣ┐。ᵨÿ1_`004I^î,23SØᢣ}ᐹ#]%=1ô。P33e8ᢣ}᝞<_`001I^。᝞,☢Ḅ"ṹ&ᵨ107D1309:[D1606?^()>_`"⊤µ9〉ᘤḄ(ᜓI^,8]%ᢣᔣI^1ô10^83006¸69Ḅᢣ┐。K>ḄûZ=¸ᦪ_`I^ᡠ◤⌕Ḅ1ê,ó=¸ᦪᵨJ]%1ôḄᢣ┐。IDirect3DDevice9*g_pd3dDevice=NULL;•v•if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT•D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING•&d3dpp,&g_pd3dDevice)))returnE_FAIL;2.3.3ᵨ〇0[^" _`00?^I^åx,_`>B]%o=1ôᢣ┐,e8ᵨKᢣ┐E1ôḄ>。 ⚜ᜓ+,ooo31ᵨ1ôᢣ┐&ᵨ1ô>Ḅ ÷ᵨᢣ┐&ᵨ^+I^Ḅᡂᕒᦪr。ᙠ¡iêæ,^ᓚ01I^_`>]%Ḅ1ôᢣ┐eئQᡠ◤⌕1Uᢣ┐ÒḄo=。ᯠ ,ᨵi034I^i=1ô,,·eØ◤⌕ᵨᐸÒḄi=1ô。᝞W◤⌕ᵨᓚ01I^_`>]%Ḅ1[4å᜜Ḅᐸ¦1ô,S◤⌕_`HḄ〔01I^,e8&ᵨ<^^1I^Ḅ10ᦑᓹ0%0::ᓹû71î6^^60>;Ìᐸ¦1ô。᝞W2v000^〖61ᢕ3᝞6()ᦪ_`€01I^,e8ᐜ;Ì1'“(^01ôḄᢣ┐,ᯠx&ᵨ1'ᓃ(^^::ᓹû71·06()>ᩭ;Ìᡠ◤⌕ḄZ=1ô。PQ᝞W¦◤o=1ô,J*>bS>¯,,᝞WᡠᵨḄ〔01I^_`>Sᐕ¡ᢣ}]%=1ôᢣ┐,J*>b᪷$S2。▭,23S◤⌕;ÌIUnkn0wn1ôᢣ┐,Vwᡠᨵ0011ô-öD)⑴^Ḅ…^1ô。2.3.4¶ᳮ00^^I^ḄnX»ì_`o=(^^^I^x,jkXᑖ◤Ḅᑁ?tV。ìo=00pI^SÙ◤⌕î,KK³ÃK0€»^I^,^jke8%ᦈw(^^!I^ᑖḄᑁ?。I0+I^¡,e8ᵨH*᝞1ᑴᐸnX»。00?4öᑣSᐕ¡z1_`³Ã€0^I^,Vwo=(^^I^eØÌi=KᵨÑᵨ。COM2vAᵨTᦪjkᑴCOMI^ḄnX»。034I^ḄAᵨTᦪQᐸ1ôÌᵭèḄSᦪ。ZS1ôÌᵭè,ᐸAᵨTᦪ¹1。ì1ôSÙ◤⌕î,KᵨѳÃ1ô,JîAᵨTᦪï1。¦⌕AᵨTᦪᜧJ0,00^^^Bᶇᙠᑁ?Ò。ìAᵨTᦪLw0î,0(^4I^B├)Å。ÑᕒS◤⌕⍝ᐵJ009I^AᵨTᦪḄ÷<1ê。¦⌕ìᙢᵭè8O³Ã1ô,I^BᐹᨵìḄnX»。9:ìóoS_`00^1I^î,B]%o=1ô,ᡠ8óoS_`00^1I^åx,ᐸAᵨTᦪw1。ìᙢᜐᳮAᵨTᦪQ00^ÑḄᐵÏ%ᑖ。᝞WÔᨵìᙢᜐᳮAᵨTᦪ,B⌼ᡂᑁ?。IJ001Ñ,ᨬ3qḄ┯QÔᨵìᙢ³Ã1ô,o#nJ*êæ,B⌼ᡂAᵨTᦪäSB®ᑮ0,JQ00^^^Xozᶇᙠᑁ?Ò。÷<î᎛,ì;Ìo=HḄ1ôᢣ┐î,&ᵨ1^(^1^:(^X)>AᵨTᦪ¹1。᝞W1ôᢣ┐Q2v&ᵨI^_`>ᡈqᦑḄ…⑴©ûᦊ·£´ᑮḄ,COMI^B)ÎwAᵨTᦪ¹1,^S◤⌕ᙠKᵨÑÒ&ᵨ(^X&()>。᝞W1ôᢣ┐Q2vᐸ¦>´ᑮḄ,᝞2vcᑴo=?ᙠḄ1ôᢣ┐,ᑣ µb&ᵨ⑴'Í…⑴:¿᝞>001I^Ḅ7ᵨTᦪ¹1。S¶Q2v&ᵨ(138&0>RQ031I^HAᵨ¹ᦪ¹1,- ³Ãᡠᨵ1ôᢣ┐。ìSÙ◤⌕)=1ôᢣ┐î,&ᵨ1〜40*1^X¸386()>³Ãìû1ô,^0^1I^ḄAᵨTᦪï1。3qḄvÄQ,X1ôᢣ┐*+ᓄw>^_^1ì³Ãî,X8Ð@HᢣᔣNULL。2vJ*},ᙠKᵨÑḄÜ◀"ṹÒ,e8bÅᡠᨵ1ôᢣ┐,1ôᢣ┐SQNULLḄ1ô-ᯠ?R,^ᙠ$kKᵨÑåû,³ÃJ1ô。2.4»I8"^9Ñ◤⌕ḄẠ n$⌕CD,ᒹ8}=>☢:ᦪzẠ、Win32?1ÑẠ00^4ᵨẠ。JẠ ᙠx☢Ḅz{vÑÒ-Bᵨᑮ。»ḄᦪzẠ00?4Ạe8g◤⌕,»ÈḄ>¥7032?1ÑẠRÛᓫ, 32oooÎ2Uᨵiᑁ4RÔᨵNO,Sve8gxyᑁ4z{Ḅ◤⌕。ìᯠ,᝞W/ὅfi\^32ô1ÑḄ ,IJ01^(^^ÑḄz{XQᨵᜐḄ。a!1.ÅÚ〇^^^(ᕂᓹXᦻ᫏,៉0309Ḅ÷ᔣ、▣á☢rᐵḄ$᪀5`8OrKḄ#ᦪ。2.᪷£»CDḄp_`o=ᓫ^&2⚗p,,ᑖ᪆⚗pḄᔜ*}ឋ。3.ᑖ᪆5᝞ᕸo7^??9Ñ,ᳮᑩ&2?1ÑḄ$vÑ。4.ᑖ᪆᝞<ᑴ001I^ḄnX»。 Î3U0^(^30ᐭ'ᙠó1»CDv,0©D30Q0^(^Ò]_`}CÎḄ%ᑖ,mSDirectX*ᨬcᩖḄ%ᑖ。^»(+ᑮó13»,X⌲pz{ᵨ0^^^30:#}CÎÑḄẠ 。»⌕CDô7"(^30Ḅ#j$᪀、07"(^30⊤☢、07"<^30(ᜓI^、:#0^^^30ÑḄp8O:#ú᛻(¶ᑁ4。3.10ᓄ(^30#j$᪀⁚⌕CD÷0^^130Ñ(#$ᑗrᐵḄh^j:¸ὃj¶ᭆù,U&Direct3D.µᓱÉÎÑ、0ô1÷µᓱhåÿḄᐵj。3.1.1h^jh^j(HardwareAbstractionLayer,HAL)Qᵫhᑴ⌼ᖪḄᱯ}JhḄ1ô,8^(^30ᑭᵨK1ôRIµ9hḄz1E。KᵨÑS◤⌕z1E¦ᓃ,¦◤⌕&ᵨ07"(^30Ḅ1ô。ᓽDireCt3D2vHALR(ᜓNᐵᱯឋ,2v8830e8ᑏ(ᜓNᐵḄᦔ"ṹ。88302v^11ḄẠ$᪀,wÑᕒoᝅkoḄ1ô>,ᵨJEh。ᜧiᦪñ8830c?1:#Ḅ}CÑ$ñh^jå,^îe8ᐙᑖᑭᵨjkhḄ¹¤Ø,-◚¢hrᐵḄ(ᜓᱯឋ。2vᑏ÷(ᜓNᐵḄᦔ"ṹ,ô^^^^ÑÙØ8ᨬ±>b$,Vûᐹᨵᦔ᳛,᧕J:#ḄÚA。¦ᓃe8QµᓱÉÎÑḄo%ᑖ,·e8QµᓱÉÎÑrÎὶjḄᓫäḄÎ᝱@1?(DLL)。ᓃQ÷(ᜓrᐵḄ"ṹ,IhS¿ᢝḄØ,8S:U。¦ᓃhØbÅ,PSn$¸ᦪbÅ,ᡠᨵJÃÄ◤⌕ᵫ8(^30ᙠ&ᵨ{^ᓃåûn$。3.1.2:¸ὃj◀¿ᢝᦔ᳛᩽Ḅh^j᜜,07"(^30ÑR¿ᢝ:¸ὃj(ReferenceLayer,REFLayer)c:¸ὃje82v:UḄ>bÖhS¿ᢝḄØ,^ᙠ)ᱯPêæ-ᯠe8ᵨḄô789Ø。᝞ᙠìû(ᜓS¿ᢝ)Ḅ889ᱯឋî,wz{stJᱯឋ,e8ᵨ:¸ὃj。 34oooÎ3U3.1.30□(í0îïðᡂDirect3D、〜4᝞Z812[ᜓ" (GraphicsDeviceInterface,GDI)、HAL<[]*håÿḄᐵj᝞3.1ᡠ9。᝞3.1ᡠ9,071^〖30001ᜐᓟojS,0L830001-e82v(ᜓÉÎÑ1ô(DDI)Eh。PSJ001ḄQ,0^^30Re8ᵨ1112v001ᩭEh,^e8ᐙᑖᑭᵨhḄØ。HAL(ᜓ2vh¿ᢝḄᱯh¹¤Ø。e8ᑭᵨ0^^〖30>bÅhQᔲ¿ᢝ)Ø。᝞WT!Ḅµ9〉ᘤ(µᓱ)¿ᢝ0〗ᕸ130,HAL¯?ᙠJKT!Ò。◤13.1bᵨM、Direct3D、⌕üUḄQ,µᓱÉÎÑt´¿ᢝ0<^^^#1ḄᐵDirectX7.0᱐Ḅ001Ø$07899.0KᵨÑ。⌕bÅ001᱐,e$“DirectXDiagnosticTool”⑴7"8᱄¤eÃᐹ),KÃᐹßJC:WINDOWSsystem32p2K,$Kp2Ḅ(^§86e᡻$ᦻ¯eÖÎ0^^^¤eÃᐹ,᝞3.2ᡠ9。€»OifecrX^_]ma^-98i«*2j%x᪵dlobilityU^wM»d4f.tttR:T,chxwl,ci*iIpc8e4l.ll000S^ftflJ^n4iiplvy44«^ttr<«2XXf^/m<12:40.10DAC^BInt«nuIDAC(40CMMr)»ᑁ»3«lWT«b«8,、1ᡊx105002hi)^KMmm«ᓺᵨ£«;ìûµᓱ¿ᢝḄ08᱐13.2p2[ᓱ=MḄ001᱐9:^"89¤eÃᐹQo=3ᨵᵨḄÃᐹ,8÷ô^^^rᐵḄ¡i1ê。CÚ/ὅ៉KÃᐹḄᵨ。3.207□&30⊤☢®DireCt3D*,⊤☢(Surface)"⊤µ9ᑁ?ÒḄoᙽ+ឋr,¶⊤☢·e8ßJjkᑁ?,PQ23êæ⊤☢ßñµ?Ò。⊤☢e8ÚᡂQo=BCḄᦪ,ᐸÒZ=ᐗ²ᒹõ⊤9Òo=²Ḅ7⁐ò。⊤☢ᐹᨵ5=}ឋ:oQᜧÞ;BQZ²7⁐Ḅßᦪ。 0ᓄ^30ᐭ'ooo353.2.17□(^303ô061ô÷⊤☢rᐵḄᔜ*vÄ8OI⊤☢Ḅ¶ᳮᵫ10^^^3050^^^91ô_`,K1ôÒᨬ@⌕Ḅ>᝞。•LockRectK>ᵨJ;Ìᢣᔣ⊤☢?;(surfacememory)Ḅᢣ┐。2vᢣ┐,e8I⊤☢ÒḄZ=²n$/ᑏvÄ。•1^^&6ᕲᓹW&ᵨ10''8()>, ᡻$[E⊤☢?;ḄvÄ,ᑣ &ᵨK>◀I⊤☢?;Ḅ┝}。•061080K>2viᐙ$᪀03051X?0£_0£50^;Ì⊤☢ḄóF1ê。3.2.2Oÿ.01H130ᵨ0305^1X?ᓚ£^^5(:$᪀óF⊤☢,K$᪀ᵨ^^1(O)Ì7ᔧ'()ᡂᕒóF⊤☢ḄÏᜧÞ,J5=ᡂᕒ-Q8²wᓫß。ᡠ8IJo=640480Ḅ⊤☢,NàQ8ßḄ⊤☢RQ24ßḄ⊤☢,”7(1ᓄ^^7§&ᡂᕒòQrḄ。ìᵨ10&“305^(3069:§(^9X6(^()>┝}o=⊤☢î,K>Biᐙo=D3DLOCKED_RECT^^,K$᪀ᒹõ⊤☢Ḅÿ.(pitch)o=ᢣᔣ┝}?;Ḅᢣ┐。03010<^^0_R£0[$᪀Ḅ?1¦ᡂᕒóF⊤☢Ḅᑁ?ÿ.,·7w(stride)。ÿ.Q⊤☢o$Ḅ:ᜮo$:ᜮåÿḄ.ã,8Ü⁚wᓫß。Vwÿ.ḄᓫßQÜ⁚SQ²,ᡠ8²zbSḄ⊤☢,ᓽᐸᜧÞr,ᐸÿ.·QSḄ。û᜜,SØᎷ}ÿ.òQOý8Z²Ü⁚ᦪ´ᑮḄò。ì┝}⊤☢?;,I⊤☢ḄZ=²n$vÄî,◤⌕TZ=¨Ḅß,wû◤⌕ᵨ⊤☢Ḅ²zb(²zbᵨJ}Z=²ᡠᓰḄÜ⁚ᦪ)。3.2.3²zbo©Ḅd⁚ᵫ²ḄᦪZ=²ḄßᦪᐳóF,ᐸÒ²Ḅßᦪ.}²7⁐Ḅ*dÑ。7⁐ßᦪᑖᡂ⊤9ª、«、¬}l⁐Ḅ}%ᑖ。ᙠ8^830Ò,ᡠᨵ²zbᵫ030?(^^^^Pp5`}©。o=8^30⊤☢Ḅ²zbᵫ⊤☢²Ḅ7⁐ßᦪ⊤9,3ᵨḄ²zbq⊤3.1。᝞,ᙠ0^830Ò,16ß²zb}©w030?^_X50635,⊤9²7⁐Òᵨ5ß⊤9ª⁐、6ß⊤9«⁐、5ß⊤9¬⁐。________________________________⊤3.1éᵨḄ01□^30òó«¬_________________________________᪗,î_____________________________________ו_________________________D3DFMT_UNKNOWN_+3456D3DFMT_R8G8B8T34ᵫ8L1G、8ñᡂ,ᐳ24LD3DFMT_X8R8G8B8T34ᵫ8L、G、8<8LaᶇLñᡂ,ᐳ32LD3DFMT_A8R8G8B8T34ᵫ8L、G、B、A(Alpha)ñᡂ,ᐳ32LD3DFMT_R5G6B5T34ᵫ5L、6L0、5L8ñᡂ,ᐳ16L3.2.4Êᣚ@÷⊤☢Ãᜧiᦪ}CѺᨵ2=ᡈfiḄ7⁐>?。ᵨJìûefᑵHḄ7⁐>?7wû'>?,ᵨJ¿ᑴḄᐸ¦7⁐>?7wx'>?。îºᨵû'>?x'>?Ḅ 36oooÎ3UÑ,e8în$¿ᑴefᑵHÃÄ,ᐸjkḄ$ឋØÚñᨵᓫ=7⁐>?ḄÑ。ᙠ81^^30ÑÒᨬ3qḄêæQᨵo=û'>?o=x'>?。ìᙠx'>?¿ᑴ[x,◤⌕Xx'>?Îᑮû'>?n$µ9,J=vÑ7w⊤☢Ã。Vw¯ᓱᵨᢣᔣ⊤☢Ḅᢣ┐⊤9û'>?,ìKᵨÑ⌕Õ01^(^30Xx'>?Êwû'>?î,07(^30IÃ5=ᢣᔣ⊤☢Ḅᢣ┐,$Wx'>?LᡂHḄû'>?,lᩭḄû'>?LwHḄx'>?。ᙠ÷<î᎛,¦⌕KᵨÑ⌕ÕÊx'>?ᑮû'>?,Bn$⊤☢Ã, ᙠo=µ9ᘤᑵHᕜ»ᑁe8n$ojᑡḄÊx'>?èÕ,JQ07"ô30(ᜓÊÿ◞(presentationû'óox'óBx'interval)Ḅᭆù。•>?>?>?Êᣚ@Qᢥ<⌲=Êᑮû'&9Ḅi=x'>?Ḅᔠ。Êᣚ@23ᵨñᙠᑁ?ÒF,F[xÙÊᑮû'>?µ9,^ nᡂOᵹḄÎ。ᙠ0ᓄ^130Ò_`ḄZ=F(ᜓt´ᨵo=Êᣚ@。ìÊᣚ@ᒹõo=û'>?i=x'>?î,ᢣ┐ÊᣚQ+ún$Ḅ,3.3Qo=9。3.307□0730(ᜓI^0©D30F(ᜓ(7w0©D30(ᜓ)_`13.3⊤☢c;F,ᙠÑÒwo=COMI^,8Qᨬ@⌕、·QᨬcᩖḄ8G1300(^I^,Ê?;FG᝱(FG᝱ᵨᩭᑴḄ¿ᑴ>b,x☢B]CDFG᝱)。û᜜,0^^〖30(ᜓR᡻$ᙶ᪗Lᣚᐝ᯿T,,X¿ᑴᑮµ9⊤☢。ᙠÑÒ⌕&ᵨ07^830(ᜓI^ḄØ,✌ᐜ◤⌕;´KI^Ḅo=1ôᢣ┐。3.3.10□(^30iᜓôõ07^^30(ᜓ⌕ᨵ5*5`:111(ᜓ&£?(ᜓ。◀HAL(ᜓREF(ᜓå᜜,Rᨵo*7åw“:(ᜓ”Ḅ(ᜓ5`,J*5`Ḅ(ᜓRᙠ´ᵨ。07"^30ᵨ0300£¥×v?£Pp⊤9ᔜ*(ᜓ5`,᝞ᡠ9。typedefenumD3DDEVTYPE{D3DDEVTYPE_HAL=1,//HALlS^D3DDEVTYPE_REF=2,//REF^D3DDEVTYPE_SW=3,":(ᜓD3DDEVTYPE_NULLREF=4,D3DDEVTYPE_F0RCE_DW0RD=Oxffffffff,>D3DDEVTYPE,*LPD3DDEVTYPE;1.^^ᓃiᜓHAL(ᜓQ⌕Ḅ(ᜓ5`,8¿ᢝh¹¤ᐝ᪕ᓄ8Oh:⚔Aᜐᳮ。᝞W$0ᓄ830ÑḄT!Ḅµᓱ¿ᢝ07ᕸ130,Ö8G130ÑBᵨ11[᡻$}CvÄ。¦ᓃ(ᜓ2vhᩭn$ᐰ%ᡈ%ᑖᙶ᪗Lᣚ、ᐝ᯿ᐝ᪕ᓄᜐᳮ。ᙠÑÒS◤⌕z1Eh,Q2vHALEh,ᵫ¦ᓃ&ᵨµᓱÉÎÑḄᦪ>。᝞Wh¿ᢝHAL,Ö8^(^30Ñ2v?11^(ᜓØ8ᨬ±>b$。 08□30ᐭ'ooo372.X£「(ᜓ¦ᨵï07"8950〖B¸ὃ(ᜓ。ìÑᙠèï8"8950XḄ!ᘤèÕ¸ὃ(ᜓîB]%~01ᓃ,JîᡠᨵFvÄḄ$W-XᕈRo=|e。¸ὃ(ᜓ¿ᢝᡠᨵḄ07^(^30ᱯឋ,ᵫJ¸ὃ(ᜓü@ÖR07^130Ḅᡠᨵᱯឋ,Sü@$¤,,¸ὃ(ᜓS¿ᢝh¹¤,ᡠ8ᵨ¸ὃ(ᜓ¿ᑴḄ¤᠒。S¶hQᔲ¿ᢝ,¸ὃᐝ᪕ᘤÙQ2v0?。ᢣ$¿ᑴ。ᵨ¸ὃ(ᜓḄpḄQwst^907"830Ḅᱯឋ,᝞,᝞WUz{07830Ḅ)=ᱯឋ,ìûᵨḄh-S¿ᢝKᱯឋ(Jît_`^^ᓃ(ᜓBᜫ}),Jîe8ᵨ¸ὃ(ᜓᩭstz{JhS¿ᢝḄ8830ᱯឋ。3.3.2⚔Aᙠ01«5830Ò¿ᢝ:h5*⚔A>。23,IJ:⚔Ah⚔A,(ᜓØÔQSḄ。᪷£µᓱµᓱÉÎ,h⚔AᜐᳮØÔQeLḄ, :⚔AᜐᳮØÔQ³}Ḅ。IJh^j(ᜓ¸ὃ(ᜓ,ᑡ᪗ᑴᐸ⚔Aᜐᳮ$w。*D3DCREATE_SOFTWARE_VERTEXPROCESSING•D3DCREATE_HARDWARE_VERTEXPROCESSING•D3DCREATE_MIXED_VERTEXPROCESSINGᐸÒD3DCREATE_MIXED_VERTEXPROCESSING᪗(ᜓᵨ:hᐳn$⚔Aᜐᳮ。:⚔Aᜐᳮo=&¿ᢝḄ⚔AᜐᳮØÔ,ᒹN▲ᑴḄᐝVᦪeÑ⚔AḼ⁐ᘤḄ[ᐰ¿ᢝ。ìᵨ¦ᓃ(ᜓî,eᙠ÷<îÿᙠ:⚔Aᜐᳮh⚔Aᜐᳮåÿn$ᑗᣚ,!^ᓃ(ᜓQo*î¿ᢝ:⚔Aᜐᳮh⚔AᜐᳮḄ(ᜓ5`。ᙠ▭ÑÒ,e8✌ᐜ´tᵨh⚔A,᝞WìûhS¿ᢝh⚔A,ᑣ¬ᵨ:⚔A。e82vbÅ(ᜓឋØ}ìûµ9(ᜓQᔲ¿ᢝh⚔A。9:µᓱ¿ᢝh⚔AḄ=᜜o*¶PḄÛQ,Kµᓱ¿ᢝ⚔ALᣚᐝ᯿Ḅh。3.3.3_`07□^30(ᜓI^_`0ᓄ830(ᜓI^▭·Q*+ᓄ0^830ḄvÑ,◤⌕8Z=p。•_`07"830I^,;Ì10^83091ôᢣ┐,•bÅ(ᜓឋØ;•iᐙD3DPRESENT_PARAMETERS$᪀,•_`07"83ô(ᜓI^,;Ì10ᓄ8300&9^^91ôᢣ┐。1._`07□(^30I^0©^130I^Q0^^^30ÑÒ◤⌕_`Ḅóo=I^,·Q◤⌕ᨬx³ÃḄI^。e8ᵨ0᝞8300^ᦊ9()ᦪ_`07ᕸ130I^,,;Ìo=ᢣᔣ10^83091ôḄᢣ┐,ᦪ8"(^30(^^9()¦ᨵo=¸ᦪ,K¸ᦪ(w030_50〖^^X51(^。☢Q_`0^830I^Ḅ9。LPDIRECT3D9g_pD3D=NULL; 38oooÎ3Uif(NULL==(g_pD3D=Direct3DCreate9(D3D_SDK_VERSION)))returnE_FAIL;;Ìᑮ101^^3091ôᢣ┐åx,e82vK1ô,bÅh(ᜓḄឋØ,Pp0L830(ᜓ,J5⚗§ÄQ_`0^830(ᜓI^ᡠ◤⌕Ḅ。(ᜓPpQᢣ;ÌjkÒeᵨḄZᙽµᓱḄឋØ、µ9Ub(displaymode)、µ9zbOᐸ¦1ê。ᵫJ(ᜓPpḄvÑÛcᩖ,wᓄÑR,ᙠḄ9ÑÒµᶍJ=vÑ,,⌱àìûµᓱ}¿ᢝḄµ9Ub、µ9zb¶,8&ØTᡂ_`0^^^30(ᜓI^,ᐹ#>ᙠx☢RBCD。2.(ᜓឋØbxᙠ_`0ᓄ(^30(ᜓI^åû,◤⌕bÅìûµᓱḄឋØ,8_`Ḅ8^Èᓹ(ᜓI^ᙠ᡻$FîØTᐙᑖᑭᵨhḄᜐᳮØ。e82v10^(^309::0^0^(^^8()>;Ììûh(ᜓḄឋØ,K>iᐙ-•=0300?9$᪀。2vbx0300?9$᪀Ḅᔜ=ᡂᕒ,e8ᑨeìûhQᔲ¿ᢝ)⚗Ø。188309:¶6106vᓃ603?8()>Ḅ¯᝞。HRESULTGetDeviceCaps(UINTAdapter,D3DDEVTYPEDeviceType,D3DCAPS9*pCaps);ᐸÒ:•€139L61*µᓱḄ•061^67ᓹ6[ᜓ=>•?(^?3]%iᐙåxḄ(ᜓឋØ$᪀L᝞,ᑨeìûhQᔲ¿ᢝh⚔AᜐᳮḄ"ṹ᝞。D3DCAPS9caps,.d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT,deviceType,&caps>,intvp=0;if(caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT){vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;>else{vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;>9:᝞WZᜓᵨoHḄ、Ḅᱯឋ(RÔᨵ´ᑮhâ+¿ᢝḄᱯឋ〉,`ÚᙠᵨJᱯឋåûÙQᐜbÅ(ᜓឋØ,ÅÚìû(ᜓQᔲ¿ᢝZᜓᵨḄᱯឋ。ᙠx☢,ìNOoᱯឋî,B9Jn$rKḄ(ᜓឋØbÅ。3.iᐙô30?8Ç5Ç·oᓹ[^"¸×£¹8$᪀ᙠ_`07G〖30(ᜓI^åû,R◤⌕ᐜ*+ᓄ030?¦£5£^^^^^^1£X5$᪀,K$᪀}©8^830(ᜓI^Ḅrᐵ1ê, J1êXB/08830(ᜓḄµ9>,K$᪀Ḅ}©᝞。typedefstructD3DPRESENT_PARAMETERS{ 08「630ᐭ'00039UINTBackBufferWidth/BackBufferHeight;D3DF0RMATBackBufferFormatjUINTBackBufferCount;D3DMULTISAMPLE_TYPEMultiSampleType;DWORDMultiSampleQuality;D3DSWAPEFFECTSwapEffect;HWNDhDeviceWindow;BOOLWindowed;BOOLEnableAutoDepthStencil;D3DFORMATAutoDepthStencilFormat;DWORDFlags?UINTFullScreen_RefreshRateInHz?UINTPresentationInterval;>D3DPRESENT_PARAMETERS,*LPD3DPRESENT_PARAMETERS;ᐸÒ:•8Å0^3ô££6^1º&83。98'£6^^19ᓃx'>?ḄO。᝞W8ïô>bµ9,KᡂᕒLÌ(w0,ᑣjk)Îᵨïô(ᡝḄOÄwx'>?ḄO。•»<^8|^ᓃ“0^^^x'>?Ḅ²zb,5DJefµ9Ḅ²zb,²zbQ²ᙠµ9ᑁ?ᡈT!ᑁ?ÒḄ?;zb,q⊤3.1。•3&0^^“£6“0¿Lx'>?Ḅᦪ。Kòe8w0、1、23,ᐸÒÌ01î-⊤9_`o=x'>?。᝞WjkSØ_`ᢣ}ᦪḄx'>?,ᑣ_`0ᓄḄ0(ᜓBᜫ},îB)ÎXKᡂᕒ(wìûjk¿ᢝḄx'>?ᦪ。•^^1L153Í161796i@¬᪵5`,ᵨJIJK。•3〜39£££601:ᢣ9jk᝞?Ḅᑁ4cᑴᑮû'>?,KᡂᕒQ0305o?£??£0^Pp5`,ᔜPp3Ḅᐹ#õ©èÅÚ50〖ᦻ᫏。23XSwapEffectSSSD3DSWAPEFFECT_DISCARD,Jîᦔ᳛ᨬ。•¼067½06;^1^0〜ᢣ}¿ᑴïô。᝞WX©'v&^^^^(w>^^,ᑣ¿ᑴïôwìû̾RḄïô。•^^^^0〜601᪗8ïô>bRQᐰe>bµ9。᝞WXKᡂᕒ(w×X0£,8ïôµ9!᝞WXKᡂᕒ(wFALSE,ᑣ8ᐰe>bµ9。•£ᡭ3ᓃ16c#006?^5L6Ḅ½123XKᡂᕒ(w×X1£,Jî8830B)Î_`,CgUUr>?。•û00ᓺLL6¹11?0ᕸ8LU>?Ur>?Ḅ²zb0•?1393KᡂᕒQo=030?&£5£>^^^3,ᵨJᢣ}o▬¹Ḅᱯឋ,eXᐸ(wÒAò0。•FullScreenoRefreshRateInH2ᢣ}ᐰeµ9Ub,µ9〉ᘤᑵHefḄ⚣᳛。IJïôµ9Ub,Kᡂᕒ(w0,IJᐰeµ9Ub,23XKᡂᕒ(wD3DPRESENT_RATE_DEFAULT,⊤9ᵨµ9ᘤḄÒAᑵH⚣᳛。•?¿861^^&01^1^6〜31ᢣ}x'>?÷û'>?ḄᨬᜧÊᣚ⚣᳛。e8Ì030?À£·3ÒḄo=,23(wD3DPRESENT_INTERVAL_IMMEDIATE(ᓽÊ)*D3DPRESENTJNTERVALJDEFAULT(ᵫ〇^^130⌱àÊ⚣᳛,23¶JᑵH⚣᳛)。ÓᯠD3DPRESE^^^_PARAMETERS$᪀ḄᡂᕒÛi,P23êæ¦◤⌕ᵨᐸÒḄ 40oooÎ3U´ᦪ|=ᡂᕒ,ᐸ¦ᡂᕒLeÌjkḕò0,᝞,e᝞(。//✌ᐜ;ÌìûµᓱḄ᧎9UbD3DDISPLAYMODEd3ddm;if(FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULTr&d3ddm)))returnE_FAIL;D3DPRESENT_PARAMETERSd3dpp?ZeroMemory(&d3dpp,sizeof(d3dpp));d3dpp.Windowed=TRUE;d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD?d3dpp.BackBufferFormat=d3ddm.Format;d3dpp.EnableAutoDepthStencil=TRUE?d3dpp.AutoDepthStencilFormat=D3DFMT_D16;ᙠ¿ᑴcᩖḄî,ÒḄi=ᱥ#eØBrÎÂᢱ,ãe8AÛäḄᱥ#BVwᜐᱥ#ḄÂᢱSeqᡈ%ᑖSeq。01^(^302vUstRJ*ᦔW。ÒAêæ,UstØQÖᵨḄ,PQwØTn$UstR◤⌕_`U>?。☢"ṹÒḄd3dpp.EnableAutoDepthStencil=TRUE;⊤9ᵫ0©6“30_`,¶ᳮU>?,33<^9.ùû0069^5L61^11[03^3L=030『ø|3?_016;⊤9U>?ÒZ=²ḄUòw]6ß。Re82vrᐵ(nopᑴUst,Sv23êæÒAḄUste8g◤⌕。"ṹ€13(199.830ᓃ8“£6“03^^L=€136<^.?01^^;⊤9x'>?Ḅ²zb÷ìûµᓱḄµ9zbr。▭,ᙠïôUb,e8z1X830^^^'3^0^&L(wD3DFMT_UNKNOWN,Jîx'>?Ḅ²zb÷ìûµᓱḄµ9zbr。J᪵☢Ḅ"ṹeᓄw8b,J·Qᜧ%ᑖ9ѬᵨḄ(。D3DPRESENT_PARAMETERSd3dpp;ZeroMemory(&d3dpp,sizeof(d3dpp));d3dpp.Windowed=TRUE;■d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;d3dpp.BackBufferFormat=D3DFMT_UNKNOWN;d3dpp.EnableAutoDepthStencil=TRUE;d3dpp.AutoDepthStencilFormat=D3DFMT_D16?9:᝞Wᵨᐰef>bµ9,ᑣ ᢣ}x'>?ḄᜧÞzb。4._`07□(^30(ᜓI^0^(^30(ᜓI^}©0ᓄḄ0Ḅᡠᨵ¿vÄ,Wᜧiᦪ0ᓄ(^30vÄ-Q2v0ᓄ^130(ᜓI^n$Ḅ。rÛ ¡,01^(^30I^fQµ9h1êḄÛ,0^830(ᜓI^ᑣQ30ØḄᐹ#R。e8ᵨ《^D309:È〜^()>_`8830(ᜓI^。K>Ḅ¯᝞。HRESULTIDirect3D9::CreateDevice(UINTAdapter,D3DDEVTYPEDeviceType,HWNDhFocusWindow,DWORDBehaviorFlag,D3DPRESENT_PARAMETERS*pPresntationParameters,IDirect3DDevice**ppReturnedDeviceInterface 0ᓄ(^30ᐭ'ooo41ᐸÒ:•C<13?(6d᧎ᓱMÏ,⊤]ᵨfᙽ[ᓱç089“30[ᜓv。'ᦪ9j[÷nD3DADAPTER_DEFAULT。•DeviceType08A30[ᜓ=>。•11?0€^3>7'€10>7ᢣ}ì07¿830Ñ^û'Lᣚᑮx'îḄ9ïô。ì0^830$JᐰefUbî,KïôQ⚔ïô^ì8^(^30$JïôUbî,Kᡂᕒe8(wNULL,JîKïôQD3DPRESENT_ᓹCC^L£5᪀Ê1^6h^^^1^0¥ᡂᕒᢣ}Ḅïô。•8'391(^?1&9(ᜓ$w᪗,ᵨJᑴZᜓ_`Ḅ(ᜓI^ᐹᜓḄ$w。(ᜓ$w᪗e8Qi=᪗Ḅᔠ,23ᵨJᢣ}⚔Aᦪ£ᜐᳮ>b。•ᓹ?『6861^3(10û3^i(6[3ᢣᔣ030?£5£>1L_?CC£L[5᪀{Ḅᢣ┐0•ᓹᓹ¦6LÂ3^6<^69½。611^6^Ä06ᵨJ]%_`Ḅ07<^30(ᜓI^Ḅ1ô。2v☢ḄCDe8ÚÈ,_`8^830(ᜓI^åû◤⌕(i1ê,J1ê2v030?X£5£^X^£×£X5$᪀Ḅᡂᕒ€G1606v^()>Ḅ¸ᦪn$(。û᜜,ᵫJhØS¿ᢝ,_`0^D30(ᜓI^eØBᜫ},ᡠ8ᙠ_`0^830I^åû,ᨬᐜbÅh(ᜓḄឋØ,᪷£h(ᜓឋØn$rKḄ(,&ᡂ_`01^^30(ᜓI^。3.3.4(ᜓÅᜫ÷ឮc8^830(ᜓI^ᨵ5*G᝱:ÃÄG᝱ÅᜫG᝱。ÃÄG᝱Q(ᜓḄì3G᝱,ᙠûÃÄG᝱,F(ᜓᜐJ$G᝱,,ᡠ»ḄFØ。ᙠ)êæ,(ᜓBᵫÃÄG᝱ÃwÅᜫ᝱,᝞,ᙠᐰe$>b,0L830ÑᜫyÏÐᯖAî,Direct3D(ᜓBÅᜫ,^F(ᜓSÙF。(ᜓÅᜫᨬᐺ`ḄêæQ:ÅᜫᯖA,᝞ᵨᡝᢥ7&“ÏᡈCÈo=jkI)᪾。ᵯV¶ᳮ_、ᐸ¦Ñtn$ᐰefvÄî·B⌼ᡂ(ᜓÅᜫ。û᜜,&ᵨ«^^300^&9::1^£)>ឮc(ᜓîᜫ},·B(ᜓᜐJÉᜫG᝱。(ᜓÅᜫx,wØTöyn$FvÄ,◤⌕@H((ᓽឮc)(ᜓ。ᙠ@H(ÅᜫḄ(ᜓåû,◤⌕@H_`rᐵtV。ᙠ(ᜓÅᜫx,ÑKìÅDQᔲe8X(ᜓឮcᑮÃÄG᝱,᝞WSØ,ᑣ¶Ê,zᑮ(ᜓe8ឮc。ᜧiᦪêæ,0^^^30(ᜓI^Ḅ¡i>,S]%(ᜓQᔲÅᜫḄ1ê,Ñe8öy&ᵨFᦪ,SB1ᦈᑮ÷<(ᜓÅᜫḄ1ê。PQᙠᑁ%,JFvÄ-BÌËx,zᑮ(ᜓឮcᑮÃÄG᝱。Û:I(ᜓÅᜫḄᜐᳮÈḄ,ÒḄ9Ñ·ÔᨵI(ᜓyᜫḄêæn$ᜐᳮ。PQw¯Jxyᑁ4Ḅᳮ,/ὅKì(ᜓyᜫឮcḄᭆù。3.4ᨬíᓫḄ0^(^30M☢2v9Ñ0^&0€77E,CD:#0^830ÑḄp8O0ᓄD30Ḅ*+ᓄvÄ。✌ᐜ_`o=Ḅ〜432⚗p(^ᕸ06'6,ᐹ#pó2»ÒḄ5ᓄ£^??r。w⚗p8¹o=0+ᦻ,ᑏ"ṹᡈὅ^9ÑÒcᑴ"ṹ。9:ᑏ"ṹx,ᙠûR◤⌕I⚗p}ឋ:#ú᛻n$rᐵ(,ᔲᑿ2S 42oooÎ3ὥv@1。JQ*zὅ4᧕µfḄE⚪。ᙠó2»ÒCD:#ú᛻(Ḅrᐵᑁ4,☢¦CD⚗p(。Vwᙠ"ṹÒᒹõ(13(19ᜮᦻ,KᜮᦻQÈ07"8301ô>Ḅl`}©,ᐹ#ḄRᙠrᐵḄÎ᝱@1?ᦻÒ。wØT^JÎ᝱@1?ÒÆᑮᡠᵨ:#1ôḄØR,◤⌕8¹I“d3d9.1ib”?ᦻḄAᵨ,ᐹ#>qó2»。3.4.1Ñ$᪀Óᯠ0ᓄ(^30Ø3£ᜧ,PQ8830ÑḄ$᪀3ᓫÜᨎ,᝞3.4ᡠ9。ᐸÒ_ê+úFSe+ún$,᝞W_êhᑡÒᨵ_ê◤⌕n$ᜐᳮ,ᑣᐜᜐᳮ_ê,ᯠxÙF;᝞WÔᨵ_êᜐᳮ,ᑣozSnᙢF,zᑮ⌨È0^Ì0Ñ。ᐸÒ_`ïô_ê+úᙠo»n$CD,☢*dᑖ᪆8"830*+ᓄ、F8O$k8^830Ñ}%ᑖᑁ4。3423ᵨQ}©3.40ᓄ830ÑḄ$᪀wᓄ"ṹṹ,✌ᐜ}©8Q,JQ}©ÌÃᙠᓫäḄUtilMaC^0.hᜮᦻÒ。ḄWᜧ%ᑖ9Ñ-BᵨᑮJQ。ᙠöyz{åû,Hdᑖ᪆JQḄØQᨵḄ。#ifndefV<#defineV(x){hr=x;>#endif#ifndefV_RETURN•#defineV_RETURN(X){hr=x;if(FAILED(hr)){returnhr;>>#endif#ifndefSAFE__DELETE#defineSAFE^DELETE{p){if(p){delete(p);(p)=NULL;>>#endif#ifndefSAFE__DELETE_ARRAY#defineSAFE__DELETE_ARRAY(p){if(p){delete[](P)?(P)=NULL;>#endif#ifndefSAFE_RELEASE#defineSAFE__RELEASE(p){if(p){(p)->Release();(p)*NULL;>>#endif3.4.3*+ᓄ07□(^30_`e¿ᑴḄïôx,ᙠᵨ0¹“30Fû,R◤⌕n$÷0^0rᐵḄ*+ᓄvÄ,ᓽ_`07^^30(ᜓI^,ᙠû☢Iûn$Uᐭᑖ᪆。9Ñ0…ᓄ0^EX8830*+ᓄvÄÊᑮ)}©Ḅ1'030()ᦪÒ,KᦪḄ[᦮"ṹ᝞,ᐸÒ¸ᦪ&”“Qïô¥P。HRESULTInitD3D(HWNDhWnd) 1□(^30ᐭ'ooo43HRESULThr?//_`ô1^€^30I^,KI^ᵨᩭ_`01^&30(ᜓI^g_pD3D=Direct3DCreate9(D3D_SDK_VERSION);if(g_pD3D==NULL)returnE_FAIL;//bx(ᜓឋØD3DCAPS9caps;g_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,&caps);//bÅ(ᜓQᔲ¿ᢝh⚔Aᜐᳮintvp=0;if(caps.DevCaps&D3DDEVCAPS_HWTRANSFORMANDLIGHT){vp=D3DCREATE_HARDWARE_VERTEXPROCESSING;>else{.vp=D3DCREATE_SOFTWARE_VERTEXPROCESSING;//l^aD3DPRESENT_PARAMETERS^^D3DPRESENT_PARAMETERSd3dpp;2eroMemory(&d3dpp,sizeof(d3dpp));d3dpp.Windowed=TRUEjd3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD?d3dpp.BackBufferFormat=D3DFMT_UNKNOWN;//_`01^'30(ᜓI^V_RETURN(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,vp,&d3dpp,&g_pd3dDevice));returnSOK;•»•3.4.4Fᙠ0^(^30ÑÒ23ᐜ2v-L8300^^91ôn$rᐵḄFG᝱(,ᯠxF。 ᡠᨵḄFvÄᙠ86§45061^()£^(180“4)åÿn$,9ÑCreateDeviceÒFḄ"ṹ᝞。VOIDRender(){//Üx'>?g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(45,50,170),1.0f,0);if(SUCCEEDED(gjpd3dDevice->BeginScene())){//ᙠx'Î?¿ᑴ//$kᙠx'>?F▁g_pd3dDevice->EndScene(); 44oooÎ3U//Xᙠx'Î?¿ᑴḄÊᑮû'>?µ9g_pd3dDevice->Present(NULL,NULL,NULL,NULL)?>1_7「68300677069::〇163「>107ᕸ130069^9::(^&[0>ḄÄᵨQÜo=ᡈi=⊤☢Ḅᑁ4。0^830ᙠ¿ᑴû,◤⌕ᵨK>Ðfô(viewport)Ḅ7⁐>?、U>?8OUr>?,K>Ḅ¯᝞。HRESULTIDirect3DDevice9::Clear(DWORDCount,constD3DRECT*pRect,DWORDFlags,D3DC0L0RColor,floatZ,DWORStencil);ᐸÒ:.•00¿Lᢣ}¸ᦪ?'8ᢣᔣḄᦪÒḄᦪ。᝞W?X^(w~h1ᑣK¸ᦪ(w0;᝞WpReCt(wᨵᦔḄᦪᢣ┐,ᑣK¸ᦪ(wÄò。•?8601:ᢣᔣ030&£(^$᪀ᦪḄᢣ┐。K$᪀ᦪᒹõ◤⌕ÜḄr。•þ1&98ᢣ}◤⌕ÜḄ>?,tSD3DCLEAR_TARGET、D3DCLEAR_ZBUFFER,D3DCLEAR_STENCILḄ÷Uᔠ,⊤9Ü7⁐>?、U>?、Ur>?ᡈᐸᔠ。•030(^^0^ᢣ}Ü7⁐>?x7⁐>?ÒZ=²IKḄ7⁐ò。•ᑍᢣ}ÜU>?xU>?ÒZ=²IKḄUò。•5L61^11ᢣ}ÜUr>?xUr>?ÒZ=²IKḄUrò。9Ñ0^160^1(^&ᵨK>,Ü7⁐>?U>?,VwÔᨵᵨUr>?Urst,ᡠ8S◤⌕ÜUr>?。Ur>?UrstḄᑁ4Xᙠó8»Òn$CD。9Ñ0ᢓ0〜^X᦮=fôḄ7⁐>?(w¬⁐ú,0ᓄ830Ò7⁐Ḅ⊤9>Xᙠ4.3⁚(8ᕸ〖30ÒḄ7⁐⊤9)*dCD。2.Ç69711306□[^306]6>ᙠ:+¿ᑴåû,;ᐜ&ᵨ10^83006?^9::868706û0>,28830(ᜓ:+¿ᑴ(-7F)。F[ᡂx,&ᵨ10^D300^^9:½^^6î()>20^830(ᜓ$kF。 J5=>ᡂIÈR,Sᐕ¡ÒᝅÊ┯。÷<8ᕸ〖30Fᦪ- ᙠ3Ó1^^^()£“506H()åÿÈR。ᙠ9Ñ0ᕸÈ^^Ò,Ôᨵ¿ᑴ÷<ᑁ4,Vû&ᵨ3Ó1^6û()>åx,ᓽ&ᵨ£“506H()>$kF。3.7「6(^300697069::ᡝ「656]1>0^^^30ᙠx'>?Òn$¿ᑴvÄ,ì¿ᑴ$kx,&ᵨ10^^300^7(^9::?^¹()>Xᙠx'>?Ò¿ᑴḄᑁ4Êᑮû'µ9,J᪵¿ᑴḄµ9ᙠef。?^8_>Ḅ¯᝞。HRESULTIDirect3DDevice9:;Present(CONSTRECT*pSourceRect, 01□(^30ᐭ'ooo45CONSTRECT*pDestRect,HWNDhDestWindowOverride,CONSTRGNDATA*pDirtyRegion)?ᐸÒ:•ᢓ0⇧06860LᢣᔣcᑴVḄrḄᢣ┐。•pDestRectᢣᔣcᑴp᪗ḄrḄᢣ┐。•¼063LÕ11^0〜(^6『3:1(16ᢣᔣ⌻Fᐿ᪗ïôḄ¥P。᝞W(wNULL,ᑣᵨD3DPRESENT_PARAMETERS$᪀ᡂᕒhDeviceWindowᢣᔣḄïôÄwp᪗ïn。•ᓹ01"7^9100ᢣᔣ◤⌕fHḄᨬÞfHrḄᢣ┐。ᙠWᜧiᦪêæ,pSourceRect、ᓹ068〖1^(^?0>^68700Øòw1^0^,⊤9fH>?Ḅᡠᨵr。᝞W_`DireCt3D(ᜓI^îᵨḄD3DPRESENT_PARAMETERS$᪀,ᐸJ^SD3DSWAPEFFECTW5MftFSD3DSWAPEFFECT_COPY,ᑣ¸ᦪô508。6X6(^、ᓹ065(X68ᓹ07">^^ᔧ70ᓹ(w>11^[。3.4.5$k07「6^30Ñᙠᵨ[0(^1I^Ḅ1ôx,&ᵨX£163^0>,0(^^I^ḄAᵨTᦪᘤï1。Vwᙠ*+ᓄ0^830î_`8830I^07830(ᜓI^,ᡠ8ᙠ⌨ÈÑû³ÃJ5=I^。0È^“6ÑXᡠᨵ³Ã01ᕸ130tVḄvÄÊᑮ(^30ᢓ()ᦪÒ,"ṹ᝞。VOIDCleanup(){SAFE_RELEASE(g_pd3dDevice);//^^Direct3D^t^SAFE_RELEASE(g_pD3D);//³Ã0ᓄ'30(ᜓI^>9:Vw0L(^30(ᜓI^Q2v0^^^30I^_`Ḅ,ᡠ8Kᐜ³Ã07830(ᜓI^,ᯠxÙ³Ã0^83〇I^。*3.5Direct3D9£9᡽/Ño1ᓄ0”5^3ᵨᐰHḄµ9ÉÎU`,ᓽ^0᝞^¥7Dµ9ÉÎÑU`(WindowsVistaDisplayDriverModel,ᑏw>¥00!^)。wᐙᑖᑭᵨ¥0ô1ḄHØ,,&ᢝRᨵ0^830KᵨÑḄr4,9:I0^8309n$᡽/,BPDirect3D9Ex。3.5.17^0"0ᓄ(^309¸᱄CDrIJ>^«1(^89?Ḅµ9ÉÎÑU`(WindowsXPDisplayDriverModel,ᑏwXPDM),WDDMo3@⌕Ḅᦋn。ᐸÒᨬ@⌕ḄᦋnQ”001ᐕ¡|=0?1vÄo᡻$,,ìᡠ◤⌕Ḅµ?ᦪÈᡠØ´ᑮḄµ?ᦪî,ᐕ¡µ?ᑁ4᦮⚓ᙢÃᑮ3öᑁ?Ò。^“(^87᪀`J〜^^(^89ᓄ&¾᪀å,,▬¹Ḅᱯᓹ1。WDDMJoᐰHḄµ9ÉÎÑU`,I᧜f⚣h^20ᐝ᪕ᓄvÄ001KᵨÑ⚞rᔣᵨ³}ØhḄ30ab,8OᨬÐᔣ¿ᢝfᜧឋØKᵨÑḄR"eÑᜐᳮᓫᐗ(GPU)Ḅ^L。 46oooÎ3UDirect3D9£ᙠ07^(^309ḄẠn$o᡽/,oHḄᱯ。ᵨDirect3D9£:#ḄѦØ$Jᑩ1^0”5%8138OᨬHḄ^“(^87å,,µ9hï¿ᢝ^009ḄÉÎÑ。Vw0L8309£?1SØᵨJ3^01¿ᢝḄ^1^0〜8jk,ᡠ8rI¡,᪗ZḄ0^^83091ôØT〉ᵨñfiḄ¥7“0~8jk。IJe8ᑭᵨ-"f⚣hḄឋØKᵨÑ,ᐰHḄ0^830108H13011¡i8(^309£ᡠSᐹᜓḄHØ。Vû,IJabᜧiᦪᐸ¦KᵨÑ,9:₞ᵨ8D1309、Direct3D10*Direct3DlU0ᓄ830ḄÚAQ,e8ᐙᑖᑭᵨḄ0^8309ḄÑ 。Direct3D9Ex*Direct3D9ᙠÑÔᨵ,¦◤⌕_`〉ᵨJ0&^309£Ḅ(ᜓI^ᓽe。oÞ⁚XCD᝞<_`07"^309£(ᜓI^。ᨵᐵ0©^【309£Ḅfi1ê,èxÚ^^〇>0:Ḅrᐵᑁ4。9:0^^1950〖Ôᨵw0ᓄ(^30989Ñ、ᜮᦻ8O?ᦻ。MSDN—WindowsSDK(8û7åwá'50〖)eᵨḄᦻ᫏、ᜮᦻ8O?ᦻ。3.5.207「6〇Ù09[᱄KLᓄDirect3D9£ᜎḄ*+ᓄ0^^309Ḅ*+ᓄpr,Qᵨ10^<^309©1<10893006hᓃ69£" 9m0((^309ÊᵨḄ10^309" <10^3006hᓃ69"。ᐸÊ,1019。1309£" no1019(^309" ,106(^3006?ᓃ69£" noIDirect3DDevice%gt4,ᵨ089(^30063169R()Àᦪ9m089(^30063169()Àᦪ,ç0ᓄ830᡽/I^。9:ô^8309£ᱯᨵḄ1ô、>8O$᪀,ᐸÈ7x☢-$ᨵxq“Ex”。▭0^8309£ᱯᨵḄ1ô、>8O1ô´。Direct3D9£*+ᓄḄp᝞:•_`8ᕸ130᡽/I^,;Ì188309£91ôᢣ┐,•bx(ᜓឋØ;•iᐙ030ᓹ1^5^^1^>X9£×£X5$᪀,•_`07830᡽/(ᜓI^,;Ì10^830069^9£1ôᢣ┐。9Ñ0ᕸ1606L69ᓃ^98ᕸ130Ḅ*+ᓄvÑ,ᐸÒ*+ᓄ8Ḅô9ÄḄ᪶"ṹ᝞。HRESULTInitD3D(HWNDhWnd){//_`01^<^30᡽/I^,KI^ᵨᩭ_`01^(^30᡽/(ᜓI^V_RETURN(Direct3DCreate9Ex(D3D_SDK_VERSION,&g_pD3DEx));//b᜸(ᜓឋØ,"ṹᶍ//l5SD3DPRESENT_PARAMETERS^^,"ṹᶍ//_`01^'30᡽/(ᜓI^V_RETURN(g_pD3DEx->CreateDeviceEx(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,vp,&d3dpp,NULL,&g_pd3dDeviceEx)); 01□030ᐭ'ooo47returnS_OK;.>W]:Vw10^^13006vᓄ69£1öD)108<^3006ᓃ69" ,ᡠ8IDirect3DDevice91Ḅïð10^。83006ᓄ69£" Vᐹᜓ。,e=10^3006^^9R" 5`£ᑴᓛøn1A3006^^9" =>,^-ᯠe8@ᵨRᨵḄ"309ṹ。3.6»@ACD8830ḄẠ ᭆù,8O᝞<*+ᓄ0^83ᓹ。071^^30Ạ NOḄ☢ÛO,ᭆùIJ0^^130*zὅ¡23Ûãᳮ,J5%ᑖQᜧiᦪ✌S1T8(^30ÑᕒḄ5=]Ý。ᱯQᨵᐵ8(^30Ḅᭆù,Jᭆùi, ᙠᐸ¦Ñ⚞r1TSᑮ,ᳮ®ᩭᨵo}ḄÞã。`Ú/ὅS⌕ញJÕᡂ,ᙠẠ ᭆùḄẠÙnᐭx☢Ḅz{。*+ᓄ01[D30ᓽ_`0^830(ᜓI^,JQᑏ8"ÈôÑḄóop,ᡠᨵḄµ9vÄ-Q2v88(ᜓI^[ᡂḄ。=᜜,IJᜧiᦪ*zὅ,3àᑮḄE⚪Q0^^^()$Ḅ9ÑÈ┯, 23áâᜧḄîÿ·ÔᨵÆᑮlVᡠᙠ。ᐸÑ"ṹHÔᨵ┯,E⚪ᙠJᘤḄ(Sì。ᐵJ᝞<(ᘤ,ᙠ»Ḅ9ÑÒ-n$*dÛ。a!1.ᵨ88᱄¤eÃᐹ,ÅÚ88᱄Ḅrᐵ1ê,᝞µ©ÉÎḄ0〇1᱐。2.ÅÚ0^^^(ᦻ᫏,៉030〔?9$᪀Ḅᔜ=ᡂᕒL。3.Úᦋᓚᖾô⑶ᓄ9Ñ,_`o=¸ὃ(ᜓI^。4.Úᦋ0^^&0^1(^9Ñ,_`ᵨᐰeµ9UbḄ(ᜓI^。 Î4U)1ᐔ<ᦻUᑴᙠ}CÑÒ,÷?@A>?¿ᑴᐗ。1ᩭCDBCᦻḄ¿ᑴ,VwwoÛ1ê,3◤⌕ᙠïôµ9oᓫḄᦻ。»ᨬxÒCD÷¿ᑴrᐵḄoᑁ4,ᒹFG᝱IJK。4.108□(^30ᙶ᪗ᙠÿ|<Ò,Wᜧiᦪêæᵨãᓱäᙶ᪗jw¸᯿jᩭ⊤9,⊤9BCîᵨBCãᓱäᙶ᪗j,⊤9}Cî◤⌕ᵨ}Cãᓱäᙶ᪗j。}Cãᓱäᙶ᪗j᪷£ᑍᙶ᪗årIñ9、vᙶ᪗å>ᔣḄS,eᑖw·ᙶ᪗j~ᙶ᪗j。8ÐḄ>Q:X~æᢣ、Òᢣ、NÈᢣÞçᢣ<Ḽ9åìᔣᑮ¥åìᔣèÃḄ>ᔣ¨,᝞WᜧçᢣᡠᢣḄ>ᔣᑍåìᔣr,Q~ᙶ᪗j,IåQ·ᙶ᪗j,᝞4.1ᡠ9。0ᓄ^130ÒᵨḄQ·ᙶ᪗j,Vwᙠÿ᪆|<Ò23ᵨ~ᙶ᪗j,Jᙠo}Ñ*zὅ$ᩭS¯。0L(^30ÑÒᨬ3ᵨḄᙶ᪗jḄᙶ᪗åþ᝞4.2ᡠ9,våᚖzᔣ。4.1·~ᙶ᪗j4.20ᓃE130Ò3ᵨḄᙶ᪗jþ4.201「6&30)1ᐗᐗ(primitives)Q8"830Ò}©Ḅ⊤9b。ô^830}©6*ᐗ。⊤4.1ᑡÈJ6*ᐗḄ5`IKḄõ©。ᐸÒÛ3ᵨḄᐗ5`Q}ᔠ}ᩩ$。}ᔠ(trianglelist)QojᑡäḄ},᝞4.3ᡠ9。8Ðe8éûrê,·e8Srê。o=}ᔠḄ⚔Aᦪ )1ᐗ<ᦻUᑴOOO49t´Q3,,8Ḅ⚔AÙᦪQ3Ḅ᦮ᦪë。⊤4.10□(^304_öᐗôõᐗ5`᪗¤______________Û_______________⚔AᔠD3DPT_POINTorÎäḄA+fᔠD3DPT_LINELISTorÎäḄ+f+fᩩ$D3DPT_LINESTRIPorÎë1Ḅ+f}ᔠD3DPT^TRIANGLELISTorÎäḄ}}ᩩ$D3DPT^TRIANGLESTRlPorÎë1Ḅ}}ᡧD3DPT_TRlANGLEFAN⊤9ᡂᡧḄo}}ᩩ$(trianglestrips)QojᑡrÎë1Ḅ},᝞4.4ᡠ9。VwJ}QrÎë1Ḅ,ᡠ8S◤⌕wZ=}ᢣ}8Ḅ3=⚔A。᝞,¦◤7=⚔AØÈ᝞4.4ᡠ9Ḅ}ᩩ$。v6(0^,0)(10^,0)(20,5,0)(-5-5,0)(5,-5,0)(15,-5,0)14.3:82,ᔠ14.4:82ᩩr0^^(^30ᵨ}ᩭ᪀ᡂᜧiᦪᐸ¦i¼,JQVw}Ḅ}=⚔A}Qᐳ☢Ḅ,FSᐳ☢Ḅ⚔Aᦔ᳛Ûi。2vᔠ}e8ᡂfí、fcᩖḄi¼yz(mesh)。4.5^9o=>#Ḅ᪀ᡂ。>#ḄZ=☢ᵫ5=}᪀ᡂ,ᡠᨵḄ}ᐳ᪀ᡂ᦮=>#ᐗ。ᵨ}Re8᪀ᡂ⊤☢Ú®ᩭQᐝ¸î☢Ḅ}Cᐗ,4.6^9᝞<ᵨ}᪀ᡂo=ᳫ#ᐗ。14.5ᵨ12:82⊤]sg14.6ᳫḄ:82·5y⊤]4.308□(^30ÊḄX⁐⊤]7⁐ᙠ8^830Òᓰ£Û@⌕Ḅᙢß,ᡠᨵḄvÄNàQᐝ᯿RQ[ᳮc,ᐸ$WᨬÐ-ð$ᑮ᝞<}Z=⚔Aᡈ²Ḅ7⁐。ᙠ0^^^30Ò7⁐Ḅ⊤9>ᨵi*,w¯Jxyz{ᳮ,ᙠû✌ᐜIᔜ*7⁐⊤9>ᵨêæn$ÒCD。 50oooÎ4U4.3.1ᵨ030〇01_0X}©7⁐0300010XQ0^È0ÒÛ3ᵨḄ⊤97⁐Ḅᦪ£5`,ᐸ}©᝞K。typedefDWORDD3DCOLOR;2v☢Ḅ}©e8ÚÈ,03003[0X▭Q0>^0X05`,ᓽo=32ßN¤«᦮ᦪ。J32ßZ8ßo,^·t~ᑖw4,óo⊤9n,óB⊤9ª⁐ᡂᑖ,ó}⊤9¬⁐ᡂᑖ,óZ⊤9«⁐ᡂᑖ。4ᦪᢥzÒ}ᐗ⁐(·7}⁐)lᳮᔠwo*7⁐。ZᦪḄÌòQ0〜255,Jᦪò23¬ᵨᓝnᑴ⊤9,᝞0〖【750000⊤9ª⁐,07-07-0⊤9«⁐,(^〖0000〖9¬⁐。ᵨ030€010X5`ḄL⊤97⁐,wᢣ}ᔜ7⁐ᑖ◤⌕ß。wû0LÌ0oQᵨJ[ᡂKÃÄ,᝞0300^^0X_X08Q,ᐸ}©᝞。#defineD3DC0L0R_ARGB(arrrg,b)((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)));^D3DCOLOR_ARGBffl^m®,ª⁐、¬⁐、«⁐ᑖnᡂo=0300010X5`Ḅ7⁐ò。ᐸÒ¸ᦪ3⊤9n,¸ᦪ[⊤9ª⁐ᑖ,¸ᦪ8⊤9«⁐ᑖñ,¸ᦪ©⊤9¬⁐ᑖ。5DḄQRᨵ0300010¦』08030(^[0&_9X08,8ÐḄ}©ᑖ᝞。#defineD3DCOLOR_RGBA(r,g,b,a)D3DCOLOR_ARGB(a,r,g,b>;#defineD3DCOLOR~XRGB(r,g,b>((D3DCOLOR)(((0xff<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)));◤⌕üUḄQ,Qô300^(^00^^ÒSᒹõ3,ᓽSᢣ}n,ÒA[ᐰSn。9:Vw0300310XWQ0>^0¦0,ᡠ8ᨵî·z1ᵨ0〜0X05`ḄL⊤]X⁐。4.3.2ᵨ03000[0?^0^}©7⁐·e8ᵨ0300^0&90^$᪀}©7⁐,J*7⁐5`iᵨJᢣ}óᐝᩞWḄ7⁐,K$᪀Ḅ}©᝞。typedefstruct_D3DCOLORVALUE{floatr;floatg;floatb;floata;}D3DCOLORVALUE;$᪀#ÒḄᔜ=ᡂᕒ-QôA`,ᐸÌòQ0.0〜1.0,ìᐰ-Ì0.0îw|⁐。ᐸÒ,『⊤9ª⁐ᡂᑖ,È⊤9«⁐ᡂᑖ,5⊤9¬⁐ᡂᑖ,3⊤9$&3ᡂᑖ,ᓽn。◤⌕üUḄQ,$᪀#ᡂᕒ·e8Ì0〜1å᜜Ḅò,8onoᱯPᦔW。ÌòᜧJ1îḄᦔWQ£ᐝ,|Ëõᣵo=;Ìòw_ᦪîon÷ᐝ,^Òøᣵóᐝo᪵。4.3.3ᵨ030᱄〇0[0¦}©7⁐ᙠ07^。〖30Ò,Re8ᵨ$᪀030€010X"/030€010¦9ᓃ1£}©7⁐。03090010X$᪀030€01^^^10£$᪀Ḅᦪ£ᡂᕒr,Sv03090010XR )1ᐗ<ᦻUᑴOOO51o᪀⌼ᦪ¤@ᦪ,>¯7⁐Ḅ。Vw03090:010X$᪀030[01^^90^$᪀Ḅᦪ£ᡂᕒr,ᡠ85ὅe8rÎÃᣚ。030᱄0^0X$᪀Ḅᐹ#}©ᙠûSÙᑡÈ,e8Å▅ᦻ᫏。Û:030〇0[0<0300^0C1^^᪀Vᨵ4t@=>Ḅᡂᕒ。ᡠ:=X⁐⊤]n40ᔣ,un(r,g,b,a)aX⁐ᔣḄឋAB?(vertexbuffer)Q0^(^30ᵨᩭ&?⚔Aᦪ£Ḅ>?,_IDirectVertexBuffer^^P⊤9。⚔A>?e8&?÷<5`Ḅ⚔Aᦪ£,,e8IᐸÒḄ⚔Aᦪ£n$ᙶ᪗Lᣚ、ᐝ᯿ᜐᳮ、úû¶vÄ。☢$ᔠ9Ñ9^1^8^〖^Û᝞<ᵨ⚔A>?¿ᑴ。ᙠᐹ#CD᝞<ᵨ⚔A>?¿ᑴåû,ᐜCDo÷⚔A>?ᑗrᐵḄ⚔Azb8OtVᑁ?ü5`¶ᑁ4。4.4.1⚔A$᪀⚔Azb᪷£µ9Ḅ◤⌕,⚔Aý8ᒹõßᙶ᪗、7⁐、+、[ᳮᙶ᪗¶}ឋ。ᙠÑÒ¼3ᵨo=$᪀L⊤9⚔A。᝞☢Qo=⚔A$᪀Ḅ}©。structCUSTOMVERTEX{D3DXVECTOR3position;"⚔AßD3DXVECTOR3normal;//⚔A+>☢Ḅ⚔A$᪀⊤9Ḅ⚔Aᒹõ5=ᐗ²:⚔Aß⚔A+。⚔A$᪀QÑ:#ᕒ}©ḄᵨJ⊤9⚔AḄᦪ£5`,ᡠ8:#ᕒ)ᯠ⍝)Å}©Ḅ⚔Aᒹõᐗ²。ww07^(^30FAw·⍝⚔Aᒹõᐗ²,◤⌕ᵨᮣR⚔Azb。IJ☢Ḅ⚔A$᪀,e8ᵨ8⚔Azbn$óF。#defineD3DFVF_CUST0MVERTEX(D3DFVF_XYZ|D3DFVF_N0RMAL)ᮣR⚔AzbQ⊤9⚔Aᐗ²3᪗¤Ḅᔠ,ᵨᩭóFᙠ⚔A>?ÒḄ⚔Aᒹõᐗ²,10^^1300^7^91ôḄF>ØT1ᦈJ⚔Aᐗ²᪗¤Ḅᔠ,,ᵨ8Ðᩭ.}᝞Ḅ⚔@ᙶ᪗5/bḄᩗuº»D3DFVF_XYZW⊤]Eᙶ᪗{ᣚ<Ḅ⚔@ᙶ᪗,ðᵨw:⚔@~D3DFVF_TEX0~D3DFVF_TEX8⊤]⚔@ᒹᝅᳮᙶ᪗:030?9?_^v2030?9ᓹ_9v2X〜QrÎ᣸þḄ,ûὅóFḄQèᙶ᪗LᣚḄ⚔Aᙶ᪗,xὅóFḄQvᙶ᪗LᣚḄ⚔Aᙶ᪗。4.4.2ᑁᙠ0ᦝ〖30,◤⌕ᵨᑮ ¡,¢᝞⚔"¥¦§ ¡,¨ᵨḄ ¡©ᨵ«¬¥、®ᳮ°。 ¡²³´ᑁ,µ³Ḅឋ·¸ṹºᑏ¼ᨵ½⌕Ḅ¾¿。0&^30Àᵨ030?00[ÁÂ⊤Äᔜᑁ,⊤4.3ᑡÇÈᔜÁ¨+Ḅ᪗ÊËÌᐸÎÏ。⊤4.3030ᓹ00ᓃÁÂ᪗,î______________________________×___________________________________/D3DPOOL..DEFAULT⚔@Z[ðLL[ÊD3DPOOL.■MANAGEDᵫ^ᔯ=ÿ0⚔@Z[ᑁ[=>Lw[[ᡈᑁ[Ê>D3DPOOL_■SYSTEMMEM⚔@Z[Lwᑁ[ÊD3DPOOL.SCRATCH⚔@Z[LwDᑁ[Ê,=>Ḅ⚔@Z[5ð"ᵨwMNm,ðzᑁ[b┝、FᑴPmÒH ¡Ó,᝞ÔÀᵨ030?00^0£?Õ1^Öᑁ,ᑣ0ᓄØ30Ù¨ÚÛ ¡ÜᑮÝᡈÕ0?ᑁ,ØßᑮàáḄឋ·。ᙠ0^(^302ᜓãᜫÓ,åæçèÀᵨ030?00é_0ê?ë1^ÒHḄ ¡,(ìᙠឮî2ᜓï◤⌕½ðÒHñò ¡^ÀᵨD3DPOOL_MANAGED᪗ÊËÒHḄ ¡ó.ᡲõ ¡。µ³ᡲõ ¡,Direct3DÚö÷ᙠøùᑁúûᜓü,ý2ᜓãᜫÓ,Ø^(^30Ûö÷çèñ ¡;ឮî2ᜓÓÿ◤⌕½ðÒH,Direct3Dö÷øùᑁឮîñò ¡。µò2ᜓ¨Ḅ ¡,Ù¨Àᵨ030?0(^_55Ö£^^1ᑁ᪗ÊËÒH。ñò ¡Û¨øùᑁ,ᡠØᙠ2ᜓãᜫ,ñ ¡Úãᜫ,ឮî2ᜓÓÿ◤⌕½ðÒH。Ä:`Úᵨ030?00_>^^0£0_`tV,J᪵îe8´ᑮÛḄឋØ,·S◤⌕Dÿ¶ᳮtVḄcᩖÃÄ。4.4.3ÒH⚔"¥ᙠÒH⚔"¥ï,◤⌕ᐜ*Ï⊤Ä⚔"Ḅ᪀、⚔"ḄFVFÜ⚔"ᦪEḄ᪀ᦪ,ᙠÄ¢^*1^8〖Ḅᐵ¸ṹ᝞。//äJ⚔@᪀<ᮣ⚔@56structCUSTOMVERTEX )1ᐗ<ᦻUᑴOOO53{FLOATx#y,z,rhw;DWORDcolor;>;#defineD3DFVF_CUST0MVERTEX(D3DFVF_XYZRHW|D3DFVF_DIFFUSE)//a[⚔@ᦪ¸Ḅ᪀ᦪñCUSTOMVERTEXvertices[]={{50.0f,250.0f,0.5f,1.0f,0xffff0000,},//⁐{150.0f,50.0f,0.5f,1.0f,0xff00ff00,),//⁐{250.0f,250.0f,0.5f,1.0f,0xff0000ff,>,//⁐96È(^8[]Q&?}⚔AḄᦪ,Z=⚔Aᒹõvᙶ᪗LᣚḄ⚔Aᙶ᪗U,y,z,rhw)7⁐0010%(x,y,z,rhw)Q}⚔Aᙠᢗ/ÿÒḄᙶ᪗ò,ᑖIKᙠᜎ〜åḄᙶ᪗ßᢗ/ìjᦪ…。9:IJ*zὅ,ᮣR⚔AzbQo=ÛãᳮḄᭆù,/ὅe8Éὃow⌕ᵨþ9ᓹ。VwÑ:#ᕒ)Å}©⚔A$᪀&?⚔Aᦪ£,PQ07830jk,S⍝ÑᕒᵨḄ⚔AQzb,ᡈὅÛ⚔Aᒹõᦪ£,þ9?ḄÄᵨQÙ0ᓄ^30jkJᵨḄ⚔Aᐹ#ᒹõᦪ£。e8ᵨ10L8300^(^91ôḄ06961^^3£4)>_`⚔A>?,K>Ḅ¯᝞。HRESULTIDirect3DDevice9::CreateVertexBuffer(UINTLength,DWORDUsage,DWORDFVF,D3DPOOLPool,IDirectVertexBuffer9**ppVertexBuffer,HANDLEpHandle);ᐸÒ:•B61^L&ᢣ}⚔A>?ḄᜧÞ,8/⁚wᓫß。•1;3£6ᢣ9᝞<ᵨ>?Ḅo▬¹}ឋ,e(w0ᡈ⊤4.4ÒòḄᔠ(Ïᡈ)。•?9『ᢣ}⚔AḄᮣR⚔Azb。•?001ᢣ}⚔A>?Ḅᑁ?ü5`,q⊤4.3。•??96"698'£6『ᵨJ]%_`Ḅ⚔A>?。•ᓹû'“&ᶇ¸ᦪ,e(wNULL。⊤4.4jᵨḄ⚔@Z[ឋ᪗,î_______________________________×_______________________________D3DUSAGE_DYNMIC⚔@Z[ᵨ=᝱ᑁ[(AGPMemory)D3DUSAGE_POINTSᵨ⚔@Z[Uᑴ@1ᐗD3DUSAGE_SOFTWAREPROCESSINGA['ឋD,⊤]ᵨÇhz⚔@B,ᔲᑣᵨ*hz⚔@BD3DUSAGE_WRlTEONLYᑏឋ,5ðzm,[÷'ឋ:Woឋð 54oooÎ4UW]:çZ[D᝞®zᨵᵨD3DUSAGE_DYNMIC᪗u,ᑣᡠçḄZ[n☟᝱Z[(staticbuffer);᝞®ᵨ ᪗uD3DUSAGE_DYNMIC,ᑿᡠçḄZ[n=᝱Z[(dynamicbuffer)。vw5◤⌕Ejᦋᡈ«Ḅᦪ¸,çèᵨ᝱^[[,x᝞®◤⌕⚣¡Õ^[ÊḄᑁ,ᑿb=Z[[÷n=᝱Ḅ。107ᕸ130069ᓃ69::<^ᕸ〖6〃6ᖾ8¦61^)>_`o=07"(^30⚔A>?I^,,]%rKḄ⚔A>?1ôᢣ┐。┐I⚔A>?Ḅᔜ*vÄ,e82v]%Ḅ⚔A>?1ôᢣ┐[ᡂ。ᙠ9ÑVertexBufferÒ_`⚔A>?Ḅ"ṹ᝞。LPDIRECT3DVERTEXBUFFER9g_pVB=NULL;//⚔A>?1ôᢣ┐V_RETURN(g_pd3dDevice->CreateVertexBuffer(3*sizeof(CUSTOMVERTEX),0,D3DFVF_CUSTOMVERTEXfD3DPOOL_MANAGED,&g_pVB,NULL));Rᙠ,_`⚔A>?,1ᩭ◤⌕⚔Aᦪ¥ª^(^51]Ò&?Ḅ⚔Aᦪ£cᑴᑮ⚔A>?Ò,"ṹ᝞。VOID*pVertices;V_RETURN(g_pVB->Lock(0,sizeof(vertices},(void**)&pVertices,0));memcpy(pVertices,vertices,sizeof(vertices));g_pVB->Unlock();10^830%ᖾ8ᢕ89:§04()>20^830I⚔A>?n$¹┝,,]%⚔A>?Ḅᑁ?ᢣ┐,8¯Iᑁ?n$vÄ。vÄ[ᡂx,10^^3096«686『9::'1(^()>28[᝘30vÄ$k,◀Iᑁ?Ḅ┝}。10718^30%"88ᦈ6´§(^0>Ḅ¯᝞。IDirect3DVertexBuffer9::Lock(UINTOffToLock,UINTSizeToLock,VOID**ppbData,WORDFlags)?ᐸÒ:•0££10100}¹┝ᑁ?®+ᙢᙬ。•5½2610=009ᢣ}¹┝ᑁ?ᜧÞ。•9ᓹ&03L3ᵨJ]%ᑁ?ᢣ┐ᙢᙬ<>•?1Ç93⊤9⚔A>?Ḅ¹┝}ឋ,eÌÒAò0,ᐸ¦᪗µèÅÚᦻ᫏。4.4.4F⚔A>?9Ñ%^68&〖^ÒF%ᑖḄ"ṹ᝞。g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX)?g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST,0,1);☢Ḅ"ṹᵨᑮâ3=107"013006、4691ô>:SetStreamSource()、SetFVF(HnDrawPrimitive()o5^5»^11^^^^()>X⚔A>?Fᦪ£Or@1,K>Ḅ¯᝞。HRESULTlDirect3DDevice9::SetStreamSource(UINT•StreamNumber,IDirect3DVertexBuffer9*pStreamData,UINTOffsetInBytes, )1ᐗ<ᦻUᑴooo55UINTStride)ᐸÒ:.•51^631^1^0>63:⊤9÷⚔A>?@1Ḅ^Fᦪ£OḄ,8Qo=ᜧJ¶J0Ḅ᦮ᦪ。•Ḅ。Ḅ1^&L3⊤9÷Fᦪ£Or@1Ḅ⚔A>?ᙢᙬ。•0£7%«1^7^3⊤9Fᦪ£OÒᨵᦔḄ⚔Aᦪ£Ḅ®+ᙢᙬ,8Ü⁚ᦪ⊤9。•31^10^⊤9Fᦪ£OÒ5=rê⚔AḄᙢᙬrªḄÜ⁚ᦪ,23K¶J⚔Aᙠᑁ?ÒᡠᓰᵨḄÜ⁚ᦪ。5v?9⛱)>ḄÄᵨQ¯ìûFᦪ£OÒḄ⚔AḄzb,K>Ḅ¯᝞。HRESULTXDirect3DDevice9::SetFVF(WORDFVF);ᐸÒ¸ᦪ?9?⊤9Fᦪ£OÒḄᮣR⚔Azb,23êæ,K¸ᦪKK÷8r@1Ḅ⚔A>?ḄᮣR⚔Azbr。0^〜?^0^©Ḅ>ᵨJ¿ᑴìûFᦪ£OÒḄᐗ,K>Ḅ¯᝞。HRESULTIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPEPrimitiveType,UINTStartVertex,UINTPrimitiveCount)?ᐸÒ:•?[11L1767ô6⊤9X⌕¿ᑴḄᐗḄ5`。•5L81^9669⊤9^⚔A>?Ḅó|=⚔A:+¿ᑴᐗ。•?3^:1L^600¿L⊤9X⌕¿ᑴḄᐗḄᦪp。ᨬxᙠÑ⌨ÈîS⌕uµ³Ã_`Ḅ⚔A>?I^。9ÑVertexBuffe^2v}=⚔A¿ᑴo=},$ᦔW᝞14.7]^M%98ᓄ&1Aᦔ®4.7ᡠ9。W]:SDirect3D*,:82☢ᱏᨵ£☢<☢#ᑖ,᝞®ᢣä:82⚔@Ḅ¤M¤D┐ᑣn£☢,ᔲᑣnm☢。¥Z¦§,08A(^30MN£☢:82,ᡠᙠn:82ᢣä⚔@¤Mᡈ]¤MDä⌕Tá。4.5ᵨ]Z[Uᑴ12ì¿ᑴo=ÛcᩖḄî,◤⌕ᵨ¡irÎê1Ḅ},᝞¿ᑴ᝞4.8ᡠ9Ḅ¼,ᵨ8=}。᝞WwZ=}Zᜓ3=⚔Aᦪ£,µᯠᨵ¡iᦪ£Q@cḄ,J᪵BâᜧḄᑁ?ÿjk$O。w.JoE⚪,e8ᐜ_`o=⚔A>?,XS@cḄ⚔Aᦪ£ᑏᐭ⚔A>?Ò,ᯠx_`o=⚔A@A>?,?Ãᔜ=}Ḅ⚔A@A1ê,ᨬx2v⚔A@A⚔Aᦪ£ᐳ[ᡂ¿ᑴ。ᙠ07830Ò,o=⚔AḄ@A¦◤⌕ᵨo=16ßᡈ32ßḄ᦮ᦪ⊤9。ᑄû,ìi¼ 56oooÎ4UḄ⚔AᨵÛi@cî,ᵨ@A>?23ØTz1¿ᑴ⚔Aᑡ⁚ḕo%ᑖᑁ?ÿjk$O。îäIr⚔An$@cT,^e8ÑḄ᦮#ឋØ。9Ñ10(^8^1^^9᝞<ᑭᵨ@A>?¿ᑴ4.8ᡠ9Ḅ¼。K9ÑᵨḄ⚔A$᪀⚔Azb÷^&“^〖^9Ñr。4.5.1_`⚔A>?@A>?ᵨ@A>?¿ᑴ,✌ᐜ◤⌕_`⚔A>?⚔A>?。9Ñ1^368“£6[_`⚔A>?@A>?Ḅ"ṹ᝞。HRESULTInitVBAndIB()14.8ᵨC:82UᑴCj2{//⚔Aᦪ£CUSTOMVERTEXg_Vertices[9J;g_Vertices[0J.x=300;g_Vertices[0].y=250;g_Vertices[0].z=0.5f;g_Vertices[0]•rhw=1.0f;g_Vertices[0].color=0xffff0000;for(inti=0;i<8;i++){g_Vertices[i+l].x=(float)(200*sin(i*3.14159/4.0))+300;g_Vertices[i+l].y=-(float)(200*cos(i*3.14159/4.0))+250g_Vertices[i+1].z=0.5f;g_Vertices[i+1].rhw«1.0f;g_Vertices[i+1].color=0xff00ff00;>//ùúᦪ¡WOHDg_Indices[]-{//ç⚔@Z[V_RETURN(g_pd3dDevice->CreateVertexBuffer(9*sizeof(CUSTOMVERTEX},0,D3DFVF_CUSTOMVERTEX,D3DPOOL_MANAGEDf&g_pVB,NULL));//k©⚔@[VOID*pVertices;V_RETURN(g_pVB->Lock(0,sizeof(g_Vertices),(void**)&pVertices,0))memcpy(pVertices,g_Vertices,sizeof(g_Vertices));g_pVB->Unlock();//ª]«[V_RETURN(g_pd3dDevice->CreateIndexBuffer(24*sizeof(WORD),0,D3DFMT_INDEX16,D3DPOOL_MANAGED,&g_pIB,NULL))?//kᐙ]Z[VOID*pIndices;V_RETURN(g_pIB->Lock(0,sizeof(g_Indices),(void**)&pIndices,0)); )1ᐗ<ᦻUᑴooo57memcpy(pIndices,g_Indices,sizeof(g_Indices));g_piB->Unlock();returnS_OK;}ᙠ☢Ḅ"ṹfÒ,ᵨ11>ᓄ(^3001^&9::0631·(108610>_`ᡠ◤⌕Ḅ@A>?,K>107"83£^^(^9:6¥ᕸ88ᢕó0>5D,ᙠûSÙ*d³。☢Ḅ"ṹᙠᡂ_`@A>?åx,X@Aᦪ£cᑴᑮ@A>?Ò,ᐹ#vÑ>÷cᑴ⚔Aᦪ£5D。4.5.2ᵨ@A>?¿ᑴ9Ñ11^68ᓄ〖^¿ᑴḄ"ṹ᝞。g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX);g_pd3dDevice->SetIndices(g_pIB);"(@1>?g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,9,0,8);10ᓄ83006〃ᓄ69::5£D¿65()>ᵨJ(@A>?,K>Ḅ¯᝞。HRESULTSetIndices(IDirect3DIndexBuffer9*pIndexData);ᐸÒ¸ᦪ?181Ê03^ᢣᔣX⌕(Ḅ@A>?。IDirect3DDevice9::DrawIndexPrimitive(>¨ᵨA$[÷Ḅ]Z[Uᑴ,K>Ḅ¯᝞。HRESULTIDirect3DDevice9:sDrawIndexPrimitive(D3DPRIMITIVETYPEType,INTBaseVertexIndex,UINTMinlndex,UINTNumVertex,UINTStartlndex,UINTPrimitiveCount);ᐸÒ:•1171^⊤9X⌕¿ᑴḄᐗ5`。•BaseVertexIndexS^^-^^^lJḄ@A>?Ḅ®+ᙢᙬ。•MinIndex⊤9@AᦪÒᨬÞḄ@Aò。•ô_^1^6᱄⊤9X⌕¿ᑴḄ@AᦪÒḄ⚔Aᦪp。•3L31^11^69⊤9^@AÒḄó|=ᐗ²:+¿ᑴᐗ。•?¬1æ1^^600ᢕ(⊤]=⌕UᑴḄᐗᦪp。9Ñ10(168'&[$ᦔW᝞4.9ᡠ9。4.99Ñ10᝞86!^$ᦔW 58oooÎ4U4.6_;ᦻUᑴw;´ìûÑ$Ḅrᐵ1ê,ii◤⌕ᙠïôµ9Ûᦻ,10309?0¹᡽/1ôIû>¯Ḅ.>。⁚$ᔠ9Ñ×D20,CD᝞<ᵨ1030?0P1ô¿ᑴᦻ,9Ñ1^120ᙠïô·x9ìûÑḄ¤᳛,ᓽZFḄᦪ(FramesRenderedPerSecond,FPS)。4.6.1_`30᱄「0^I^ᵨ1ô10309?0P¿ᑴᦻ,✌ᐜ◤⌕2v030^^16?0Ã()ᦪ_`1030᱄?0¹1ôI^。10309?0P1ôÊ21^0*5Ü#0^830(ᜓᢣ┐,KᦪḄ¯᝞。HRESULTD3DXCreateFont(LPDIRECT3DDEVICE9pDevice,INTHeight,UINTWidth,UINTWeight,UINTMipLevels,BOOLItalic,DWORDCharSet,DWORDOutputPrecision,DWORDQuality,DWORDPitchAndFamily,LPCTSTRpFacename,LPD3DXFONT*ppFont);ᐸÒ:•?069ᓄ6⊤9o=ᨵᦔḄ07830(ᜓᢣ┐。•19ᓃ⊤9_`Ü#ḄÏ,᝞WÛ1§^=0,ᑣᵨÒA。•½&©⊤9_`Ü#ḄáᙳÏO,᝞W^᝛=0,ᑣᵨÒAO。•WeightMipLevels⊤9Ü#Ḅᩗòva}ឋ,o[ÌÒAò0。•1L31ᓄ⊤9Ü#Qᔲwa#,¶J7&0£îwa#。•(^361:⊤9_`Ü#ᡠ}Ḅܤᔠ,᝞W(w0£?ὣ^_0^1&5£1ᑣᦪX)ÎcÆ÷ᢣ}Ü#r¤Ḅܤᔠ。•0Íû?¿&81᝞ᢣ}ܤḄÒÈÖ,23êæXKò(w007o0£?110^(^。•0¿1&7ᢣ}ܤḄÒÈW,23êæXKò(wDEFAULToQUAUTY。•?1L'0û3^17ᢣ}Ü#§Ḅ@A。•?306᝞^^ᢣᔣ⊤Ä"#óḄ"Ë$。•9?þ01^ᵨJ]%_`Ḅ10309?081ô。ᙠ9Ñ×6120Ò,ᵨ^131Ü#_`o=1030?0ᡷ1ôI^,"ṹ᝞。LPD3DXFONTg_pFont=0?if(FAILED(D3DXCreateFont(g_pd3dDevice,0,0,0,0,0,0,0,0,0,L"Arial",&g_pFont)))returnE_FAIL;9:wᵨ10309?0¹1ô,◤⌕ᒹõ434᝞0"ᜮᦻ,,◤⌕w⚗p8¹(13(^9.1ᓄ?ᦻ。 )1ᐗ<ᦻUᑴOCK>594.6.2ᵨ309「0^1ô¿ᑴBCᦻ;Ìᑮ10309?0DḄ1ôåx,e8ᵨᐸ>0[^1^1()ᙠᢣ}ß¿ᑴBCᦻ。K>¿ᢝANSIzÜ⁚ܤT,ᐸ¯᝞。ID3DXFont::DrawText(LPD3DXSPRITEpSpriteLPCSTRpString,INTCount,LPRECTpRect,DWORDFormat,D3DCOLORColorᐸÒ:•?3?ᓃL6ܤTᡠ}Ḅ103095?1᝞I^1ô,ÒAò0,⊤9ᙠìûïô¿ᑴܤT。•ᓹ511^1^X⌕¿ᑴḄᦻ。•(^^'ᢣ}ܤḄ=ᦪ,᝞W¶J-l,ᑣ)οᑴᑮܤT$kwÑ。•pRect¿ᑴᦻḄr。•?〇ᑍ^:ᦻᙠ?'8ᢣ}ḄrÒḄ᤮Ã}ឋ,Û3ᵨḄ}ឋ᝞⊤4.5ᡠ9,e82vß”ᡈ"(I)ὶᔠᵨJ}ឋ。•0102:ᦻµ9Ḅ7⁐。⊤4.5jᵨÂî®᤮ÿឋܤT᤮Ãឋ___________________________________________________Û____________________________________DT_BOTTOMܤTß?&^1Ḅ%,K}ឋ¦Ø÷01^«^1^^£ᐳ?DT_CALCRECT᪷£ᦻḄ«fᦋ?&68ᢣ}ḄrḄᜧÞDT_CENTERᦻßJpRectḄàáÒDT_LEFTᦻᔣ?&6<^Ḅ·¼I#DT_NOCLIPSIᦻn$úûDT_RIGHTᦻᔣôX68Ḅ~¼I#DT_SINGLELINEXᦻᢥ᯿ᵯ$µ9,µᶍᣚ$᪗µDT_TOPᦻßJpRectḄ⚔%DT_VCENTERᦻßJ?¦6^ḄᚖzÒW]:<ᐸóᡠᨵ1ᐗUᑴ¨/w,1030?0“::0^〜L6J1()¨%&ᙠ10(3006h^^9::86ᔜA506R()<10^3006h^^9::"0(15。6R0#1ÿᵨ。9Ñ×8120Ò¿ᑴᦻḄ"ṹ᝞。intcharCount=swprintf(g_strFPS,100,L"FPS:%0.2f",GetFPS());g__pFont->DrawText(NULL,g_strFPS,charCount,&g_ClientRect,DT_TOP|DT_LEFT,Oxffffffff);ᙠ☢Ḅ"ṹÒ,.0^1??3()Q)}©ḄᵨJT¤᳛Ḅᦪ,qoÞ⁚,goClientRectQìûïôḄ(ᡝ。W]:᝞®xyUᑴeᦻ,:ᙠÂî®Ê◤⌕ᣚḄL÷òbᣚî“V”。 60oooÎ4U4.6.3¤᳛Tᙠ9Ñ×^〖20Ò,wZᜓX⌕µ9Ḅᦻ,✌ᐜ◤⌕T¤᳛。ᐹ#>Q,ᙠFZoî,TᦪᘤL¹1,᝞WᔊḄîÿv7,ᑣ᪷£TᦪᘤLᔊḄîÿT¤᳛,ᐸR"ṹ᝞。floatGetFPS()returnfps?>9:Bcd᳛Dᵨᑮ180^0€æ11^0Àᦪ,'Àᦪᑩ032C?1Àᦪ,±z=#`EᔊḄD1,ᓫLn³´,n ᵨ'Àᦪ,◤⌕n⚗µòbA0^^1Àᦻh。9Ñ1^120$ᦔW᝞4.10ᡠ9。Û:cd᳛:¯Dm᧜MḄAd0,ᡠᙠ`éḄ]^MÊVµ[]MḄcd᳛。R᜜,n ð¶Õã·ᙢmbMḄAd0,ᙠç0ᓄ。13£>[ᜓD=030?£5¸1^_ᓹCC^L£8᪀Ḅ?986᝞3^(^1᝞6^31ᡂᕒ[÷nD3DPRESENT_INTERVAL—IMMEDIATE.9:n ð¶ᜐᳮFᩖḄÂg<56,ID3DXFonO^oᙠᑁ¹ᵨ〇01Uᑴᦻ,ᡠᙠឋ▁4.109Ñ×^120$ᦔWðàᶍᨵ»ᜫ。᝞®UᑴḄᦻᦪA¼e,ᑣµ×[½MḄAឋð。4.7MNf᝱FG᝱ᑴ8^(^31)(ᜓḄᐝ᪕ᓄ$w。2vᦋLFG᝱,e8ᑴᵨ<*Ḽ⁐Ub,᝞(FG᝱。Pp5`030X£¿£X5×v?£71pÈᡠᨵeØḄFG᝱。KᵨÑX030Í£X5×£v?£5`Ḅ)o=PpòÄwóo=¸ᦪ⌴5v&ᓺ(16613()>,ᯠxᵨóB= )1ᐗ<ᦻUᑴOOO61¸ᦪᢣ}rKḄFG᝱。Û:ᙠ089(^30MÊ◤⌕[÷Ḅ[ᜓMNf᝱¾e,ᙠUu@Ḽ⁐i6SetRenderState(D3DRS_SHADEM0DE,D3DSHADE_FLAT);//[÷ᡀʺḼ⁐Í6g_pd3dDevice->SetRenderState(D3DRS_SHADEM0DE,D3DSHADE_G0URAUD);4.7.2i¼iᐙUbÒAG᝱,0^6^30BFḄi¼☢Ḅ¿ᑴÈᩭ,J*>b〉ᔠJWᜧiᦪêæ。ᯠ ,ᨵîw&tÑᡈᐸ¦ᱯPpḄ,eئ◤⌕¿ᑴÈi¼Ḅ⚔Aᡈ¼。Je82v(FG᝱0305^_?^[^^00£ᩭR,2vwD3DRSoFILLMODEFG᝱ᢣ}Pp5`D3DFILLMODEÒḄo=ᦪò,⌱ài¼iᐙUb。ᐳᨵ}*iᐙUb,᝞ᡠ9。 62oooÎ4U•D3DFILL_POINT:AUb,¦wi¼ḄZ=⚔A¿ᑴo=²。•D3DFILL_WIREFRAME:+Ub,¦wi¼ḄZᩩ¼¿ᑴoᩩ+。•D3DFILL_S0LID:☢Ub,QÒAiᐙUb,Ii¼Ḅ☢n$iᐙ。☢Ḅ"ṹXi¼ḄiᐙUb(w+Ub。g_pd3dDevice->SetRenderState(D3DRS_FILLM0DE,D3DFILL_WIREFRAME);Û:8"030¡iFG᝱ᵨᩭᑴ¿ᑴḄᔜ=>☢,FG᝱▭Qô1830wÑᕒḄᑴ¿ᑴ>bḄo1ô。IJÑᕒ¡,ᐵÏQᳮᔜ*FG᝱ḄÄᵨ᝞<(ាìḄFG᝱。*4.812mno²ᙠ7⁐>?ᡈefÒ8o=BCᙶ᪗U,y)⊤9ìûß。᝞W▭TḄ²òQôAᦪ,ᑣXÌÃᣚw᦮ᦪᙶ᪗n$µ9,J*ᐝ᪕ᓄᜐᳮ>eØBÈRJK᜜e。zÒ,7J*ᵫJ¬᪵⚣᳛S⌼ᡂḄᜫiwJKUlisasing),8^830¬ᵨIJK(2vi@¬᪵)ᩭᦋᗐḄJKᦔW,½¹¼Ḅá¸。4.8.1ÅD(ᜓQᔲ¿ᢝi@¬᪵_`ᵨi@¬᪵Ḅ(ᜓåû,◤⌕ᵨ10L830::0^^^&^1!3£^7?Ḅ>bÅìû(ᜓQᔲ¿ᢝi@¬᪵,K>Ḅ¯᝞。HRESULTCheckDeviceMultiSampleType(UINTAdaper,D3DDEVTYPEDeviceType,D3DF0RMATSurfaceFormat,BOOLWindowed,D3DMULTISAMPLE—TYPEMultiSampleType,DWOR*pQualityLevels)?ᐸÒ¸ᦪ^1L1331^1^^6⊤9◤⌕ÅDḄi@¬᪵>。e8XK¸ᦪ(wD3DMULTISAMPLE_NONE,8Ἥᵨi@¬᪵,ᡈ(w030^^05p?[_2_5«^£5ᑮD3DMULTISAPLE_16_SAMPLESåÿḄò,8Öᵨ2@¬᪵、3@¬᪵ᑮ16@¬᪵。¸ᦪᓹ᝞311L7167613?;]%ḄWᦪò,e(w^^qᓃ,⊤9N◤]%。☢Ḅ"ṹÅDìûµ9hḄh^j(ᜓQᔲ¿ᢝD3DFMT_X8R8G8B8²zbḄ4@¬᪵。g_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,D3DFMT_X8R8G8B8,FALSE,D3DMULTIS7iMPLE_4_SAMPLES#NULL);4.8.2_`ᵨi@¬᪵Ḅ0‘7「6(^30(ᜓI^w_`ᵨi@¬᪵Ḅ8ᕸ130(ᜓI^,◤⌕X030?&£5>^」>X1^×£1^$᪀Ḅ^11753"?4×7ô6ᡂᕒ(wZᜓᵨḄi@¬᪵5`,,X3〜3ô{1^(^ᡂᕒ(wD3DSWAPEFFECT_DISCARD,☢Ḅ"ṹ_`ᵨ4@¬᪵Ḅ0^83〇(ᜓI^。//;ÌìûµᓱḄµ9UbD3DDISPLAYMODEd3ddm; )1ᐗ<ᦻUᑴOOO63V_RETURN(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&d3ddm));//i5SD3DPRESENT_PARAMETERS^^D3DPRESENT_PARAMETERSd3dpp;ZeroMemory(&d3dpp,sizeof(d3dpp));d3dpp.Windowed=TRUE;d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;d3dpp.BackBufferFormat=d3ddm.Format;//bxìû(ᜓQᔲ¿ᢝi̬᪵if(SUCCEEDED(g_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,d3ddm.Format,TRUE,D3DMULTISAMPLE_4_SAMPLES,NULL))){d3dpp.MultiSampleType=D3DMULTISAMPLE_4_SAMPLES;>else{MessageBox(hWnd,1"hS¿ᢝ4@i¬᪵I£K7",L"AntiAlias",0);>//_`01^#30(ᜓI^V_RETURN(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,vp,&d3dpp,&g_pd3dD«vice));4.8.3'ᵨ½(᪵FG᝱D3DRS_MULTISAMPLEANTIALIASᵨJᑴQᔲÖᵨi@¬᪵ᐰeIJKØ。wÖÎi@¬᪵Ø,&ᵨIDirect3DDeviceUetRende^State()>,Xóo=¸ᦪ(ISD3DRS__MULTISAMPLEANTIALIAS,XóB=¸ᦪ(wᓃû,᝞ᡠ9。ÒAêæ,i@¬᪵ØQÖᵨḄ。g_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS•true);»9Ñ1^1735^9᝞<ᵨi@¬᪵RIJKᦔW,ᐹ#Rd⁚èÅÚV"ṹ。4.9»röCDᵨ8ᦝ130¿ᑴᓫBCᦻrᐵḄᔜ=>☢,@ACD᝞<ᵨ⚔A>?@A>?¿ᑴᓫ,8Oᵨ10309?0ᕲ1ô¿ᑴBCᦻ,,Èᐹ#Ḅp9Ñ。ᨬxIᑴF>bḄFG᝱、i@¬᪵Øn$⌕CD。a!1.¸ὃ9Ñ^#8&&『,{ᐸ¦ᐗḄ¿ᑴ,2.¸ὃ9Ñ181^8ᓄ£6。2v¿ᑴo=¼ᦪTiḄi¼8$o=ᙊ。3.Úᦋ9Ñ×^120,{µ9i$ᦻ。4.Úᦋ9Ñv61168“〖^,stSḼ⁐UbiᐙUbḄᦔW。5.Úᦋ9ÑP7^7H,ÛÖᵨἭᵨi@¬᪵îḄᦔW。 Î5U⚔@ᙶ᪗{ᣚÿÒḄᱥ#◤⌕ᵨ}Cᙶ᪗ᩭóF,µ9ᘤQo=BCḄ⊤☢,ᡠ8ᙠefF}Cî,✌ᐜ◤⌕XóFÿᱥ#Ḅ}Cᙶ᪗LᣚwBCᙶ᪗(^&ᙶ᪗ᑮefᙶ᪗),J=vÑᙠ0^^^30Ò7w⚔Aᙶ᪗Lᣚ。e8⚔Aᙶ᪗LᣚU^ᡂ᤬vÑ,}CÿÒḄᱥ2v᤬!Ḅ'᤬µ9ᙠBCḄrᱏ,ᡠSḄQ,ᙠûᜐrᱏᣚᡂef。:ᙠÎ4UḄ]^MÊ,Î]Ḅ᝞¹[]_;Ḅ☢12,ÏḄ⚔@ÐÑᙶ᪗Ḅ_;⊤]Ḅ,ÒE⚔@ᙶ᪗{ᣚ#`Ḅ⚔@ᙶ᪗ᦪ¸。5,1⚔@ᙶ᪗{ᣚ<ᐝ᯿~ᭆᙠ£^^1309Ò,F}CI^ḄvÑeᑖw5=▤f。óo▤f7wᙶ᪗Lᣚᐝ᯿(TransformingandLighting,T&L)▤f。ᙠJ=▤f,Z=I^Ḅ⚔A,^o=^Ḅ、ôAᙶ᪗ÿÌÃᣚᑮJ²Ḅefÿ(ᙶ᪗LᣚSᒹõᱥ#⚔AßḄᙶ᪗Lᣚ,8ReØᒹ⚔A+、[ᳮᙶ᪗¶Ḅᙶ᪗Lᣚ),,᪷£ÒᐝVᱥ#⊤☢ḄᩞWIᱥ#⚔AKᵨS5`Ḅᐝ᯿ᦔW。Rᨵᐸ¦oÛ@⌕Ḅ÷z,᝞úûfôþÃ,·ᙠóo▤fn$。óB▤f7wᐝ᪕ᓄᜐᳮ▤f,8^(^30Xv×&1ᜐᳮḄ⚔A(w8A、+、☢wẠḄᐗ,Kᵨ[ᳮcᱥ#⚔AḄ7⁐}ឋ,᪷£rᐵFG᝱((᝞Ḽ⁐Ub),.}Z=²ḄᨬÐ7⁐ò,,ᙠefµ9Èᩭ。5.1⊤9J5=▤f᝞<)ÃÄ,ᐳ[ᡂF30I^ḄvÑ。*Ö+⚔"光栅化处理阶段T&L渲染的像素▣阶段Óᐝ<ᩞrᐵFG᝱rᐵFG᝱>•15.1MN30vḄO▤¢ᨵî᪷£ᱯPḄ◤⌕,e8*vᐸÒḄ)p,᝞ó4»ÒḄ9Ñ*v×&ᓃ▤f[ᳮc,z1X}⚔AÄwefᙶ᪗Òȵ9。×&1vÑᙠ07"^30Ò237w⚔ALᣚOà+,ᙠJ=vÑÒ,èvLᣚᐝ᯿Ḅ⚔A^onᐭ,ᙠᑁ%J⚔AX[ᡂ|=ëyvÄ,ᯠxvLᣚᐝ᯿Ḅ⚔A,^= ⚔@ᙶ᪗{ᣚQoo65oÈᩭ。KᵨÑ2vᢣ}|=▣、fô8OᡠᵨḄᐝVᩭ`×&ᓃOà+,ᯠxKᵨÑX⚔A〈ᐭOà+,IJ⚔An$Lᣚ、᯿úû,Xᐸᢗ/ᑮefÿ,,᪷£fôḄö}Iᐸn$þÃ。vOà+Ḅ⚔AQᜐᳮvḄ,,Zᜓ〈ᐝ᪕ᓄᜐᳮÑ。×&1Oà+vÑ᝞5.2ᡠ9。*Ö&ᓃ⚔"—\ᐝ᯿ᢗ{ᣚ{ᣚIItC=::SÖ+⚔"15.2L&ᓃ~×&ᓃOà+e8*vᐸÒḄ)ᡈᐰ%p。R)ÅḄLᣚ᯿ḄÑᕒe8¦ᵨ%ᑖOà+,,XvLᣚ᯿Ḅ⚔A#〈1^^30。PQᙠᜧiᦪêæ,ᨬᵨ07"^30Ḅ[᦮×&1Oà+。»¦CD×&ᓃOà+ÒḄ⚔Aᙶ᪗Lᣚ%ᑖ,ᐝ᯿%ᑖXᙠo»n$CD。5.2▣=>⚔Aᙶ᪗Lᣚ23QJ▣RḄ,Vû☢✌ᐜCDᙠ0ᓃ^130ÒḄᔜ*▣5`。5.2.1D3DMATRIXD3DMATRIXQDirect3DÒᨬᓫḄ▣5`,ᐸ}©᝞。typedefstruct_D3DMATRIXunion{struct{float_H,^12,_13,.14float-21,_22,—23,.24float-31,_32,_33,34floatJl,42,—43,44>;floatm[4][4];>D3DMATRIX;µᯠ,D3DMATRIXÒ?ÃḄQo=4><4ḄBCôAᦪ,e82v_7』ḄzbEKᦪÒḄZ=ᐗ²,7⊤9Kᐗ²Ḅ$ᦪ,』⊤9Kᐗ²Ḅᑡᦪ。᝞,_34⊤9ó3$、ó4ᑡḄᐗ²。5.2.2D3DXMATRIX 66oooÎ5U#ifdef—cplusplustypedefstructD3DXMATRIXpublicD3DMATRIX{public:D3DXMATRIX(){}?D3DXMATRIX(CONSTFLOAT*);D3DXMATRIX(CONSTD3DMATRIX&);D3DXMATRIX(CONSTD3DXFLOATl6*);D3DXMATRIX(FLOAT11,FLOAT_12,FLOAT13,FLOAT14FLOAT_•21,FLOAT_22,FLOAT_23,FLOAT._24,FLOAT■.31rFLOAT-32,FLOAT_33,FLOAT■_34,FLOAT_-41.FLOAT-42,FLOAT-43,FLOAT__44);//«ᐗ4FLOAT&operator()(UINT•ROW,UINTCol)FLOAToperator()(UINTRow,UINTCol)const;//Ãᣚ¤operatorFLOAT*();operatorCONSTFLOAT*()const;//+ò,¤D3DXMATRIX&operatorfe=(CONSTD3DXMATRIX&);D3DXMATRIX&operator+=(CONSTD3DXMATRIX&);D3DXMATRIX&operator-=(CONSTD3DXMATRIX&);D3DXMATRIX&operator★=(FLOAT)?D3DXMATRIX&operator/=(FLOAT);//ᐗABîD3DXMATRIXoperator+()const;D3DXMATRIXoperator-()const;//_ᐗABîD3DXMATRIXoperator*(CONSTD3DXMATRIX&)const;D3DXMATRIXoperator+(CONSTD3DXMATRIX&)const;D3DXMATRIXoperator-(CONSTD3DXMATRIX&)const;D3DXMATRIXoperator*(FLOAT)const;D3DXMATRIXoperator/(FLOAT)const;friendD3DXMATRIXoperatorFLOAT,CONSTD3DXMATRIX&)BOOLoperator==(CONSTD3DXMATRIX&)const?BOOLoperatorJ=(CONSTD3DXMATRIX&)const;>D3DXMATRIX,*LPD3DXMATRIX;#elsell—cplusplustypedefstruct_D3DMATRIXD3DXMATRIX,*LPD3DXMATRXX;#endif//1__cplusplus2v☢Ḅ}©》18ÚÈ,030᱄^1¦19$᪀öD)03£>^0^1$᪀,,I¡i¤n$@,ᡠ8e8z1n$Ãᣚ、Øò8Oi*oᐗ、Bᐗ,᩽ᜧᙢ>¯▣5`LḄ。2v☢Ḅ}©Re8ÚÈ,D3DXMATRIX¦ᨵᙠC++"ṹÒᨵU©,ᙠ0"ṹÒSØᵨ03£^^^^1$᪀。◀e82v0]zbE03099×X19ÒḄZ=ᐗ²å᜜,Re8ᵨ¤() ⚔@ᙶ᪗{ᣚOOO67E▣ÒḄZ=ᐗ²。◤⌕üUḄQ,ᵨ¤î,$ᑡḄ@AQ^0:+Ḅ。᝞☢Ḅ"ṹE▣Ḅóo$ÒḄóo=ᐗ²。D3DXMATRIXM;M(0,0)=5.0f?5.2.3D3DXMATRIXA16%030᱄4×X19167w16Ü⁚I#▣(16-bytealignedmatrix),8öD)030\^×-$᪀。ìᵨ1^61?ᓺ¿-ᱏ$030᱄ᦪzᦪî,16Ü⁚I#▣0309^×X1916w[ᡂrKvÄn$Úᓄ。ìᵨ¥78¿1C++£×ᡈᵨïᓹ《^685(^^30wḄ>^8¿1€++6.0î,X:ÖÜ⁚I#Ø。P⍡/ḄQ,ᘤN0sᑮQᔲï0^^851?&0、ᡠ8Ü⁚I#¦I%8¿10+^£×ÒA:Ö。IJᐸ¦ᘤ,16Ü⁚I#▣0309^^0^1᱄16XÌìÄ0309^0^1᱄n$。ᨵᐵ0309ᔖ×X816$᪀Ḅᐹ#}©,èÅÚᦻ᫏。9:030^L1C16᪀no030?4CL1᱄᪀,ᡠ030^^L1C16᪀{:ᵨᙠ030᱄^0^᪀ÊäJḄᔜABîm。5.3ᙶ᪗{ᣚ᝞5.2ᡠ9,ᙶ᪗Lᣚᒹ&Lᣚ、e8Lᣚ、ᢗ/LᣚfLᣚZ=▤f。ᐸÒ&Lᣚ、e8Lᣚ、ᢗ/LᣚQ2vw0^^〖30FOà+ᑖ(rKḄLᣚ▣[ᡂḄ,fLᣚQ2v(fô[ᡂḄ。ᐹ#Ḅᙶ᪗LᣚÃÄᵫ07^(^30FOà+᪷£(ḄLᣚ▣fô)Î[ᡂ。5.3.1&Lᣚ&ÿ&LᣚQXᱥ#Ḅ⚔Aᙶ᪗^U`ÿÃᣚᑮ&ÿ。ᙠU`ÿÒ,⚔Aßᙶ᪗@£U`Ḅᙢᙶ᪗jḄlA},ᙠ&ÿ3,ᡠᨵU`Ḅ⚔Aᐳᵨo=lA,ᓽ&ᙶ᪗jlA。_,&LᣚQXU`^ᙢÿ@H}ßᑮ&ÿ。5.3᧎9&ᙶ᪗j÷U`Ḅᙢᙶ᪗jåÿḄᐵj。^U`ÿᑮ&ÿḄÃᣚ,▭QIU`n$á、èÃ、þÃ8O8ÐḄ÷UᔠLᣚ。ᐹ#Ḅ>ᙢᙶ᪗jQ2vb:A/,.A/,M,lx1^23^24【34X÷UoA^,y,Ãᣚᑮ=oA?^,/,。b·e8⊤9w8bPxyz")=P(x,y,z)•Mworld 68oooÎ5U^_^Q&Lᣚ▣,·Q8Rᱥ#Ḅá、èÃ、þÃ8ÐḄcᔠLᣚ。ᙠ}©&Lᣚ▣x,&ᵨIDirect3DDevice9::SetTransform()>(&▣,᝞ᡠ9。g_pd3dDevice->SetTransform(D3DTS_W0RLD,&matWorld);Û:ᵨ}CU`ᑴÄ:,᝞3(^1£,ᑴÄ}CU`î,✌ᐜ◤⌕wU`(}o=ᙶ᪗j,U`Ḅ⚔Aᙶ᪗Qᙠ(}ḄU`)Hᙶ᪗jḄᙶ᪗,J=ᙶ᪗j·Q☢ᑮḄᙢᙶ᪗jᡈU`ÿ。1.áe82vb(·Q☢ḄáLᣚ▣)10000100[x1z11]=[JCyz1]0010TXTyTz1XAU,),,Z)m.v©åᑖÎ、Ty、Tzoµᯠ,¦⌕´ᑮá▣,áÃÄe8[ᡂ。D3DXD3DXMatrix-1^1^1&0^()ᦪ,ᵨJ>¯ᙢnᡂá▣。KᦪḄ¯᝞。D3DXMATRIX*D3DXMatrixTranslation(D3DXMATRlX*pOut,FLOATx,FLOATyFLOATᐸÒ:•ᓹ08Äw$WÒÈḄá▣。•A>2⊤9ᙠ9、Y、>ᔣáḄ.ã。᝞,Xo=ᱥ#ò9åá2.5=ᓫß,ò2åá-1.5=ᓫß,"ṹ᝞。D3DXMATRIXmatTranlate;D3DXMatrixTranslation(&matTranlate,2.5,0,-1.5);g_pd3dDevice->SetTransform(D3DTS_WORLD,G>matTranlate);2.èÃᵨ☢Ḅ▣eXAu,>’,z)0,´ᑮHA(Y,/,z'h1000'x'0cos0sin^01]-1^yzi]0-sin0cos000.001¹^åèÃ0îḄ▣wcos00-sin00'0100[xryfz'l]-Uyz1]sin00COS000001¹2åèÃ0îḄ▣w: ⚔@ᙶ᪗{ᣚOOO69cos6sin000-sinOcos600z'l]=U᜛1]001000010wèÃ,4ßQ5,ᐹ#QᢣòḼèÃåḄᢣᔣ(ᓽì>ᔣ)ᔣᙶ᪗lAÚy<î┐èÃvḄ。᪵,e8ᵨ0309Ḅᦪ030᱄1^14X0131701^()、D3DXMatrixRotationY(#p0309^DX013᝞()>¯ᙢ_`èÃ▣,J3=ᦪḄ¯᝞。*D3DXMATRIX*WINAPID3DXMatrixRotatlonX(D3DXMATRIX*pOut,floatangle)D3DXMATRIX*WINAPID3DXMatrixRotationY(D3DXMATRIX*pOut,floatangle)D3DXMATRIX*WINAPID3DXMatrixRotatlonZ(D3DXMATRIX*pOut,floatangle)ᐸÒ•00^ÒÈḄèÃ▣。•30@1^èÃḄ5ò。᝞,⌕Xo=I^¹9åèÃ90°,R"ṹ᝞。D3DXMATRIXmatRotation;floatfAngle=90*(2.0f*D3DX_PI)/360.0f;D3DXMatnxRotationX(&matRotation,fAngle);g_pd3dDevice->SetTransform(D3DTS_WORLD,&matRotation);3.þÃᵨ☢Ḅ▣e8XAu,y,z)ᙠ᱄、Y、åᑖþÃ-、sy、s^´ᑮ=oAU_/,z')oS.000101]-U1]0001e8ᵨD3DXḄD3DXMamxScaling()ᦪnᡂþÃ▣,KᦪḄ¯᝞。D3DXMATRIX*D3DXMatnxScalmg(D3DXMATRIX*pOut,FLOATSx,FLOATsy,FLOATsz)?ᐸÒ•ᓹ08Äw$WÒÈḄþÃ▣。•x、y、2ᙠ᱄、Y、>ᔣþÃḄ。᝞,⌕Xo=ᱥ#ᙠ¥å>ᔣÃᜧ3ë,R"ṹ᝞。D3DXMATRIXmatScale;D3DXMatnxScalmg(&matScale,1.0f,3.0f,1.0f)?g_pd3dDevice->SetTransform(D3DTS_WORLD,&matScale);4.▣ë1÷cᔠLᣚᙠᜧiᦪêæ,01^(^30ÒḄᱥ#◤⌕n$Ḅ&LᣚS¦o=, iiQi=&LᣚḄᔠ。Jîe8ᵨ▣ë1ᩭRJ*cᔠLᣚ。Vw▣Ḅo=ÚAQ2v▣Ḅrý,e8X5=ᡈfi▣ḄÄᵨᔠ,ᙠo®R。·QÛ,wᐜxRo=U`Ḅ 70oooÎ5UèÃÎ,S◤⌕ᵨ5=▣,e8XèÃ▣á▣rý´ᑮo=cᔠ▣8RᡠᨵØ。J=vÑ£÷▣ë1,e8ᵨb⊤9。C=M{•M2.........ª”-i•ª,ᐸÒ^QRcᔠLᣚḄcᔠ▣,^7ᑮI^Q¦ØR)o*&LᣚḄᓫä▣。ᜧiᦪêæQ5ᑮ}=▣ë1,PJ=ᦪÔᨵ▲ᑴ。ᙠ▣ḄýÒ,<QᐵÏḄ。Nà⌕_`᪵Ḅ&Lᣚ▣,µ6^·ᑮ~ḄlᑣØ&RU⌕ḄᦔW。·QÛ,o=cᔠ▣ḄféᦔWQᔜᓫä▣ᢥ^·ᑮ~Ḅ<féᦔWḄᔠ。Ꮇ(⌕ᐜXo=ᱥ#ᙠ2å>ᔣÃᜧ5ë,ᯠx-¹våèÃ60°,ᨬxò9åá30=ᓫß,ᑣR"ṹ᝞。D3DXMATRIXmatWorld;D3DXMATRIXmatScale,matRotationfmatTranlate;D3DXMatrixScaling(&matScale,1.0£,1.0f,5.0f);floatfAngle=60*(2.0f*D3DX_PI)/360.0f;D3DXMatrixRotationY(&matRotation,fAngle)?D3DXMatrixTranslation{&matTranlate,30.0f,0.0f,0.0f);matWorld*matScale*matRotation*matTranlate;g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);5.3.2e8Lᣚe8Lᣚ(·7ÌLᣚ)Qᙠ&ÿ(o=᤬/!,ᔜ=⚔Aᙶ᪗^&ÿLᣚᑮe8ÿ(Ìÿ)。ᙠÌÿÒ,᤬/!ᡈὅÛe8AßñlA,ᔣḼᑍåì>ᔣ。Vw8《^〖30¬ᵨ·ᙶ᪗j,ᡠ8Ãåì>ᔣᢣᔣef3☢。(}C⚔Aᙠ&ᙶ᪗jḄᙶ᪗w?_&ᙠÌÿᑁḄᙶ᪗wᓃ^,û1】▣I7_7we8▣。e8▣᪷£᤬!ᙠ&ÿÒḄß(ᓽÌÿḄlAᙠ&ᙶ᪗jÒḄrIß)᤬!Ḅe8>ᔣᙠ&ÿÒḄ>ᔣ,X&ᙶ᪗jḄI^@H}ß。e8▣Ḅ᪀⌼lᳮÛcᩖ,Sv[ᐰe8SᵨᳮBJd⁚E⚪, z1ᵨD3DXḄD3DXMatrixL00kAtLH()ᦪ,᪷£᤬!Ḅß、e8Aᔣnᡂ〜=J·ᙶ᪗jḄe8▣,KᦪḄ¯᝞。*pOut,CONSTD3DXVECTOR3*pEye,CONSTD3DXVECTOR3*pAt,CONSTD3DXVECTOR3*pUpᐸÒ:•ᡝ(^^nᡂḄe8▣。•ᓹ£^6᤬/!ß。•ᓹLe8AḄß。•{^?᤬!Ḅᔣ,23w(0,1,0)。ᯠx&ᵨ1883£^^^9:9^^Dᑖ0£)>(e8▣,᝞ᡠ9。D3DXVECTOR3vEyePt(0.0f,3.0f,-5.0f)? ⚔@ᙶ᪗{ᣚooo71D3DXVECTOR3vLookatPt(0.0f,0.0f,0.0f);D3DXVECTOR3vUpVec(0.0f,1.0f,0.0f);D3DXMATRIXmatView;D3DXMatrixLookAtLH(&matView,&vEyePt,&vLookatPt,&vUpVec);g_pd3dDevice->SetTransfrom(D3DTS_VIEW,&matView);ìᯠ,·e8ᵨ0309^½1^^〖Xᔿ)ᦪ`o=J~ᙶ᪗jḄe8▣,PVw8^^30¬ᵨ·ᙶ᪗j,ᡠ823Sᵨûᦪ。5.3.3ᢗ/Lᣚᙠ☢(᤬!Ḅß>ᔣ,☢◤⌕÷ḄÃÄQXÌÿÒḄ}Cᱥ#ᢗ/ᑮBC8ᱏ,·Qᢗ/ᑮef。J=^}CᑮBCḄLᣚvÑQᢗ/Lᣚ,ᓽ^Ìÿᑮᢗ/ÿḄLᣚ。(}Cᱥ#ᙠe8ÿÒḄᙶ᪗wᓃ^,ᢗ/▣w9o《,ᑣ⚔Aᙠᢗ/ÿḄᙶ᪗w。ᨵ5*Ḅᢗ/Lᣚ:ìÊᢗ/nfᢗ/。ᙠ}CÒ,ᨬ3ᵨḄQnfᢗ/。nfᢗ/RḄQo=þÃḄ、nfḄᢗ/,᝞5.4ᡠ9。nfᢗ/ḄᱯAQ,.ã᤬!gäḄᱥ#ᙠᢗ/á☢ḄᡂgÞ。nfᢗ/ḄÌQo=9ᜮ#(Z:'),᝞5.5ᡠ9。J=9ᜮ#7wÌ;9ᜮ#,᤬!ßJ5.5ÒZ:┵Ḅ⚔A。J=Z:┵Ìä úû☢(·Q9ᜮ#äá☢á☢,ᡈ7ûxúû☢)ᑖᒘ,ä úû☢ÒÿḄ%ᑖQÌ9ᜮ#。¦ᨵJ=ÿ3ḄI^QeqḄ。Ì9ᜮ#᤬/!5.4nfᢗ/5.5Ì9ᜮ#9Unfᢗ/▣ḄÄᵨQXÌ9ᜮ#ᑁḄᱥᢗ/ᑮ᤬!ḄBC8ᱏ。ᢗ/▣Ḅ᪀⌼lᳮ·Ûcᩖ,Sve8z1ᑭᵨ030Ḅ0309^?66^^^^0^()ᦪ,᪀`o=nfᢗ/▣,KᦪḄ¯᝞。D3DXMATRIX*D3DXMatrixPerspectiveFovLH(D3DXMATRIX*pOut,FLOATfovY,FLOATAspect,FLOATznear,FLOATzfarᐸÒ:•?0^^ᢣᔣnᡂḄnfᢗ/▣ 72oooÎ5U•£07¥᤬!ᙠ¥åḄᡂ(ᓫßw5)。•3ô6€^9ᜮ#Ḅ>?。•znear.2£&[9ᜮ#á☢äá☢.ã᤬!Ḅ.ã。W]:9j=ÕᜮgḄ׸A[÷n Ḅ׸A,᪵ᢗÀᩭḄ135µ{2。(᤬!ᙠvåefḄ5w<^v,9ᜮ#Ḅ>?w…@ᓄ#&,᤬!.ãä úû☢Ḅ.ãᑖwZfarZnear,ᑣ_`,(nfᢗ/▣Ḅ"ṹ᝞^D3DXMATRIXmatPr03ect;D3DXMatrixPerapectiveFovLH<&matProject,fovY,width/height,Znear,Zfar);g_pd3dDevice->SetTransform(D3DTS_PROJECTION,&matPr03ect);nfᢗ/▣ḄÄᵨQXÌ9ᜮ#Ãᣚᡂ>#。Vw9ᜮ#ḄäÞ,ᡠ8☠᤬!ḄI^XÌÃᜧ;I^.ã᤬!gä,ᐸᡂgÞ。JQḄnflᳮ。W]:vw⚔@ᙶ᪗{ᣚ,M?@ᕒḄ¿mÒᑭᵨ030Àᦪ᪀çᔜ{ᣚ▣,ÿᵨIDirect3DDevice9::SetTransform()¨[÷/bḄ▣ᓽ:。W]::910(30067]^9::061Ly{001^)¨A$[÷Ḅ▣、▣<ᢗ▣。5.3.4{ᣚf(fô)LᣚQ£^^130⚔ALᣚOà+Ḅᨬxop,82v}©f1ê(efµ9rḄ▭O¶¸ᦪ),[ᡂ⚔Aúû8OX⚔Aᙶ᪗^ᢗ/ᙶ᪗Lᣚwᨬе9Ḅ8²wᓫßḄefᙶ᪗¶vÄ。(fx,01^830FOà+)În$úûvÄ,&SF[ᐰᙠe8á9☢8᜜ḄI^,R&IJ÷e8á9☢rÊḄI^,e8᝞>bn$F:ᓽS¿ᑴᙠfôᢣ}Ḅ8᜜Ḅ%ᑖ。W]:¥Z¦§,0&(^30=A$Ḅ᦮ÛᡝmnU1~,ᓽ=᦮Ûᡝmn。ݦ§,5◤⌕[÷º»,ᵨ¥Z[÷ᓽ:。᝞WSᵨÒAḄf(,e8}©o=030¥q>^^0^95`ḄL⊤9f,(rKḄf1êx,&ᵨ18G13006¸6979^〜00£)>(f。Re82v10(300671069::06116〜(《1()¨ËA$。.5.4ᙶ᪗{ᣚ]^M☢$ᔠ9Ñ1>21^£(^«,CD}Cᙶ᪗Lᣚ,8Oᒆ◀UbḄ(ᓫÎḄR。1.᪀⌼:;129Ñ×8Dᓄᙠ)}©ᦪ11^0600160Ò᪀⌼o=ᙊ9U`,"ṹ᝞。for(DWORDi=0?i<50;i++)2.ᙶ᪗Lᣚ9Ñ^^Dᓄ¹Ò(ᔜ*ᙶ᪗Lᣚ▣Ḅ"ṹ᝞。//(&▣VOIDSetupWorldMatrice(){//`o=¹9åÎ᝱èÃḄ&▣D3DXbtATRXXmatWorld;UINT1T1me=timeGetTime()%1000;floatfAngle»iTime*(2.0f*D3DX_PI)/1000.0f;D3DXMatrixIdentity(&matWorXd);D3DXMatrixRotationX(&matWorld,fAngle);//(&▣g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);}//(e8▣ᢗC▣VOIDSetupViewandProjMatrices(HWNDhWnd){//`,(Oe8▣D3DXVECTOR3vEyePt(0.0f,3.0f,-5.0f);D3DXVECTOR3vLookatPt(0.0f,0.0f,0.0f);D3DXVECTOR3vUpVec(0.0f,1.0f,0.0f);D3DXMATRIXmatView;D3DXMatrixLookAtLH(&matView,&vEyePt,&vLookatPt,&vUpVec);g_pd3dDevice->SetTransform(D3DTS__VIEW,&matView);//;ÌìûïôḄ(ᡝ,,᪷£(ᡝOTᢗ/▣Ḅ>DRECTclientRect;GetClientRect(hWnSetTransform(D3DTS_PROJECTION,&matProj);>o、Ä:1)n ßᱥgA=àᩭ,◤⌕5Nᦋ{/bḄ▣,xᢗ▣<▣9j5{,ᱯ,ᢗ▣ᙠ[÷#`,)à5◤⌕u[÷。2)ᙠ[÷ᢗ▣D,bᱯ,Táᐸâ☢Ḅ,᝞®MÊᱥgḄã⚔@ᙶ᪗ḄäåÀâ☢Ḅ,ᑣMÊ=5[]ѹᑁ^ᐵw@,ὅä⌕Tá,4n¿Ḽ!ḄÀᐭ,M[]ḄÜײæᩭæᜧ,µEj⍗ᑮ¦§,xKὅ᧕é«⚪。3.2.ᒆ◀101^^30Ò}☢ᨵû☢ú☢5%ᑖ,ÒAêæ,ᙠFᑴû☢,ᒆ◀ú☢。 74oooÎ5Uᙠ9ÑÒ,Vwᙊ9ᙠSeᙢèÃ,ᒆ◀ú☢B´E9Ḅᑁ⊤☢Seq,ᡠ8ᢣ}Sᒆ◀ú,"ṹ᝞。//(ᒆ◀UbwSᒆ◀÷<☢(ì☢I☢>g_pd3dDevice->SetRenderState(D3DRS_CULLM0DE,D3DCULL_NONE);4.ᐵyᐝ᯿ᜐᳮ9ÑÖᵨ×&ᓃOà+,ᙠûᡃЦn$ᙶ᪗Lᣚ,,µᶍᐝ᯿ᜐᳮ,ᡠ8◤⌕ᐵyᐵ᯿ᜐᳮ,"ṹ᝞。g_pd3dDevice->SetRenderState(D3DRS_LIGHTING,FALSE);5.ÎḄRᙠX⑶û⑴ᦪÒ,&ᵨ☢ÈḄ(&Lᣚ▣Ḅᦪ3^Í^^^1¸6(),SeIn$Lᣚ,ÎᦔW▭Q2v8RḄ。ZS&ᵨ1^8^0ᦪî,5vÍo11(^P&0ᦪB᪷£îÿḄLᓄ}ìûîoᙊ9÷9åḄᜳ,,(rKḄᙶ᪗Lᣚ▣。ᯠx&68^『()ᦪXèÃxḄᙊ9¿ᑴÈᩭ,1^!^^()ᦪÌSnᙢ&ᵨ,ᙊ9SnᙢÌèÃ,xFᑮef。VwT!Ḅ¤3ü,5S&ᵨ1^!^8()ᦪḄîÿÿ◞3Þ,ᡠ8Æé☢QëyLᓄḄ,ηon。9:◀9▣ßᱥg=àᩭ¯°=>ᦔ®#᜜,:5Nᦋ{▣¯°=>ᦔ®。9▣¯°=>,=ywᱥg7ᙠA=;9▣¯°=>,=ywὅ5NA=^K9Ñ^^ᢕᓄḄ$ᦔW᝞-^ᡠ9。15.6]^M1^ì〖00^Aᦔ®9:4n]^M7^yᓄᖾᵨ 030᡽¯Àᦪ,ᓽ030᱄?ᜮḄÀᦪ,ᡠᙠM9ṹÊ◤⌕ᒹ43(19àᜮᦻh,n⚗µòb43(^9.1ᓄᦻh。5.5Þ$»CD}Cᙶ᪗LᣚvÑ。}Cᱥ#⚔A^óFU`Ḅᙢÿᙶ᪗v&Lᣚ、ÌLᣚᢗ/Lᣚ,Ãᣚwᢗ/ÿḄᢗ/ᙶ᪗,ᯠxvfḄúûLᣚ,Ãᣚwᵨ ⚔@ᙶ᪗{ᣚOOO75Jµ9ÒÈḄefᙶ᪗,[ᡂ⚔Aᙶ᪗Lᣚᐝ᯿Oà+Ḅᙶ᪗LᣚvÑ。}Cᙶ᪗LᣚQ}CÑ(TÒ3ẠḄᑁ4,8IJᳮÿᑁḄᱥ#᝞<µ9ᙠef、ᳮÎRlᳮQtᐵ@⌕Ḅ。ᐵJ81E130ÒḄᙶ᪗LᣚḄ*dR,葸ὃ»9Ñ7>G^(^1^V"ṹ,ᐵÏQüUᳮ᦮=LᣚvÑḄRlᳮ,៉01^830Ò}Cᙶ᪗LᣚḄᐹ#Rp。a!1.Hdᑖ᪆9Ñ1^ᢕᓄ0«ḄV"ṹ,Éὃ⚔Aᙶ᪗LᣚQ᝞ᙠi&Ò,ᐝ+ᙠᑮ®HIåûvᱥ#⊤☢ḄiSI],i&Òᐝ+I]ḄᦔWQᐝ+◤⌕URḄ。¶ᐝ+ØT_`3$iḄ^,PQRÔᨵîÑØT[ᡂJ。ὃ⇋ᑮîFḄ◤⌕,0^^〖30ᵨfwᓫḄ>n$ᐝ᯿T。0^8304*ᓄḄᐝ᯿TU`:ú᛻ᐝ、I]ᐝ、☢I]ᐝ)#ᐝ。JᔠᵨJZ*ᐝ᯿TU`,ØᮣRᦔᙢ.}CÑÒḄᐝ᯿E⚪。6.1.1ú᛻ᐝo=ᱥ#ᓽÔᨵz1ÌᐝV᯿],P¦⌕ᨵᐝ+2vᐸ¦ᱥ#Ḅᢚ]、I]ᑮ®Kᱥ#,8·ØÌÚq。e8ᙠÒ(o=ZᐝL,ᓫᙢU^Sᱥ#⊤☢ᡠonḄI]ᐝḄko᯿,J7wú᛻ᐝᡈúᐝ。ú᛻ᐝÔᨵßᡈ>ᔣḄᱯ,¦ᨵo=7⁐Lò, SB⊦ï,ᡠ8ᙠᡠᨵ>ᔣᡠᨵᱥ#⊤☢ᢗ]Ḅú᛻ᐝḄᦪNQឤ}SLḄ。e82vFG᝱030&5_4^□1^1w᦮=8¹ú᛻ᐝ,᝞ᡠ9:D3DCOLORambientColor=D3DCOLOR_XRGB(64,64,64);g_pd3dDevice->SetRenderState(D3DRS_AMBIENT,arabientColor);6.1.2I]ᐝìᐝ+᯿]ᙠôPᱥ#Ḅ⊤☢ᓃî,ᐝ+BòḼᔜ=>ᔣÌᙳᒴᙢI],ᙠ071^830Ò2vI]ᐝḄTU`DUJ*ᐝ᯿ᦔW。ᵫJᐝ+òᡠᨵ>ᔣÌᙳᒴᙢI],Nà^=>ße8,⊤☢Lᙳr,ᡠ8¬ᵨJ*ᐝ᯿U`î,N◤ὃ⇋e8ὅḄß,◤ὃ⇋ᐝÂḄ>ᔣ8Oᱥ#⊤☢ḄGᔣ。I]ᐝ᯿TU`᪷£bTᱥ#⊤☢⚔AḄI]7⁐ò/dim^。^diffuse=k./]ight•COS6 ᐝ᯿OOO77ᐸÒ々wᱥ#⊤☢ᩞWḄI]jᦪ,/,_wóᐝ7⁐,0wᱥ#⊤☢⚔AᢣᔣᐝVßḄ>ᔣᔣ^⚔A+^åÿḄᜳ,᝞6.1ᡠ9。◤⌕ÛḄQ,ftDirect3D*,7⁐òQᵫª、«、¬3=7⁐ᑖ⊤9,ᙠᐹ#Tî·Qᢥ᯿3=ᑖᨬᑖT。6.1I]ᐝ6.2☢I]ᐝ6.1.3☢I]ᐝìᐝ+᯿]ᙠᐝ¸ᱥ#⊤☢î,ᐝ+B|zᙢòḼo=>ᔣÌI],^ᡂ¦Øᙠo}ᑁØe8ᑮḄLᐝ᯿。8^^30ᵨ☢I]ᐝḄTU`DᙢUJ*ᐝ᯿ᦔW。ᵫJᐝ+òḼo=>ᔣÌI],ᡠ8☢I]ᐝ᯿TU`S◤⌕ὃ⇋ᐝ+Ḅᐭ]>ᔣᱥ#⊤☢ḄGᔣ,R◤⌕ὃ⇋e8AḄß。☢I]ᐝ᯿TU`᪷£bDTᱥ#⊤☢⚔AḄ☢I]7⁐ò/spcc^。^specular~^s•^light•(COSQ?)ᐸÒ&《wᱥ#⊤☢ᩞWḄ☢I]jᦪ,&#wóᐝ7⁐,ÒwI]ᐝ+Oᱥ#⊤☢⚔Aᢣᔣe8AḄᔣ"åÿḄᜳ,᝞6.2ᡠ9。^☢ḄT;be8ÚÈ,☢I]ḄTÛᜧ,VûᙠÒAG᝱,Direct3DFIᱥ#n$☢I]T。᝞W⌕¾R8^(^30☢I]ᐝ᯿T,◤⌕(rᐵḄFG᝱,"ṹ᝞:g_pd3dDevice->SetRenderStat.e(D3DRSSPECULARENABLE,true);9:vᱥg⚔@zᐝ᯿BD,ᐹgvᵨfᡈfᐝ᯿Bi>,ᵫᱥg⊤☢ᩞñäḄ。<¯▭¦§A¼òᔠ,^᝞᝞®ᱥg⊤☢óô,ᑣAᐝ᯿ᑮᱥgàD,@$m;᝞®ᱥg⊤☢¾ᐝõ,ᐝ᯿DᑮᱥgàD=@$☢m。᝞W◤⌕n$I]ᡈ☢I]ᐝ᯿T,Öᙠ⚔A>?Òᒹõ⚔AḄᔣ1ê,JQVw8ò0ᙠn$ᐝ᯿î,⌕ᵨᑮ⚔Aᔣ。6.1.4)#ᐝ0^^(^302v.)#ᐝTU`DU#ᐝR^,▭)#ᐝTU`Sn$÷Tᐝ+᯿]ᙠᱥ#Ḅ7⁐ò,8Qo*T>,SQᐹ#Ḅóᐝ。ᐝVᑣ}©}CÒᐹ#Ḅóᐝ,ᒹóᐝḄß、>ᔣ、£¶1ê。rḄᐝVe8᪷£ᱥ#⊤☢ᩞWḄS,2vSḄᐝ᯿U`T⚔AḄ7⁐。᝞:ᓷTÒḄoU'ó᯿]ᙠWVᓫî,KᵨI]U`;᯿]ᙠWᴻ⊤☢ḄYî,ᑣKᵨ☢I]U`Tᐝ᯿ᦔW。6.2.1ᐝV5`0^830¿ᢝ3*ᐝV5`:>ᔣᐝ、AᐝVZᐝó。8Ðᵨ0[101^v?£Pp5`⊤9,Pp5`030001^×v?£Ḅ}©᝞。Typedefenum_D3DLIGHTTYPEᔣᐝD3DLIGHT_FORCE_DWORD=Ox7fffffff>D3DLIGHTTYPE?1.AᐝVJ*ᐝVᐹᨵ7⁐ß,Ôᨵ>ᔣ,ᐝVᔣᡠᨵ>ᔣ#]ᐝ+,᝞6.3ᡠ9。AᐝV#ÈḄᐝḄ£BÓdḼ.ãᱥ#Ḅä  ⊦ï,ᙠÑÒ◤⌕AᐝVḄß、7⁐⊦ïjᦪ¶1ê。ᙠn$ᐝ᯿Tî,᪷£AᐝVᙠ&ÿÒḄßᱥ#⚔Aᙶ᪗TÈóᐝḄ>ᔣóᐝÂḄ.ã(Â.ãᵨJTóᐝḄ⊦ï),ᯠxÙ⚔Aᔣo®,᪷£óᐝᱥ#⊤☢ᩞW}ឋTᱥ#⊤☢⚔AḄ7⁐ò。6.4>ᔣᐝ2.>ᔣᐝJ*ᐝVᐹᨵ7⁐>ᔣ,Ôᨵß,ᡠᨵᐝ+á$ᙢòḼ)=ᱯ}>ᔣÂ,᝞6.4ᡠ9。e8>ᔣᐝU^ᡂN[äᜐḄAᐝV,᝞'□ᡠ#ÈḄᐝ。•>ᔣᐝSB⊦ï,ìᵨJ*ᐝVT⚔A7⁐î,¦◤ὃ⇋ᐝ+Ḅ>ᔣ7⁐。VwS◤⌕ὃ⇋᯿LßḄ/0,ᡠ8J*ᐝḄTᨬ´。3.ZᐝóJ*ᐝVᨵ7⁐、ß>ᔣ,5DJR&ÒḄ0᯿ó,᝞6.5ᡠ9。Zᐝó#ÈḄᐝ+ᵫo=LḄᑁ┵#ᜧoAḄ᜜┵#ᡂ,ᐝ+£^ᑁ┵#ᑮ᜜┵#⌲⊦ï。ᑁ┵#w!^^&,᜜┵#wᓹ…。 ᐝ᯿OOO796.2.2ᐝV}ឋᙠÑÒᐝVᵫD3DLIGHT9$᪀⊤9,K$᪀}©ᐝVḄᔜ*}ឋ,Z*ᐝV᪷£ᐸ5`¦ᵨᐸÒḄ|=}ឋ,SQᵨᐰ%}ឋ,ᐸ}©᝞:typedefstructD3DLIGHT9{D3DLIGHTTYPEType;*D3DCOLORVALUEDiffuse;D3DCOLORVALUESpecular;D3DCOLORVALUEAmbient;D3DVECTORPosition;D3DVECT0RDirection;floatRange;floatFalloff;floatAttenuationO;floatAttenuationl;floatAttenuation2;floatTheta;floatPhi?>D3DLIGHT9,*LPD3DLIGHT;•Ãv…ᐝV5`。e8Ì030[101^_?03^*1、D3DLIGHT__DIRECTI0NAL^PD3DLIGHT_SPOT,ᑖ⊤9AᐝV、>ᔣᐝZᐝó。•Arabient、Diffuse、596^132:⊤9ᐝV#ÈḄú᛻ᐝ、I]ᐝ8O☢I]ᐝḄ7⁐。Û:Vwo=ᐝVB᯿LÒḄi=ᱥ#, Jᱥ#eØBᵨSḄᐝ᯿TU`n$ᐝ᯿T,ᡠ8◤⌕wóᐝᑖ(ᵨJSᐝ᯿TU`Ḅóᐝ7⁐。•?0311^00ᐝVᙠ&ÿÒḄß。>ᔣᐝSᐹᨵß}ឋ。•0116(^1(^.}&ÿÒᐝV#ÈḄᐝḄ>ᔣ,ᐝḄ>ᔣQᢣᐝḄyᔣ,23wᓫßᔣ。¦ᨵ>ᔣᐝZᐝóᨵ>ᔣ}ឋ。9:ÓᯠöᓄᐝVḄ>ᔣᔣSQ◤Ḅ,P8 ᨵᜧÞ,SØᵨÄᔣ(0,0,0)ÄwᐝḄ>ᔣᔣ,VwÄᔣQÔᨵ>ᔣḄ。•&31^6ᐝVe8᯿LḄ.ã,ìᱥ#ᑮᐝVḄ.ãᜧJJ=.ãîXSᐝḄ/0。o[XKò(weØḄᨬᜧò0301101^o^1^£—^^^。>ᔣᐝÔᨵ83096}ឋ。•Falloff、1^^L3?©1ZᐝóᱯᨵḄ}=}ឋ。ᑁ᜜┵#⊦ïjᦪ?&110^1ᑁ┵#1^6L3、᜜┵#?ᓃ1(¸q6.5),ᐳᑴḼZᐝóḄᑁ᜜┵#ᔜᨵiᜧ,8Oᙠ8ÐÒÿḄᐝ+᝞<ï÷。ì?&110££=1.0î,⊦ïᕈ+ឋLᓄ,Jî⊦ïTᨬÞ,^IjkឋØḄ/0ᨬÞ。•AttenuationO、c^61^&1^01^^^6¿3L1002.ã⊦ïjᦪ,ᑴᐝ£᝞<ᔣḼᨬä.ãï÷,ᨬä.ãQᵨ}ឋ^^%6ᢣ}Ḅ᯿]。AttenuationO、Attenuationl、△L161^3ᓃ002ᑖ⊤9ᐝḄ3、+ឋ、BS.ã⊦ïjᦪ。⊦ïT;b᝞:Atten=l/(AttenuationO+Attenuationl.d+Attenuation2•d2)ᐸÒ3wᱥ#⚔AᐝVåÿḄ.ã。.ã⊦ïjᦪIAᐝVZᐝóᨵᦔ。 80oooÎ6U6.2.3(÷ÖᵨᐝVᙠ0D30Ò,ᨬie(8=ᐝV,(ᐝVᵫ10'6<^3£^^9ᓄ69::56ᓃ½9Ḅ()>[ᡂ,K>Ḅ¯᝞。HRESULTSetLrght(DWORDIndex,CONSTD3DLIGHT9*pLxght);ᐸÒ:•1“6᱄Ìò0ᑮ7,⊤9⌱àó1〜8=ᐝV。•k19'ᢣᔣ03000·9$᪀#,ᒹõ(Ḅóᐝ}ឋ。10½^0^300671^€9::561^19^(>>¦Q(ᐝV,ᙠÒAêæ,(Ḅ÷<ᐝV-RS®Äᵨ,ᐹ#ᵨᐝV,ᵫ101«€^30069᡾Ḅ::^9&£Ḅ516()>},K>¯᝞。HRESULTLightEnable(DWORDLightIndex,BOOLbEnable);ᐸÒ:•19'11^ÊÌò0〜7,⊤9ᢣ}ó1~8=ᐝV。•ᓃÄ^ᓃ16ᢣ}ÖᵨᡈἭᵨ&9^11^©᱄ᡠᢣ}ḄᐝV。IZ=ᐝV,e8ᢣ}8Q>ᔣᐝ、AᐝVᡈZᐝó,,+8ÐrKḄ}ឋò。☢Ḅ9"ṹ(5=ᐝV:o=Q>ᔣᐝ,=o=QAᐝV。//(oᐝVw>ᔣᐝD3DXVECTOR3vecDir;D3DLIGHT9lightl;ZeroMemory(&lightl,sxzeo£(D3DLIGHT9))?lightl.Type=D3DLIGHT_DIRECTI0NAL?"ᐝV5`w>ᔣᐝlightl.Ambient.r=0.Iflightl.Awbient.g=0.1flightl.Ambient.b=0.Iflightl.Diffuse.r=0.6flxghtl.Diffuse.g=0.6flxghtl.Diffuse.b=0.6fvecDir=D3DXVECTOR3(l,1,-1);//>ᔣᐝḄ>ᔣD3DXVec3Normalize((D3DXVECTOR3*)&lightl.Direction,&vecDir);g_pd3dDevice->SetLight(0,&lightl);//BᐝVwAᐝVD3DXVECTOR3vecPos2;D3DLIGHT9light2;ZeroMemory(&light2,gizeof(D3DLIGHT9));light2.Type*D3DLIGHT_POINT;//ᐝV5`wAᐝVlight2.Diffuee.r-0.5fjlight2.Diffuse.g=0.4f;light2.Diffuse.b=0.4f;light2.Position=D3DXVECTOR3(20,10,50);light2.Range=100.0f;light2.AttenuationO=1.0f;g_pd3dDevice->SetLight(1,&light2);Vw23XóᐝḄ>ᔣᔣ(wᓫßᔣ,ᡠ8&ᵨᦪ03097ᡷ3᝞2^^1126()XᐝVḄ>ᔣᔣ^öᓄ。 ᐝ᯿OOO816.2.4IᐝVḄ|AÛ0©^130ÒḄᐝVQIR&Òᔜ*ᐝVḄ^,S5`ḄᐝVᵨo=$᪀5`D3DLIGHT9óFᐸ}ឋ,ᨵ}ឋ¦Iᱯ}Ḅ)*ᐝVᨵᦔ,JR&ÒḄᐝV5D。᝞>ᔣ}ឋ¦I>ᔣᐝZᐝóᨵᦔ。◤⌕ᱯÛḄQ,R&ÒḄᐝVᐸ7⁐Qᱯ}Ḅ,÷ᱥ#⊤☢ḄᩞWᐝ᯿T,U`Ôᨵ÷<ὶj,ᙠ8"(^31>ÒXᐝV7⁐ᑖᡂI]、☢I]ú᛻ᐝᑖ}©,}*ᐝ᯿TU`rIK,SḄᐝ᯿TU`ᵨSḄᐝḄ7⁐òn$T。ìᯠ,ᙠÑÒ[ᐰe8XᐝVḄ3*7⁐(wrḄᦪò, J᪵(·¤ᔠRêæ,·Û4᧕ᳮ(RÒḄᐝV_Bᐹᨵ3=7⁐òᕖ)。=᜜,dḄ/ὅeØB#RJ᪵o=E⚪,IJAᐝVÔᨵ>ᔣ}ឋ,ᙠn$I]☢I]ᐝ᯿Tî◤⌕ᵨᐝ+Ḅ>ᔣᔣ。lVQAᐝVᔣZᕜ#]ᐝ+,µᯠ>ᔣS³},VûSeØᙠᐝV}ឋÒ>ᔣᐝÖ᪵ᵨo=>ᔣᔣ⊤9。ᙠᐹ#T)=⚔AḄᐝ᯿7⁐î,᪷£⚔AᐝVḄß,SãTÈᐝ+Ḅ>ᔣ。6.3ᩞIᓟᐝ᯿T,ᐝVᩞW5ὅoSe,ᱥ#⊤☢ᩞW}ឋ.}8ØI]7⁐Ḅᐝ+8OØI]i´。®Direct3D*,ᩞWᵫ$᪀030^0^ᑿᓃ9⊤9,K$᪀Ḅ}©᝞:typedefstructD3DMATERIAL9-{D3DC0L0RVALUEDiffuse;D3DC0L0RVALUEAmbient?D3DC0L0RVALUESpecular;D3DC0L0RVALUEEmissive;floatPower;>D3DMATERIAL9,*LPD3DMATERIAL9;ᡂᕒL01£'36、Ambient、Specular,£@133196ᑖ⊤9ᱥ#⊤☢II]ᐝ、ú᛻ᐝ、☢I]ᐝ、)#ᐝḄI]jᦪ。8ÐQ0300010”&1Ḅ5`ḄL,ᐸÒD3DC0L0RVALUE-r,D3DC0L0RVALUE.g.D3DC0L0RVALUE.b^glJ^^S^tQ:.«、¬ᐝḄjᦪ。ôAᡂᕒ?0^6^w☢I]ᢣᦪ,ᓽ☢I]ᐝ᯿TU`T;bÒḄ~?0>^1ògᜧᐝ£ᕜLrªgᜧ。üU,EmiSSive⊤9ᱥ#)HḄ#ᐝ,ᵨJDU#ᐝR^,PQ)=ᱥ#Ḅ)#ᐝS¸÷ᐝ᯿T,.^SB/0ᐸ¦ᱥ#Ḅᐝ᯿。ᱥ#⚔AḄ7⁐LÙw:^Totalo^Arabient+^Diffusc+^Spccular+^Emissive/⊤9ᱥ#Ḅ7⁐ò,bᵨÒᦻ⊤9᝞:ᱥgḄX⁐ø<=ᱥgm᛻ᐝ+ᱥgmmᐝ+ᱥgmù☢mᐝ+@ᐝᙠFᱥ#åû,wKᵨᐝ᯿ᦔW,◀(ÖᵨᐝVå᜜,R◤⌕ᵨIDirect3DDevice9::SetMaterial(>>wᓽX⌻FḄᱥ#(ᩞW。᝞☢Ḅ9"ṹXìûᩞW(wØI]50%ªᐝ、80%«ᐝ60%¬ᐝḄᩞW。D3DMATEHIAL9mtrl; 82oooÎ6UZeroMemory(&mtrl,sizeof(D3DMATERIAL9));mtrl.Diffuse.r=0.5f;mtrl.Diffuse.g=0.8f;mtrl.Diffuse.b=0•6fjmtrl.Diffuse.a=1.0f;g_pd3dDevice->SetMaterial(&mtrl);0©^130jkᙠn$ᐝ᯿Tî,B᪷£3*ᐝ᯿TU`ᑖn$T,ᯠxXT$W`¹ᙠo®,Äw⚔AḄᐝ᯿7⁐ò。᝞Wᱥ#⊤☢¦Øn$I],ᑣ☢I]jᦪKìw0,Jî☢I]T´ᑮḄ7⁐òµᯠw0,^ᱥ#Sᐹᨵ☢I]ᦔW,PQ▭☢I]T·ᙠn$。Vw☢I]Tᨬᜧ,BIឋØ⌼ᡂõD,ᡠ8᝞Wᱥ#⊤☢Sᐹᨵ☢I]ᦔW,S⌕Öᵨ☢I]T。᝞WKᵨÑÔᨵᢣ}ᩞW}ឋ,jkXᵨÒAᩞW。ÒAᩞWI]ᡠᨵI]ᐝ,Ôᨵú᛻I]☢#],·Ôᨵ)#ᐝ7⁐。9:Tv^i3_ii_IDirect3DDevice9::GetMaterial(}>;Ììû(Ḅᩞa。6.4ᐝ᯿<ᩞ]^Mw8¹ᐝ᯿ᦔW,¦◤⌕(ᱥ#⊤☢ᩞW、(,ÖᵨᐝV。[ᡂᔜ*(x,ᐸ¤ḄÃÄᵫ8H〖30jk"Í。☢$ᔠ9Ñ5^£17§1^Í,CD᝞?Òᒹõ⚔AḄᔣ1ê。✌ᐜ}©ᒹõᔣḄ⚔A$᪀⚔Azb,᝞ᡠ9://⚔A$᪀⚔ᓲ,zbstructCUSTOMVERTEX{D3DXVECTOR3position;//⚔Aßᙶ᪗D3DXVECTOR3normal;//⚔Aᔣᨬ>}#defineD3DFVF_CUST0MVERTEX(D3DFVF_XYZ|D3DFVF_N0RMAL)ᙠ9Ñ$^1^161^᝞%Ò,iᐙ⚔A>?Ḅ"ṹ᝞://iᐙ⚔A>?CUSTOMVERTEX*pVertices;V_RETURN(g_pVB->Lock(0,0,(void**)&pVertices,0));for(DWORDi=0;K50;i++){floattheta=(2*D3DX_PI*i)/(50-l);pVertices[2*i+0].position=D3DXVECTOR3(sinf(theta),-1.0f,cosf(theta));pVertices[2*i+0].normal=D3DXVECTOR3(sinf(theta),0.0f,cosf(theta));pVertices【2*i+l】.posrtion=D3DXVECTOR3(sinf(theta),1.0f,cosf(theta))?pVertices[2*i+l].normal=D3DXVECTOR3(smf(theta),0.0f,cosf(theta));>g_pV3->Unlock();e8ÚÈ,ᙠ☢Ḅ"ṹÒ,SÈZ=⚔AḄßᙶ᪗,RÈᐸᔣ。 ᐝ᯿OOO832.(,ÖᵨᐝVᙠ9Ñ571^16^§᝞ÍÒᵨ5*óᐝ:>ᔣᐝú᛻ᐝ, >ᔣᐝḄ>ᔣSeLᣚ,^e8e8>ᔣᐝ>ᔣIᐝ᯿ᦔWḄ/0,᝞ᡠ9。//(ᐝVD3DXVECTOR3vecDir;D3DLIGHT9light;ZeroMemory(&light,sizeof(D3DLIGHT9));light.Type=D3DLIGHT_DIRECTI0NAL;light.Diffuse.r=1.0f;light.Diffuse.g=1.0£;light.Diffuse.b=1.0f;vecDir=D3DXVECTOR3(cosf(timeGetTime()/350.0f),1.Of,sinf(timeGetTime()/350.0f));D3DXVec3Normalize((D3DXVECTOR3*)&light.Direction,&vecDir);light.Range=1000.0f;g_pd3dDevice->SetLight(0,&light);g_pd3dDevice->LightEnable(0,TRUE);//ÖᵨᐝV//g_pd3dDevice->SetRenderState(D3DRS_LIGHTING,TRUE);//(ᐰþú᛻ᐝg_pd3dDevice->SetRenderState(D3DRS_AMBIENT0x00505050)?3.(ᩞWᙠ9Ñ5^ᕸ1^^ÍÒ(ḄᩞW¦I]ªᐝᑖ«ᐝᑖ,^ᱥ#⊤☢Ḅ7⁐wg⁐,☢Q(ᩞWḄ"ṹ。D3DMATERIAL9mtrl;2eroMemory(&rotrl,sizeof(D3DMATERIAL9));mtrl.Diffuse.r=mtrl.Ambient.r=1.0f;mtrL.Diffuse.g=rotrl.Ambient.g=1.0f;mtrl.Diffuse.b=mtrl.Ambient.b=0.0f;mtrl.Diffuse.a=mtrl.Ambient.a=1.0f;g_pd3dDevice->SetMaterial(&mtrl);Vw9Ñ5^ᕸ。§᝞1^Ôᨵn$☢I]ᐝ᯿,ᡠ8ᙠ☢(ᩞWḄ"ṹÒ,Ôᨵ(ᩞWḄ☢I]jᦪ。9:᝞WÒḄᱥ#ᐹᨵSḄᩞW}ឋ,ᙠFᱥ#û⌕ᑖwᐸ(ᩞW。9Ñ5^ô16[78᝞ÍḄ$ᦔW᝞6.6ᡠ9。èüUᑖ᪆9Ñ&0^^!^1^Ío»9Ñᢕ#01^åÿḄ。ᙠ9Ñ×^Dᓄ0!1Ò,ᡃÐz1ᢣ}⚔AḄI]7⁐ò,,µᶍᐝ᯿T,9Ñ5ᓄᕸ^§᝞ÍÔᨵw⚔Aᢣ}I]7⁐ò,Iw⚔A8¹+ᐗ²,,2vT´ᑮ⚔AḄI]7⁐。6.69Ñ57h1L§¦ᔴ$ᦔW 84oooÎ6U6.5vᐝ᯿<ᩞḄ@×1)ᐝ᯿TNOᐝ᯿1ᓝU`、ᐝV5`ᱥ#⊤☢ᩞW}=>☢。᦮=᯿TjkÛcᩖ,HᭆùÛi,IñÔᨵT!zẠḄ*zὅ,ᙠ1BᨵÞã。ᡠ8✌ᐜ◤⌕VÐWᐝ᯿TU`、ᐝV5`ᱥ#⊤☢ᩞWåÿḄὶj,8O8Ðᙠᐝ᯿TÒḄÄᵨQ,ᡈὅÛᙠᐝ᯿TÒ]^Ḅ⁐Q。ᯠxe82vÑ,Iᔜ*SḄêæn$st,e8ᐝ᯿ᦔW,¹Uᳮ。2)Vwᐹ#Ḅᐝ᯿TQᵫ01(^30ᙠᑁ%[ᡂḄ,IJÑᕒ,¦◤n$rᐵ(,JI*zὅᙠᳮB⌼ᡂo}ḄÞj。ᡠ8KìVÜW0»^^30jkᑁ%n$ᐝ᯿TḄᐹ#vÑ。KvÑᜧ#eᑖw5p,✌ᐜ┐IZ=AᐝVZᐝó,᪷£ᐸᐝV}ឋ,Tᐝ+ᑮ®⚔AᜐᐝḄ£,>ᔣᐝSd.ã⊦ï,ᡠ8µᶍJop;óBpQ᪷£☢´ᑮḄᐝḄ£wᱥ#⊤☢(ḄᩞW,ᵨrKḄᐝ᯿T;bT⚔AḄ7⁐^3)IJÒḄú᛻ᐝᨵ5=kV,oQ2vFG᝱(Ḅᐰþú᛻ᐝ,BQ2vZ=ᐝVÒḄú᛻ᐝ}ឋ(Ḅú᛻ᐝ。`Ú2vFG᝱(o=᦮#Ḅú᛻ᐝ,IJÒḄᔜ=ᐝV,S(ᐸú᛻ᐝ}ឋ,Vwᙠo=Ò,IJZ=ᱥ#ᐸ1ᑮḄú᛻ᐝKìr。ᡠ82vFG᝱(o=᦮#Ḅú᛻ᐝ,îÛ>¯,·¤ᔠ▭êæ。4)ᙠ01^830Ò,ᐝVᩞWQÎSᑖã、rÎÄᵨḄ5%ᑖ。ᐝVQrIJ᦮=Ḅ,ᩞWQrIñZ=ᱥ#Ḅ。5ὅrÎÄᵨ,ᐳ.}ᨬÐḄF$W。J᪵ÓᯠᮣR,PS᧕ᑴ,ᡠ8ᐝVᱥ#⊤☢ᩞWḄ(K¤ᔠRêæ。᝞,eXᐝV(wlᐝ,Xᔜ=ᱥ#ᩞWḄ7⁐(wᐸi7⁐,ìᯠ,w´ᑮᱯPḄᦔW,e8ᙠ)>☢n$ᜲn。6.6»✌ᐜCD01^830Òᐝ᯿TᡠNOḄᐝ᯿TU`、ᐝVᩞW¶ᑁ4,JQᳮᵨᐝ᯿ᦔWḄẠ。1ᩭ2v9Ñ^9ᐝ᯿ᦔWḄᐹ#ᵨ,,᪷£ÄὅḄòÈ|ᩩz{ᵨᐝ᯿ᦔWḄ`Ú8¸ὃ。Iñᐝ᯿ᦔW,ᙠᐹ#ᑏÑ"ṹî,¦◤⌕(ᐝV}ឋᱥ#⊤☢ᩞW}ឋ,ᐵÏQᳮ0»^(^30jkQ᝞ᔣᐝᐝV,KᐝV#È«⁐Ḅ☢I]ᐝ,,ÚᦋᩞW}ឋ,ᐸØTI]☢I]ᐝ,Öᵨ☢I]ᐝ᯿,e8ᐝ᯿ᦔW。 Î7Uᳮ᧜wFḄÚ®ᩭf¹i,^^p130ᙠᱥ#⊤☢¿ᑴ[ᳮḄØ。o[Ûᩭ,[ᳮQ⊤9ᱥ#⊤☢d⁚Ḅo©ᡈ|©BC,·7[ᳮc(texture)。ì[ᳮᢥ᯿ᱯ}Ḅ>b᧜]ᑮᱥ#⊤☢Ḅî᎛,Øᱥ#Úyf¹i。7.1ᳮᐗ4.ᳮᙶ᪗[ᳮrìJo©ß,e8X[ᳮßÚÄQo=BCᦪ,ᦪḄZ=ᐗ²7w[ᳮᐗ²,8?;ᨵo=7⁐ò。26ᙢñ,[ᳮ᧜]QX[ᳮß“c”ᑮᱥ#⊤☢。wXo©[ᳮßcᑮᱥ#⊤☢,◤⌕w⊤9ᱥ#Ḅi¼Ḅ⚔A([ᳮᙶ᪗。8"(^30ᵨḄ[ᳮᙶ᪗j,᝞7.1ᡠ9。17.1ᳮᙶ᪗(ûnᳮÆ1)wØTᜐᳮSᑖj᳛Ḅ[ᳮ,X[ᳮᙶ᪗n$öᓄᜐᳮ,å▲}ᙠ[0.0,1.0]ᑁ,J*[ᳮᙶ᪗▭Qo*rI[ᳮᙶ᪗。᝞,IJO、ᑖw100、80=²Ḅ[ᳮ,[ᳮᙶ᪗(0.05,0.05)IKJ[ᳮßÒḄó5ᑡ、ó4$。9:e8¦X[ᳮcḄo%ᑖ᧜]ᑮᱥ#⊤☢,᝞Xo=Z=⚗AḄ[ᳮᙶ᪗ᑖ(w(0,0.5)、(0,0),(1,0)、(1,0.5),B¦X[ᳮcḄm%ᑖ᧜]ᑮ⊤☢。7.2çᳮv[ᳮcᜧ-?;wᦻ,ᡠ8,⌕Uᵨ8Ð,_`07^830[ᳮI^,, 86oooÎ7UᐭᦻḄᑁ4。e8ᑭᵨ0309Ḅ030᱄0ᢇ1^0^^^^^ᓄ()ᦪ᪷£&?ᙠqÐÒḄᦻ_`[ᳮ,Kᦪ¿ᢝḄᦻ5`ᒹ!!^、.dds、.dib、0pg、øÍ8Or3¶。KᦪḄ¯᝞。HRESULTD3DXCreateTextureFromFile(LPDIRECT3DDEVICE9pDevice,LPCTSTRpSrcFlle,LPDIRECT3DTEXTURE9*ppTexture)?ᐸÒ:•ô069ᓄ6ᢣᔣ0ᓄ(^30(ᜓI^1ôḄᢣ┐•?310?116ᵨᩭ_`[ᳮḄᱏḄᦻÈ•??〒6᱄ᓃ『6±$ᡂḄ08A30ᳮv" ᢣ┐9:030᱄(316&16L6᱄ᓄ9?1^0^116()þᦪᙠᑁ¹9ÿᵨD3DXCreateTexture-ᓹ1^æᓹ(¸()Àᦪz¿mḄ。030€^386L6ÿAᓹ[011^116()ÀᦪḄ×Äp2ÅÆᦻ᫏。7.3ᳮ6ìFo=ᐗî,X82vᙶ᪗Lᣚ᧜]ᑮBCef。᝞Wᐗᨵ[ᳮ,R◤⌕᪷£[ᳮ;ÌᐗÒZ=²Ḅ7⁐。^[ᳮÒwZ=²;Ì7⁐ḄvÑ,7w[ᳮv(texturefUtering)00ᓄE130¿ᢝ4*[ᳮva>b,ᑖQᨬA¬᪵、+ឋ[ᳮva、ᔜᔣ´ឋ[ᳮvain[ᳮva。7.3.1ᨬA¬᪵ᨬA¬᪵Q4*va>bÒ¤ᨬüPᦔWᨬªḄva>b。0^^^3ôT´ᑮḄ[ᳮᐗ²ᙢᙬ23Qo=ôAò, ᦮ᦪḄ[ᳮ᪗ò,ìᵨᨬA¬᪵î,0»^^30Bcᑴ÷J=ôAòᙢᙬᨬ1 Ḅ᦮ᦪᙢᙬḄ[ᳮᐗ²Ḅ7⁐。☢Ḅ9"ṹX[ᳮj0Ḅ[ᳮva>b(wᨬA¬᪵,01^(^30ᨬi¿ᢝ8j[ᳮ。g_pd3dDevice->SetSamplerState(0,D3DSAMP—MAGFILTER,D3DTEXF_POINT);g_pd3dDevice->SetSarnplerState(0,D3DSAMP_MINFILTERrD3DTEXF_POINT);᝞W[ᳮḄᜧÞᐗᙠefµ9ḄḄ▭ᜧÞr,Ö¬ᵨᨬA¬᪵>IWḄ/0Sᜧ。PQ,᝞WᜧÞrª'i,Bµ/0W,ÈR⁐ᙽᡈstḄᜫiR^。7.3.2+ឋ[ᳮva+ឋ[ᳮvaQpûᵨᨬâ+Ḅ[ᳮva>。8÷ᨬA¬᪵r,ØᨵᦔᙢḄµ9W,,uIjkឋØḄ/0Sᜧ。+ឋ[ᳮvaÌ´÷T´ᑮḄ[ᳮᐗ²ḄôAᙢᙬᨬ1 Ḅ、、·、~4=[ᳮᐗ²,ᯠxIJ4=[ᳮᐗ²n$¹ᩗáᙳ,´ᑮᨬÐḄ7⁐ò。 ᳮ᧜OOO87☢Ḅ"ṹX[ᳮj0ḄÃᜧþÞvaᘤ^w+ឋ[ᳮva。g_pd3dDevice->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);g_pd3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);VwQᙠᓫo[ᳮjḄ+ឋva, Qᙠ^〃5=>ᔣḄ+ឋva,ᡠ87wz+ឋ[ᳮva。pû,ᜧiᦪµᓱh-w+ឋ[ᳮvan$Úᓄ,ᡠ8ᵨ+ឋ[ᳮva,o>☢e8;´ÛḄW,=o>☢IÑឋØ/0·Sᜧ。7.3.3ᔜᔣ3ឋ®ᳮ45ì}Cᱥ#⊤☢÷ᢗ/á☢Sá$î,8ᙠefḄᢗ/BÌÊ«ᡈvî,J*R^7wᔜᔣ´ឋ。ìo=ᔜᔣ´ឋᐗḄ²᧜]ᑮ[ᳮᐗ²î,8ḄGB#nvî。0©^130᪷£ef²IᔣÃᣚᑮ[ᳮᐗ²Ḅw«,.}ᔜᔣ´ឋÑ。☢Ḅ"ṹXÃᜧþÞva(wᔜᔣ´ឋ[ᳮva。g_pd3dDevice->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_ANISOTROPIC);g_pd3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_ANISOTROPIC);ᵨᔜᔣ´ឋ[ᳮvaî,RKì(ᨬᜧᔜᔣ´ឋÑò,ᨬᜧᔜᔣ´ឋÑòD3DSAMP_MAXANISOTROPY*lW,⊤9Ἥᵨᔜᔣ´ឋva。☢Ḅ9"ṹXᨬᜧᔜᔣ´ឋò(w4。g_pd3dDevice->SetSamplerState(0,D3DSAMP_MAXANXSOTROPY,4);Ä:ᙠ[÷ᨬᜧᔜᔣឋ#$,bp030€C?9᪀Ḅ^C^80b?7ᡂᕒ,pqA$[ᜓsᢝḄᨬᜧᔜᔣឋ0Ḅ²。Ä::=ᔜᔣឋᳮ.ឋᳮ5`☢=⌕ Ḅezᳮᔠᵨ,WßMᦔ®。7.3.467ú®ᳮ45in[ᳮQᵫoᑖj᳛⌲hiḄ[ᳮᑡᡂḄ,Zo[ᳮḄO-Qo[ᳮOḄom,᝞7.2ᡠ9。256X256347.2in[ᳮÄ:ᵨ030᱄06316L6^^ᓹ0ἄ^160ÀᦦçᳮvD,µ=:ðeᙢ$ᡂezᳮMᑡ,ᨬḄᳮ/0ᡈß0n1。 88oooÎ7U0&^130ᙠn$[ᳮ᧜]î,B)Î⌱ào©÷ᱥ#ᜧÞᨬ1 Ḅ[ᳮn$F。ìᨬе9Ḅ[ᳮcᜧÞCᐭ÷U5[ᳮåÿî,01^830ØTÌ´5[ᳮᐗ²n$gᔠxµ9,ᐹ#Ḅgᔠ>bᵫᢣ}Ḅin[ᳮva>b.}。(in[ᳮva>bḄ"ṹ᝞:g_pd3dDevice->SetSamplerState(0,D3DSAMP_MIPFILTER,Filter)?ᐸÒ,11Õe8Ì8ò:•D3DTEXF.NONE:ÙQᵨᨬoḄ[ᳮ。•D3DTEXF_P0INT.ᵨ÷ᐗᜧÞᨬᓛḄo[ᳮ。•D3DTEXF_LINEAR:X÷ᐗᜧÞᨬᓛḄ5[ᳮ8+ឋ>bn$gᔠ。i[ᳮvaQþÞÃᜧvaᘤ(Ḅ$ᔠ。᝞,᝞WXþÞÃᜧvaᘤ(w+ឋva,PQi[ᳮva>b(w0301£9?_?01·,8ᕸ【30B⌱à÷⌕µ9Ḅ[ᳮcᜧÞᨬ1 Ḅ[ᳮ,ᙠK[ᳮ[ᡂz+ឋ[ᳮva,,X$WÄw²Ḅò。᝞WXþÞ、Ãᜧvaᘤin[ᳮvaᘤ-(w+ឋva,ᑣ01"(^30Bᙠ5=ᨬ1 Ḅ[ᳮ-n$z+ឋ[ᳮva,ᯠxÙIrê5[ᳮIKḄ5=[ᳮ7⁐n$¹ᩗáᙳ,ᨬxḄ$WÄwᓫ=²ò。J*w;ÌᐗÒḄo=²Ḅ7⁐ò,$ᔠ5©[ᳮ、ᐳ8=²ḄᢈG,7w“}+ឋva”,Vw8ᙠ[ᳮḄ}=>ᔣ——u、▽[ᳮ-n$+ឋva。Re82v《^D300^(^9::585ᖾ^Û8£)>(▭Fî[ᳮvaḄᨬᜧᦪ,☢Ḅ9"ṹ(Ä[ᳮj0Ḅᨬᜧi[ᳮvaᦪw5。g_pd3dDevice->SetSamplerState(0,D3DSAMP_MAXMIPLEVEL,4);ᵨin[ᳮØTᨵᦔᙢF¤。ìᱥ#ãᢗ/e☢Ûäî,ô1^830B⌱àonXyÛÞḄ[ᳮn$F, N◤vcᩖḄÞ᝞ᔜ⚗´ឋḄ[ᳮva,,ᵫJJî[ᳮ◤⌕Ḅµ?Sᵨin[ᳮ⌕Þ,VûRØᨵᦔᙢï´[ᳮᐭµ?Ḅîÿ。7.4ᳮᙬi68^^30Ñe8w÷<ᐗḄ÷<⚔Aᢣ}[ᳮᙶ᪗。23[ᳮᙶ᪗ḄÌòQ[0.0,1.0]。PQ,2v(Kå᜜Ḅᙶ᪗ò,e8´ᑮᱯPḄ[ᳮ᧜]ᦔW。9:Óᯠe8X[ᳮᙶ᪗(w[0.0,1.0]å᜜Ḅò,PhØB▲ᑴ[ᳮᙶ᪗ḄÌòz。e8bÅ030[?59$᪀Ḅ^©×6^X6ô6&1ᡂᕒ}[ᳮᙶ᪗ḄÌò。[ᳮcᙬUbᑴ8830᝞<ᜐᳮ[0.0,1.0]å᜜Ḅ[ᳮᙶ᪗ò。8ᕸ130}©4*[ᳮcᙬUb,ᑖᵫD3DTEXTUREADDRESS5`ḄPp3⊤9,᝞ᡠ9:typedefenum_D3DTEXTUREADDRESS{D3DTADDRESS_WRAP=1,//@{[ᳮcᙬUbD3DTADDRESS_MIRROR=2,//[ᳮcᙬUbD3DTADDRESS_CLAMP=3,//ᜳÌ[ᳮcᙬUbD3DTADDRESS_BORDER=4//¼᪾7⁐[ᳮcᙬUb>D3DTEXTUREADDRESS? ᳮ᧜ooo897.4.1½8®ᳮ9ᙬ1ᵨ@`[ᳮcᙬUbî,8^830BᙠZ=᦮ᦪ[ᳮᙶ᪗ë1ᜐ)Î@c[ᳮ。᝞,᝞WKᵨÑ_`o=ì>ᐗ,,ᢣ}4=⚔AḄ[ᳮᙶ᪗w(0.0,0.0)、(0.0,3.0)、(3.0,3.0)(3.0,0.0)。᝞W^v>ᔣ-ᵨ@`[ᳮcᙬ,ᑣFᦔW᝞7.3ᡠ9。k#kkrAOW>w"Wkj^kkik^W^^J^%TK~kTW^W7.3@|[ᳮcᙬUbᑡḄ"ṹX[ᳮj0ᙠ^〃>ᔣḄcᙬUb(w@`[ᳮcᙬ。g_pd3dDevice->SetSamplerState(0,D3DSAMP_ADDRESSU,D3DADDRESS_WRAP);g_pd3dDevice->SetSamplerState(0,D3DSAMP_ADDRESSV,D3DADDRESS_WRAP);@᫃[ᳮcᙬQ'^830ÒḕḄcᙬUb,·Q}CjkÒᨬ3ᵨḄcᙬUb。ᙠFᐹᨵÞ᝞Ẉᜋå5[ᳮḄᱥ#î,᝞Wᵨo᦮nẈᜋḄ[ᳮc,BᓰᵨÛiḄᑁ?。 23¦◤ᐭonᐹᨵoᙽᡈiᙽẈḄÛÞḄ[ᳮc,Ù8ᢥ᯿@`[ᳮcᙬUbᙠᱥ#⊤☢᧜]iS,e8®ᑮᵨ᦮nẈᜋc᪵ḄᦔW。7.4.2;<®ᳮ9ᙬ1ᵨ[ᳮcᙬUbî,8"830BᙠZ=᦮ᦪ[ᳮᙶ᪗ë1ᜐ)Îcᑴ,Ã[ᳮ。᝞,KᵨÑ_`o=ì>ᐗ,,ᢣ}4=⚔AḄ[ᳮᙶ᪗w(0.0,0.0)、(0.0,3.0)、(3.03.0)(3.0,0.0)。᝞W^▽>ᔣ-¬ᵨ[ᳮcᙬUb,ᑣFᦔW᝞7.4ᡠ9。k^rAMirA^^^^^>T>ᔣḄcᙬUb(w[ᳮcᙬUb。g_pd3dDevice->SetSamplerState(0,D3DSAMP_ADDRESSU,D3DADDRESS_MIRROR);g_pd3dDevice->SetSamplerState(0,D3DSAMP_ADDRESSV,D3DADDRESS_MIRROR); 90oooÎ7U7.4.3ᜳÌ[ᳮcᙬUbᜳÌ[ᳮcᙬUb¦X[ᳮcᑴo,ᯠxX[ᳮ¼²Ḅ7⁐n$w。᝞,Ꮇ(KᵨÑ_`o=ì>ᐗ,,ᢣ}4=⚔AḄ[ᳮᙶ᪗w(0.0,0.0)、(0.0,3.0)、(3.0,3.0)(3.0,0.0)。᝞WX^v>ᔣḄ[ᳮcᙬUb-(wᜳÌ[ᳮcᙬUb,ᑣFᦔW᝞7.5ᡠ9。l[ᳮ᧜]xḄᦔW7.5ᜳÌ[ᳮcᙬUb☢Ḅ"ṹX[ᳮj0ᙠ^〃>ᔣḄcᙬUb(wᜳÌ[ᳮcᙬUb,g_pd3dDevice->SetSamplerState(0,D3DSAMP_ADDRESSUD3DADDRESS_CLAMP)g_pd3dDevice->SetSamplerState(0•D3DSAMP_ADDRESSV,D3DADDRESSCLAMP)7.4.4¼᪾7⁐[ᳮcᙬUbIJ¼᪾7⁐[ᳮcᙬUb,ì[ᳮᙶ᪗È[0.0,1.0]î,ᵨ¼᪾7⁐"/[ᳮ7⁐。¼᪾7⁐Q2v10^83006?^9:915&hᓄÛ716()>(Ḅ。☢Ḅ"ṹᢣ}¼᪾7⁐wª⁐,,([ᳮj0ᙠ^v>ᔣḄcᙬUbw¼᪾7⁐[ᳮcᙬUb。g_pd3dDevice->SetSamplerState(0,D3DSAMP_BORDERCOLOR,OxffffOOOO);g_pd3dDevice->SetSamplerState(0D3DSAMP_ADDRESSUfD3DADDRESS_BORDER);g_pd3dDevice->SetSamplerState(0D3DSAMP_ADDRESSV,D3DADDRESS_BORDER);JîFḄ$W᝞7.6ᡠ9。l[ᳮ᧜]xḄᦔW17.6j᪾X⁐ᳮᙬi6 ᳮ᧜OOO917.5ᳮ᧜]^M«☢$ᔠ9Ñ1^^68&^,CDwᱥ#⊤☢Kᵨ[ᳮ᧜]ḄvÑ。9Ñ×^¹^8&8ᓃ✌ᐜ_`o=ᐗ,ᯠxX[ᳮ᧜]ᑮ⊤☢。1..⚔"=>®ᳮᙶ᪗wØTX[ᳮ᧜]ᑮᱥ#⊤☢,✌ᐜ◤⌕wᱥ#⚔Aᢣ}[ᳮᙶ᪗。wnᡂᐹᨵ[ᳮᙶ᪗Ḅ⚔A,ᙠ9Ñ×^È^83µÒ}©᝞⚔A$᪀ᮣR⚔Azb。StructCUSTOMVERTEX{floatx,y,z;//⚔AßNfloatu,v?//⚔A[ᳮᙶ᪗>?#defineD3DFVF_CUST0MVERTEX(D3DFVF_XYZ|D3DFVF_TEX1)ᮣR⚔AzbÒḄ030?¥?_×£91⊤9⚔Aᒹõ1I[ᳮᙶ᪗,Vw0^^30ᨬi¿ᢝ8j[ᳮ,ᡠ8⚔Aᨬie8ᒹõ8I[ᳮᙶ᪗,Jî◤⌕ᵨ030^?o×£98。9Ñ×Dᔯ᝞56ÒᵨJFᐗḄ⚔Aᦪ£᝞。CUSTOMVERTEXg_Vertices[}={{-3,-3,0,0.0f,1.0f>,{-3,3,0,0.0f,0.0f>,{3,-3,0,1.0f,1.0f>,{3,3,0,1.0f,0.0f}}?2.ÒH®ᳮµ@9Ñ1^0^8356᪷£ìûp2Ḅ^11.^?ᦻnᡂ[ᳮI^,,]%rK[ᳮI^1ôḄᢣ┐,"ṹ᝞。V_RETURN(D3DXCreateTextureFromFile(g_pd3dDevice,L"wall.bmp",&g_pTexture));3.2.ýï®ᳮᙠᵨ[ᳮåû,◤⌕ᐜ(ìûᵨḄ[ᳮI^。ᙠ9Ñ×80»^3386Ò(ìû[ᳮḄ"ṹ᝞。g_pd3dDevice->SetTexture(0,g_pTexture);4.2.®ᳮᐵA᝱[ᳮrᐵG᝱ᒹ[ᳮva>b、[ᳮcᙬUb、[ᳮ▤fgᔠG᝱。J[ᳮrᐵG᝱◤⌕┐IZ=[ᳮ▤fᑖn$(,ᵨJᑴZ=[ᳮ▤fḄrᐵvÄ。9Ñ×^0^68&µX[ᳮj0ḄÃᜧþÞvaᘤ(w+ឋ[ᳮva,X[ᳮ▤fgᔠ>(w⌱à[ᳮ7⁐Äwìû[ᳮ▤fḄÒÈ,ᐸ¦[ᳮG᝱¬ᵨÒAò,"ṹ᝞。//([ᳮva>bg_pd3dDevxce->SetSaTOplerState(0,D3DSAMP_MAGFILTERrD3DTEXF_LINEAR);g_pd3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);/^(N[ᳮgᔠ>g_pd3dDeva.ce->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOPSELECTARG1); 92oooÎ7U[ᳮ▤fgᔠG᝱ᙠo⁚RX*dCD。5.F[ᡂrᐵ(x,e8F,FḄ"ṹ᝞。g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX);g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);9Ñ×610«^8&86Ḅ$ᦔW᝞7.7ᡠ9。7.79Ñ×6-0^8&$6Ḅ$ᦔW6.³Ã[ᳮI^ᨬx,ᙠÑḄ$kû◤⌕³Ã_`Ḅ[ᳮI^,"ṹ᝞。SAFE_RELEASE(g_pTexture);7.6ᳮ▤¢£ᔠf᝱[ᳮ᧜]ḄWQ᪷£[ᳮ8Oᐸ¦V²}ᐗ²Ḅ7⁐。[ᳮ▤fgᔠG᝱ᵨJᢣ}ìû[ᳮ▤f[ᳮ7⁐ò1?[^òḄgᔠ>。0^^130[ᳮgᔠvÄX7⁐ḄX082⍝ᓄ©32⍝ᑖn$ᜐᳮ。7.6.1[ᳮ▤fgᔠG᝱([ᳮ▤fgᔠG᝱ᵫ10L(^3006¥^9:9^513865〖&16()>(,K>Ḅ¯᝞。HRESULTSetTextureStageState(DWORDStage,D3DTEXTURESTAGESTATETYPEType,DWORDValue);ᐸÒ:•3L396ᢣ}ìû(Ḅ[ᳮj10(ᨵᦔò0〜7)。•179&ᜓ(Ḅ[ᳮFG᝱。•▽3106(ḄG᝱ò,ᵫ¸ᦪ×7?6.}KᦪòḄÌò>õ©。 ᳮ᧜OOO933ᵨḄ[ᳮFG᝱,ᓽ3ᵨḄ030×£911^£5×0£5××£×v?£Pp3᝞。•030×55_001^0X0?ᢣ}[ᳮ7⁐Ḅgᔠ>,931ûò}J030×£᱄7^X£0?Pp5`,IJóoj[ᳮ,KFG᝱ḄÒAòQ030×0?3400ô[£,ᐸ¦[ᳮjKFG᝱ḄÒAòQ03070?_01581£。•030×55_0^0XX01[ᳮ7⁐gᔠḄóo=¸ᦪ,93—ò}J030×5`3,ÒUSD3DTA_TEXTURE,ᓽ[ᳮ7⁐。•030×55_(^^0XX027⁐gᔠḄóB=¸ᦪ,¥&^ò}J030×5`3,ÒAwD3DTA_CURRENT,ᓽûo=[ᳮjḄÒÈ7⁐。ì51386¶J0î,93ᓃ6òwD3DTA_DIFFUSE,ᓽ²ḄI]7⁐ò。•030×55^^1^110?ᢣ}[ᳮjḄᔞ1^ògᔠ>,9&1ûò}J030×Ä᱄1^X£0?Pp5`。•D3DTSS_ALPHAARG1Òᓃ3gᔠḄóo=¸ᦪ,¥&1ûò}J030×5`3,ÒA^D3DTA_TEXTURE,ᓽ[ᳮ7⁐ø^^ò。•D3DTSS_ALPHAARG2AlphagᔠḄóB=¸ᦪ,931ûò}J030×5`3,ÒA^D3DTA_CURRENT,ᓽûo=[ᳮjÒÈ7⁐Ḅᓺᓃ&ò。ì51&86¶J0î,wD3DTA_DIFFUSE,ᓽ²I]7⁐Ḅ1?&3ò。3ᵨḄ[ᳮ▤fgᔠ>,ᓽ3ᵨḄ0301£1ô&£0?Pp3ℏ᝞。•D3DTOPJDISABLEἭᵨK[ᳮj7⁐ÒÈ。•D3DTOP_SELECTARGlXK[ᳮjḄóo=gᔠ¸ᦪz1ÒÈ。•D3DTOP_SELECTARG2XK[ᳮjḄóB=gᔠ¸ᦪz1ÒÈ。•D3DT0P_M0DULATEX5=gᔠ¸ᦪrýxÒÈ23,([ᳮ7⁐&082⍝gᔠvÄḄ"ṹᜧ᝞。pd3dDevice->SetTextureStageState(x,D3DTSS_C0L0RARG1,argl);pd3dDevice->SetTextureStageState(1,D3DTSS—COLORARG2,arg2);pd3dDevice->SetTextureStageState(i,D3DTSS_C0L0R0P,op)?ᐸÒ1w(Ḅ[ᳮj,31^1wóo=gᔠ¸ᦪ,&【92wóB=gᔠ¸ᦪ,0£)wgᔠ>。7.6.2®ᳮ▤DEᔠA᝱Ä¢☢2v9Ñ1^^1&86©&&^9[ᳮ▤fgᔠG᝱Ḅᵨ,KѦ^9&032⍝Ḅgᔠ>。々1?1^2⍝Ḅgᔠ>5D,Xᙠo»n$^9。9Ñ1^^1&§13Ò([ᳮ▤fgᔠG᝱Ḅ"ṹ᝞。g_pd3dDevice->SetTextureStageState(0,D3DTSS_C0L0R0P,D3DT0P_M0DULATE);g_pd3dDevice->SetTextureStageState(0,D3DTSS_COLORARGl,D3DTA_TEXTURE)•g_pd3dDevice->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE);g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHA0P•D3DT0P_DISABLE);☢Ḅ"ṹᢣ}X[ᳮ7⁐ò⚔AI]7⁐òrýxÒÈ,,Ἥᵨᓄ'vÄ。ᵫJ1^51Í&1ᦊᢣ}¦ᵨᓫj[ᳮ,Vû,óo=[ᳮj(ᓽóo=[ᳮ▤f)Ḅ7⁐ÒÈQᨬÐḄ7⁐。ᐸÒ⚔AI]7⁐òQᵫI]ᐝ᯿T´ᑮḄ,VwRᵨᑮᐝ᯿T,ᡠ8⚔A◤⌕ᒹõ+1ê。9Ñ×651&816ᵨḄ⚔A$᪀⚔Azb᝞。StructCUSTOMVERTEX 94oooÎ7UD3DXVECTOR3position;"⚔Aßd.D3DXVECTOR3normal;//⚔A+floattu,tv;//⚔A[ᳮᙶ᪗>?#defineD3DFVF_CUST0MVERTEX(D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)9ÑÒḄᐸ¦ᑁ4,᝞8¹⚔Aᦪ£、(Lᣚ▣、(óᐝᩞW¶,ᙠû☢Ḅ9ÑÒ-CDv,ᙠûSÙF。Ñ$ᦔW᝞7.8ᡠ9。7.89Ñ1^^1%65&&$ᦔWᙠK9ÑÒ,Z=²ḄᨬÐ7⁐Qᵫᐝ᯿7⁐[ᳮ7⁐ᐳ}Ḅ。e8ÛIJ}CÑ(T,ᡠᨵḄvÄᨬÐ-Qw´ᑮZ=²Ḅ7⁐,ᓽ²ᨬе9Ḅ7⁐,ᑮpûwÑᨵ83*êæ。óo*êæ:Sᵨóᐝ、ᩞW[ᳮ。ᐗ⚔AḄ7⁐z1Ì)ᙠ⚔Aᦪ£Ò(Ḅ7⁐,᝞Wᙠ⚔Aᦪ£ÒÔᨵᒹõ⚔A7⁐,ᑣÒAwl⁐。ᨵᐗ⚔AḄ7⁐,᪷£Ḽ⁐Ub,2vò´ᑮZ=²Ḅ7⁐。ó4»ó5»ÒḄ9Ñ}JJ*êæ。óB*êæ:ᵨóᐝᩞW,PSᵨ[ᳮ᧜]。ᙠJ*êæ,ᐗ⚔A7⁐Ì.Jᐝ᯿T,ᵫᐝ᯿T´ᑮ⚔A7⁐x,᪷£Ḽ⁐Ub,2vò´ᑮZ=²Ḅ7⁐。ó6»ÒḄ9Ñ}JJ*êæ。ó}*êæ:ᵨ[ᳮ᧜]。ᙠJ*êæ,²Ḅᨬx7⁐Ì.J[ᳮ▤fgᔠG᝱,ᐹ#ÛÌ.Z=[ᳮ▤f7⁐vÄ>5=7⁐¸ᦪḄᩭV,J·ìQ⁚CDḄᑁ4。Qᵨ[ᳮḄ9Ñ-}ñJ*êæ。[ᳮ▤f7⁐gᔠÛcᩖ,⁚ᵨoj[ᳮ,ᡈὅÛ¦ᨵo=[ᳮ▤f,o⁚XBCDij[ᳮ᧜]。7.7eᳮ᧜2vij[ᳮ᧜],^>7"^30ØTᙠo=FvÑÒij[ᳮ7⁐@Sgᔠ,Fᑮo=ᱥ#Ḅ⊤☢。ij[ᳮgᔠvÑ᝞7.9ᡠ9。2v7.9e8ÚÈ,8j[ᳮQ⌲jgᔠ。·QÛ,ᨬi◤⌕8=▤f[ᡂ[ᳮ᧜], Z=▤f-Qän$Ḅ。┐IZo▤f,-◤⌕(rKḄ7⁐ò01^òḄgᔠ>¶[ᳮ▤fgᔠG᝱。o=[ᳮjrìJo=[ᳮ▤f,Vûij[ᳮ᧜]ᨵî·7w ᳮ᧜OOO95i▤f[ᳮgᔠ。ᐸÒ,QᔲKᵨ[ᳮj1~7,ᓽQᔲn$1〜7[ᳮ▤fḄvÄ,ᵫKᵨÑᢣ},PQ8ÐḄ⌱à Qᢥ<Ḅ。óoj[ᐗ²Ḅ7⁐I]7⁐·QÛ,ᙠÔᨵᵨó11jḄêæ,SØᵨó^+1j。ÒAêæ,óo=[ᳮ▤f(▤f0)ḄÒAgᔠ>Q03_?o—;ᐸ¦[ᳮ▤fḄÒAgᔠ>Q030×0?_015^[£。ᓽÒAêæ07(^30ᵨᓫj[ᳮ᧜]¿ᑴ,◀[ᳮj0᜜,[ᳮj1〜7-QἭᵨḄ。☢$ᔠ9Ñ^^“!^^^,CD᝞<ᵨij[ᳮ᧜],MuhiTexture*Ñ^95j[ᳮ᧜]Ḅᵨ。1.(ᜓhbÅᙠᵨij[ᳮ᧜]åû,KKᐜÅDìû(ᜓᨬiØ¿ᢝ|j[ᳮgᔠ。9Ñ901〖0^«^ÒḄÅD"ṹ᝞。if(caps.MaxTextureBlendStages<2)returnE_FAIL;ᨬ34X⁐179eᳮ£ᔠ2([ᳮ9Ñp0^1Jᵨ5j[ᳮ,ᡠ8◤⌕ᑖw[ᳮj0[ᳮj1([ᳮ,"ṹ᝞。pd3dDevice->SetTexture(0,g_pTexturel);pd3dDevxce->SetTexture(1,g_pTexture2);3.([ᳮjᙶ᪗@AwXij[ᳮ᧜]ᑮᱥ#⊤☢,◤⌕wZj[ᳮᢣ}ᡠ⌕ᵨḄ[ᳮᙶ᪗。ᔜj[ᳮe8ᵨrḄ[ᳮᙶ᪗,·e8ᵨSḄ[ᳮᙶ᪗。᝞W◤⌕ᵨSḄ[ᳮᙶ᪗,Öᙠ⚔Aᦪ£Ò◤⌕ᒹi[ᳮᙶ᪗,ᯠx2v@AwZj[ᳮᢣ}ᵨ[ᳮᙶ᪗。9ÑMUltiTexture([ᳮjOᵨóO[ᳮᙶ᪗,[ᳮj1ᵨó1[ᳮᙶ᪗,"ṹ᝞。pd3dDevice->SetTextureStageState(0,D3DTSS_TEXCOORDINDEX,0);pd3dDevice->SetTextureStageState(1,D3DTSS_TEXCOORDINDEX,1);9ÑMultiTextu^e,ᵨḄ⚔Azb⚔Aᦪ£᝞。//⚔A$᪀ᮣR⚔AzbStructCUSTOMVERTEXr3.0f,3.0f,0.0f0xffffffff0.0f,0.0f,0.0f,0.0f>,.0f,-3.0f,0.0f,Oxffffffff,1.0f,1.0f,1.0f,1.0f},•Of,3.0f,0.0f,Oxffffffff,1.0f,0.0f,1.0f,0.0f>Û:ÈJ^9ḄpḄ,ᙠ9ÑMultiTexmreÒ(5[ᳮᙶ᪗, Zj[ᳮᑖᵨo[ᳮᙶ᪗。PQ▭,J5[ᳮᙶ᪗ò[ᐰr,ᡠ8᝞Wᢣ}5j[ᳮ-ᵨo[ᳮᙶ᪗,Ñ$ᦔW[ᐰr。/ὅ·e8ᦋLᐸÒo[ᳮᙶ᪗,5j[ᳮᵨSḄ[ᳮᙶ᪗,ÚoᦔW᝞<。4.([ᳮgᔠ>9ÑMUltiTextureÒ([ᳮjgᔠ>Ḅ"ṹ᝞。•D3DTSS_COLOROP,D3DTOP_MODULATE);0,D3DTSS__COLORARGl,D3DTA_TEXTURE);pd3dDevice->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA__DIFFUSE)?0,D3DTSS_ALPHAOP,D3DTOP_DISABLE);1,D3DTSSCOLOROP,D3DTOP—MODULATE);1,D3DTSS__COLORARGl,D3DTA_TEXTURE);pd3dDevice->SetTextureStageState(1,D3DTSS_COLORARG2,D3DTA_CURRENT);pd3dDevice->SetTextureStageState(1,D3DTSSALPHAOP,D3DTOP_DISABLE);☢Ḅ"ṹᐜXᱥ#ḄI]7⁐÷[ᳮj0Ḅ[ᳮ7⁐rý,´ᑮḄ$WÙ÷[ᳮj1Ḅ[ᳮ7⁐r¹xÒÈ,îἭᵨ0|^2⍝gᔠ。9ÑMUltiTextu^eᐹ#Rd⁚èÅÚV"ṹ。K9ÑᵨḄ[ᳮcO$ᦔW᝞7.10ᡠ9。□□b)c)7.10ij[ᳮ᧜]ᦔWÛ:9Ñ^117×^ÈᵨḄ5©[ᳮᑖQú[ᳮᐝ᯿[ᳮ,2vóBjᐝ᯿[ᳮU⌲²ᐝ᯿ᦔW。JQᙠ}CÑÒ3ᵨḄo*ᢈ。7.8Þ$ᙠ[ᳮ᧜]Ò,[ᳮ¬᪵Q⌲²n$Ḅ,ᐝ᯿Q⌲⚔An$Ḅ。0ᓄ^30ᐜn$ᐝ᯿ ᳮ᧜OOO97,ᯠxn$[ᳮ᧜]。[ᳮ᧜]Ḅ@AãAQ[ᳮ▤fgᔠG᝱,[ᳮ▤fgᔠG᝱Ḅ⌕ÄᵨQᑴ[ᳮ7⁐÷²lᩭ7⁐Ḅgᔠ>。Zᳮ[ᳮ▤fgᔠG᝱ḄᐵÏ,QVÜW01^(^30FOà+Q᝞b,,Iᑖ᪆F$W。3.Úᦋ9Ñ1^^ᓄ&^,X⚔AḄ[ᳮᙶ᪗ᑖÚᦋw(0,0)、(0,3),(3,3)(3,0),,¬ᵨSḄ[ᳮcᙬ>b,eÑ$$W。4.Úᦋ9×^513§&1&&,(SḄ7⁐gᔠ¸ᦪgᔠ>,e8Ñ$$W。 Î8U08□^30MNᢈ§»ÒCD1^gᔠ、oᓄᜐᳮ8OU᩽st}*3ᵨḄ07"^30Fᢈ。ᐸÒ1?1^gᔠ⌕ᵨJRmnᱥ#ḄF,oᓄᜐᳮeUi&ÒḄoᓄᦔW,UrstQo*3ᮣRḄFᢈ,eᵨJRi*ᱯPᦔW。8.1C1ᓹ3£ᔠᙠû|»CDḄ9ÑÒ,¿ᑴḄ7⁐ÙQ/ᣚìû7⁐>?Ò?ᙠḄ7⁐ò,V x¿ᑴḄᱥ#ÙQ⌚6ᙠlᨵᱥ#。QìU⌕¿ᑴ5DJWᴻ、à¶ᐹᨵnᦔWḄᱥ#î,J*>µᯠgS⌕Õ。e82v1?^gᔠRJ*nᦔW,}©o=⊤9ᱥ#mnḄ1k&ò,᪷£mnT;b,e8X⌕¿ᑴḄᱥ#7⁐÷7⁐>?Ò?ᙠḄ7⁐rgᔠ,^¿ᑴÈᐹᨵmnᦔWḄᱥ#。▭,ᙠû☢⍗ᑮv1?1^òḄᭆù,᝞$᪀030€010X911^ÒḄᡂᕒL3,PQᙠû☢Ḅ9ÑÒÔᨵᵨKᡂᕒL,VwRÔᨵ¾R01^gᔠ,,1k&òÙQÌØòw1.07(AlphaòÒAwl.Of,⊤9[ᐰSn)。8.1.13gᔠlᳮ0^^gᔠ᪷£bTgᔠåxḄ7⁐。Color=(RGBSK•Ksrc)OP(RGBdst.KdJᐸÒ:•ColorAlphagᔠxḄ7⁐ò•X6^V7⁐ò•^^Vgᔠjᦪ•᝘^p᪗7⁐ò•&51p᪗gᔠjᦪ•0᧎ᔠ>Alphagᔠ;bÒḄVgᔠjᦪp᪗gᔠjᦪQ2vD3DBLENDPp3ᢣ}Ḅ,gᔠ>Q2vD3DBLENDOPPp3ᢣ}Ḅ,ÒAwD3DBLENDOP_ADD。I01^gᔠᨬýḄᵨQ:KsrcØòwD3DBLEND_SRCALPHA,ᓽìû¿ᑴ²Ḅ1?'ò,fcKdJRffi*D3DBLEND_INVSRCALPHA,pô1ïyìû¿ᑴ²Ḅ1?1^ò;ffiOPSKfi^D3DBLEND_ADD,VT$W7⁐>?T$Wr¹,("ṹ᝞。 08「830MNᢈ§ooo99g_pd3dDevice->SetRenderState(D3DRS_BLENDOP,D3DBLENDOP_ADD);gjpd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);᪵ᩭ,C01^£ᔠX⁐ḄÜ6{nColor=(RGBsrc.Alpha^)+(RGBdst•(—Alphasrc))à☢Ḅ[÷:¼ᙢiØᜧeᦪC×ᱥgḄᦔ®。9:Ò1^gᔠSþ▲JRmnᦔW,2vᑴgᔠ>gᔠjᦪe8RfiḄᦔW。ᨵᐵ0308ᓃ£、00303[£~00ᓹPpḄ*dᑁ4,èÅ▅ᦻ᫏。8.1.2@3gᔠjᦪᙠ☢ᑮv,03Vgᔠjᦪ23(w03081^^_5X0[?1^,ᓽìû¿ᑴ²Ḅ01^ò,p᪗gᔠjᦪ(wD3DBLEND_INVSRCALPHA,pô1ïyìû¿ᑴ²ḄAlphaft。Öìû¿ᑴ²Ḅᓺ1^ò-Q᝞<´ᑮḄᕖ?ᙠ8^^30Ò,øᓄòQÄw7⁐Ḅo=ᑖ?ᙠḄ,ᡠ8}Z=²Ḅ7⁐òî,î·}ìû²Ḅᓄ“ò。Z=²Ḅ7⁐òQ᝞<}Ḅ,ᙠó7»ÒᡃÐn$Ù$。◤⌕ᢣÈḄQ,IJ[ᳮ᧜],7⁐Ḅ0&8ᑖø1^ᑖQᑖn$TḄ。☢2v9Ñ01^816“^9᝞<ᵨ01^gᔠRmnᦔW。8.1.3Alphagᔠ9•]^MC1381^4ᙠ]^M76v^^83u(Î7U)Ḅ)ẠàᦋxᡂḄ,9ᵨC×Ḅᩞ,ᐹᨵᳮḄ2<×X⁐ᔠᙠà。1.Öᵨ©3gᔠ¥Z¦§C13£ᔠἭᵨḄ,ᡠ✌ᐜ◤⌕ᓄ£ᔠ,9ṹ᝞。g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);9:øᓃ3gᔠ:├Ûᜧ,ᡠ8¦ᙠ◤ḄêæÖᵨÒ1^gᔠ。ì¿ᑴ[mnḄᱥ#åx,KìOîᐵy01^gᔠ。2.(0©3gᔠjᦪgᔠ>9ÑAlphaBlend(AlPhagᔠ>gᔠjᦪḄ"ṹ᝞。g_pd3dDevice->SetRenderState(D3DRS_BLENDOP,D3DBLEND0P_ADD);g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);à9ṹḄᐹgJᙠ$☢REzḄ,ᙠRÒ5。3.(ᩞW]^MC01^81ᢕ4᪷¸MAḄD1,ᩞḄC11^0.0⌲{n1.0,xiØ13Àᦔ®,5NuF,9ṹ᝞。alpha+=(timeDelta*O.0003f);if(alpha>=0.0f) 100oooÎ8Ualpha=0.0f;ᐸÒ〖71^01w5åÿḄîÿÿ◞,ᓫßw。〖78ᖾḄᐹ#T>,8O(ᩞWᐝVḄ*dêæ,èÅÚV"ṹ。4.([ᳮḄÒ^^gᔠ>9Ñ01^8©“X[ᳮḄ01^gᔠ>(w^²ḄI]7⁐;Ì1?1^ò,"ṹ᝞。g_pd3dDevice->SetTextureStageState(0,D3DTSS__ALPHAOP,D3DTOP_SELECTARGl);g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);9Ñ01^8161^Ḅᐸ¦ᑁ4ÔᨵᱯPḄᙢ>,ᐹ#Rd⁚èÅÚV"ṹ。$ᦔW᝞8.1ᡠ9。8.19Ñ1?1^81᝞(1$ᦔWW]:AÜ×ÊᨵeᱥgD,bAᐜUᑴ5C×Ḅᱥg,ᯠ`ᢥ᯿âᑮḄ¤MUᑴC×Ḅᱥg。]^MC01^81᝞(1ᯠbᵨ ᳮ,|=ᳮ᧜ḄC0&&£ᔠm[÷nA$34ḄmX⁐Alpha,ᡠC1?1^¯▭àᩭcw[÷Ḅᩞ。:=ᳮ᧜ḄC1?»^£ᔠm[÷nᳮC0ᓃ3,Aᯠ$WA$ᵨḄᳮᐹᨵCᓄ1^9⍝,ᔲᑣÒzᨵѹᦔ®。U]^ML^ᡷAC01^Î] ᳮC1?ᓃ3Ḅ¦§,ᐸÊ[÷ᳮ᧜ᓹ1^£ᔠmḄ9ṹ᝞。•g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHA0P,D3DTOP_SELECTARG1);g_pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);◀[ᳮ᧜]¬ᵨSḄᓺ1^gᔠ>å᜜,9Ñ×6«^^1^41^81611^r。9Ñ1^^»^^1k8ᙠ⊤☢co©᪛Ḅ[ᳮ,ᙠK[ᳮÒ,Ôᨵ᪛â᪛Ḅᙢ>01^òw0,ᓽ[ᐰn,ᐸ¦ᙢ>Sn,$ᦔW᝞8.2ᡠ9。·e8X[ᳮ᧜]Ḅ01^gᔠvÄ(w[ᳮᓺ&3ìû²I]7⁐11^&òḄ)*,᝞XBὅrý。è/ὅ)ÅstJ*Ꭵæ。 0(^30MNᢈ§ooo1018.29Ñ×6-0^ᖹ3$ᦔW8.2¬ᓄᦔ®oᓄᦔWQT!zÒKᵨᨬâḄᦔWåo,8Sص℉ᙢ½¹féᦔWḄiÆ,,e8o}ḄUÆ。ᙠîÑ,ᱯQabÑÒ,w&jkḄ$¤,:#ᕒiiᙠßJe8AäᜐḄᵨÛwᓫḄ}CU`,stS¿ᑴᱥ#,ᙠᜐᵨcᩖU`,J᪵eØ⌼ᡂᱥ#L、ᯠÈRᡈᯠ_ᜫ¶ᜫiR^,oᓄᦔWe8ᨵᦔᙢäJ*ᜫiR^。8.2.1HᓄᦔÔJKLᳮoᓄQ2vXᱥ7⁐÷oḄ7⁐n$gᔠRḄ,ᐹ#gᔠ>᝞。Color=f-Color$ence+(l-f)•ColorfogᐸÒ:•^^/^ᨬÐvoᓄᜐᳮḄ7⁐•0/0^_ᱥ#lᩭḄ7⁐•/0、MÊäJḄ¬ḄX⁐•/oᓄV^☢ḄoᓄT>e8ÚÈ,oᓄᦔW⌕Ì.JoᓄV。oᓄVd.e8AḄ.ã ⊦ï,ᐸ⊦ïöÌ.JoᓄUb。88303*oᓄUb,ᵫ030?0^^00£Pp5`⊤9,ᔜPp3Oᐸõ©᝞。•D3DFOG_NONEἭᵨoᓄᦔW。•D3DFOG_LINEAR+ឋoᓄ,oᓄVḄ⊦ïö᝞。ᐸÒ,^^^/⊤9oᓄ:+A$kAᑮe8AḄ.ã,^/⊤9ìûTAᑮe8AḄ.ã,µᯠoᓄgᔠV/^d.ã^Ḅ½¹+ឋ½¹。*D3DFOG_EXP^^^ft,oᓄVḄ⊦ïö᝞。 102oooÎ8$ᐸÒ,^⊤9ìûTAᑮe8AḄ.ã,᝞/⊤9oḄ。oᓄV^d.ã^ᢥᢣᦪöLᓄ。•030?00』9?2ᢣᦪá>oᓄ,oᓄVḄ⊦ïö᝞。ᐸÒ,^⊤9ìûTAᑮe8AḄ.ã,L/⊤9oḄ。oᓄgᔠV/^d.ã3ᢥᢣᦪá>ḄöLᓄ。0^^830✌ᐜ᪷£(ḄoᓄUbOrKḄ¸ᦪToᓄV/,•ᯠx᪷£oᓄV^oᓄT;bTᱥ#ḄᨬÐ7⁐。^}*oᓄUbIKḄoᓄV⊦ïöe8ÚÈ,ᱥ#.ãe8Agä,/gÞ,ᱥ#l⁐gÞ,oᓄ7⁐gi,ᱥ#gU。01830¬ᵨ5*>n$oᓄᜐᳮ:⚔Aoᓄ²oᓄ。⚔AoᓄQᙠ8830⚔Aᙶ᪗Lᣚᐝ᯿Oà+▤fRḄ,8᪷£ᱥ#i¼Z=⚔Aᑮe8AḄ.ãTZ=⚔AḄoᓄÑ,ᯠxᙠi¼☢᪷£T$Wn$ò,´ᑮZ=²AḄò。²oᓄQᙠ0^^^30²¿ᑴ▤fRḄ,8᪷£Z=²rIJe8AḄUToᓄᦔWò。÷⚔Aoᓄr,²oᓄTfwÖ,Pî·ὑâfiḄjktV。²oᓄ·7w⊤zoᓄ,Vw)(ᜓᑭᵨ⚜ᐜTḄ⊤zn$ÅÆ8}oᓄV。8.2.2M³NḄHᓄIJ⚔Aoᓄ,ᙠÒAêæ,oᓄVT;bÒḄ.ã^wᱥ#ᙠe8ᙶ᪗jÒḄUò,Jᙠ)êæBᜫi。᝞,ᙠo=Òᨵ、85=ᱥ#,8Ð÷e8AḄ.ãr,^ᳮàÛ,8ÐKᐹᨵrḄoᓄᦔW,ᯠ 8[^130ÒA88Ðᙠe8ᙶ᪗jÒḄUò(ᓽ2ò)Äw4,ToᓄᦔW,VûBᱥ#8ḄoᓄᦔWµS,᝞8.3ᡠ9。•@18.3)wÀ0Ḅ¬ᓄᜐᳮ1w.☢ḄE⚪,8^(^30w⚔AoᓄJḄoᓄᜐᳮ,ᙠñḄoᓄᜐᳮÒ,ᵨᱥ#e8AåÿḄ▭.ãÄw¸ᦪ^ToᓄV,V oᓄᦔWfÖ,P"PQTᜧ。JḄoᓄᦔW᝞8.4ᡠ9。⌕ᵨᓟḄoᓄ,K✌ᐜbÅìû(ᜓQᔲ¿ᢝKØ,ᯠx¾RJḄoᓄᜐᳮ,bÅ"ṹ᝞。 !6(^30MNᢈ§ooo10318.4)w²Ḅ¬ᓄᜐᳮif(stCaps.RasterCaps&D3DPRASTERCAPS_FOGRANGE)g_pd3dDevice->SetRenderState(D3DRS_RANGEFOGENABLE,true);8.2.3HᓄᦔÔÄ¢☢ᔠ]^M?%,Î]᝞¹nÜ×òb¬ᓄᦔ®。1.OPHᓄᦔÔ01A^30ᙠ¥Z¦§Ἥᵨ¬ᓄᦔ®,ᡠn"#Ü×òb¬ᓄᦔ®,✌ᐜ◤⌕¬ᓄᜐᳮ,9ṹ᝞。g_pd3dDevice->SetRenderState(D3DRS_FOGENABLE,true);2.2.Hᓄ1vw⚔@¬ᓄ,¬ᓄi6ᵫMNf᝱D3DRS_FOGVETREXMODEÇᑴ。vw34¬ᓄ,¬ᓄi6ᵫMNf᝱D3DRS_FOGTABLEMODEÇᑴ。]^M?%ᵨᢣᦪ⚔@¬ᓄi6,ᐸ[÷9ṹ᝞。g_pd3dDevice->SetRenderState(D3DRS_FOGVERTEXMODE,D3DFOG_EXP);3.2.HᓄQᦪ¬ᓄᦪᒹ¬ḄX⁐<ᵨwB¬ᓄ4¼^Ḅ/ᐵᦪ。(1)[÷¬ḄX⁐.¬ḄX⁐90305_?000^0 MNf᝱[÷。]^MF0g=¬ḄX⁐[÷n×X⁐,9ṹ᝞。g_pd3dDevice->SetRenderState(D3DRSFOGCOLOR,D3DCOLOR_XRGB(45,50,170));(2)[÷B¬ᓄ£ᔠ4¼^Ḅ/ᐵᦪn BÀ¬ᓄ£ᔠ4¼C◤⌕᪷¸⌱þḄ¬ᓄBÜ6,ᵨ/ᐵḄMNf᝱[÷vbḄ¬ᓄᦪ。ᐹgᒹ,nឋ¬ᓄ[÷?L<O2$,5nᢣᦪ¬ᓄ<ᢣᦪ¬ᓄ[÷¬Ḅ%0。MNf᝱D3DRS_FOGSTARTḄÎ_ᦪ"&32L᦮ᦪ,ᡠ[÷¬Ḅ?L2$<ᨬᜧ2$D,◤⌕'Ï(;ᣚn0〜010)5`,᝞ᡠ]。staticfloatfogStart=20;//+ឋᓄ:+ß 104................................................................................................................................oooÎ8UstaticfloatfogEnd=100;//+ឋoᓄ$kßg_pd3dDevice->SetRenderState(D3DRS_FOGSTART,*(DWORD*)&fogStart);g_pd3dDevice->SetRenderState(D3DRS_FOGEND,*(DWORD*)&fogEnd);FG᝱D3DRS_FOGDENSITYᵨJ(ᢣᦪoᓄUbᡈᢣᦪá>oᓄUbḄo,wôAò,Ìòw0.0〜1.0。9Ñ?Í(oḄḄ"ṹ᝞。//(oḄstaticfloatfogDensity=0.02f;g_pd3dDevice->SetRenderState(D3DRS_FOGDENSITY,*(DWORD*)&fogDensity);9Ñ?%ᙠᙢ☢Fñᙊ,ᐸ$ᦔW᝞8.5ᡠ9。8.2.4IoᓄᦔWḄ|AÛ1)ᙠ(oḄ7⁐î,eXoḄ7⁐ú7⁐(wo。J᪵,äᜐḄᱥ#Ú®ᩭQ⌲ᐭúåÒ,féᦔWÛ$i^。᝞,ᙠ»Ḅ9ÑÒ,XoḄ7⁐(w¬⁐(9ÑÒú⁐w¬⁐),SQRÒḄl⁐。2)ᙠoᓄ¸ᦪÒ,oḄ:+.ãᨬᜧ.ã¦I+ឋoᓄᨵᦔ。oḄ¦I8.5oᓄᦔWᢣᦪoᓄᢣᦪá>oᓄᨵᦔ。3)Vw10&(^309:'1&^᝞Ûᦊ()>ḄóB=¸ᦪ5`w0〜0X0,ᡠ8oᓄ¸ᦪ(oḄ7⁐◀᜜)Ḅ(SØz1ᵨᦪò,ᵨL,᝞☢Ḅ"ṹQ┯Ḅ。g__pd3dDevice->SetRenderState(D3DRS_FOGSTART,20);g_pd3dDevice->SetRenderState(D3DRS_FOGEND,100);g_pd3dDevice->SetRenderState(D3DRS_FOGDENSITY,0.02);☢Ḅ"ṹÓᯠØT2v,PQJ᪵(Ḅoᓄ¸ᦪ,Sì,V ·´Sᑮᡠ◤⌕ḄoᓄᦔW。IJ*zὅ,JQo=Û4᧕Ḅ┯, Û◚,S᧕#R。4)NàQ⚔AoᓄRQ²oᓄ,ᙠÑÒ- (ᔠ〉Ḅᢗ/Lᣚ▣,8&oᓄᦔWì。J᪵,IÖSᵨ⚔Aᙶ᪗Lᣚᐝ᯿Oà+ḄÑÒ8¹oᓄᦔW⌼ᡂo}ḄÞã,SvJ*êæSi。*8.3i³´ᙠ01^(^30ÑÒ,e8ᑭᵨUrstᩭÎ᝱ᙢᑴQᔲ¿ᑴÒḄ)²,^RoᱯPḄᦔW。8.3.1UrstvÑUrstᵨUr¸ὃò、Ur¡ṹ、UrÛᦪ8Oìû²ᙠUr>?ÒIKḄUròÄw¸ᦪ。᝞W2vUrst,ᑣ¿ᑴK²,,ᢥ2vUrstḄ(}fᦋUr>?;᝞WèØ2vUrst,ᑣS¿ᑴK²,,ᢥè2vUrstḄ(}fᦋUr>?。UrstḄpᑖw8}p。 08□30MNᢈ§ooo1051)XUr¸ὃòUr¡ṹn$ᢥß÷(AND)。2)Xìû²ḄUròUr¡ṹn$ᢥß÷(AND)。3)᪷£(}ḄUrÛᦪ,Ûp1p2ḄT$W,´ᑮUrstḄ$Wò:TRUEᡈFALSE02vᑴUr¸ὃò、Ur¡ṹUrÛᦪ8OUrstᡂᡈᜫ}în$ḄvÄ,e8ᑴUr>?ᡈὅ7⁐>?ḄvÄ。ᐹ#vÑ᝞8.6ᡠ9。18.6i³´8.3.2Ur>?2v☢ḄUrstvÑe8ÚÈ,IZ=²n$Urstî,◤⌕²IKḄUrò。Z=²ḄUrò&?ᙠUr>?Ò,ᡠ8wᵨUrst,✌ᐜ◤⌕w07^^930(ᜓI^_`Ur>?,,(IUr>?Ḅᔜ*vÄ。ᙠ_`07^(^30(ᜓî,X030ᡞ!^5>^7^>X^×£X5$᪀Ḅ8006ᓹ516¹11?0¹ᡷᡂᕒ(w⊤8.1ÒḄ÷Uo=ò,᝞030?p102458,Bᙠ_`U>?Ḅî_`Ur>?,,XU>?ÒḄo%ᑖÄwUr>?ᵨ。ᙠ8ûḄ9ÑÒ,X8006?0^6᝞£0¤vᡂᕒ(w030?}^_016,ᡠ8Ôᨵ_`Ur>?。_________________________⊤8.1eᵨUr>?ḄU>?²zb_________________________²zb_______________________________Û_____________________________________D3DFMT_D15S1²zbw15ßUò1ßUròD3DFMT_D24S8²zbw24ßUò8ßUròD3DFMT_D24X4S4²zbw24ßUò4ßUròD3DFMT_D24FS8²zbw24ßUò4ßUrò,KU>?SØᵨ。<^()>¹┝_`Ur>?åû,K✌ᐜÅDìû(ᜓQᔲ¿ᢝᡠ(ḄUr>?zb。ᑡ"ṹxDìûh(ᜓQᔲ¿ᢝ31¿ᢕ6Ä001^ᢣ}ḄUr>?zb,0030nᢣᔣÿ8930"ôḄᢣ┐。if(FAILED(pD3D->CheckDeviceFormat.(pCaps->AdapterOrdinal,pCaps->DeviceType,AdapterFormat,D3DUSAGE_DEPTHSTENCIL,D3DRTYPE_SURFACE,StencilBufferFormat))) 106oooÎ8UreturnFALSE;n 𶣷ᙢzi³´,ᙠMNTc$,◤⌕)◀àca[ᙠi³Z[ÊḄi³。*◀i³Z[<*ÆX⁐Z[、À0Z[Vᵨ10^^1300〜8<^9:+1^^)¨。᝞☢Ḅ9ṹᡠ],ᙠ^G5ᦪÊᒹ0300^^_5L£(^^,î,ᑣ⊤]*Æi³Z[,ᨬ`ᦪᢣä=i³Z[ḄT34*Æn¹,ᙠRn0。☢Ḅ9ṹwD*ÆX⁐Z[<À0Z[。pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER|D3DCLEAR_STENCIL,D3DCOLOR_ARGB(0,0,0,255),1.0f,0);Û:ᙠᓹ^^^(9Òz☢Ur>?Ḅᱯឋ,ᵨz☢Ur>?e8ï´Ur¦tSᦪ,^ ½¹jk᡻$¤。ᙠÒÔᨵᵨz☢>?;ᨵᐵKᱯឋḄd⁚,èÅÚᦻ᫏。8.3.3Urst(ᵨUrstRᔜ*ᦔWḄᐵÏQì(÷UrstrᐵḄᔜ*FG᝱,UrstrᐵFG᝱·Q2v10^D30067^9:911^816·30>(Ḅ。÷UrstrᐵḄ3ᵨFG᝱᝞。•D3DRS_STENCILENABLEᑴQᔲÖᵨUrst,ÒAwFALSE。•0301^_5×^^[^^?(Ur¸ὃò,ÒAw0。•D3DRS_STENCILMASK(Ur¡ṹ,.}IUr¸ὃòUr>?òḄßn$•Û,ÒAw0£777[{【1•D3DRS_STENCILWRITEMASKᢣ}ᑏᐭUr>?ÒḄᦪòḄ¡ṹ,ÒA¡ṹwOxffffffff。•D3DRS_STENCILFAIL(Urstᜫ}îḄUrvÄ。•030&5_5×£^^^(2vUrst,PUstᜫ}îḄUrvÄ。•D3DRS_STENCILPASS(2vUrstîḄUrvÄ。•0305』L£>^11^1^€ᢣäᵨwi³´ḄA¼Àᦪ。ᐸÊ$☢MNf᝱A¼íᓫ,☢u@-.`☢MNf᝱。MNf᝱D3DRS_STENCILFUNCᢣäi³´ḄA¼Àᦪ,:nD3DCMPFUNCjℏ#,ᔜj5ᐸJ÷⊤8.2。⊤8.2UrstÛᦪ________________Ûᦪ________________________________________________________Û.__________________D3DCMP_NEVERÙQ]%FALSED3DCMP_LESS¸ὃòÞJ§?ÒḄIK¨î,]%×X⑶D3DCMP_EQUAL¸ὃò¶J>?ÒḄIKòî,S0TRUED3DCMP_LESSEQUAL¸ὃòÞñ¶J>?ÒḄIKòî,]%×&。£D3DCMP_GREATER¸ὃòᜧJ>?ÒḄIKòî,]%צ1;£D3DCMP_NOTEQUAL¸ὃòS¶J>?ÒḄIKòî,]×&™D3DCMP_GREATHREQUAL¸ὃòᜧJ¶J>?øḄIK©î,]%×&ô£D3DCMP_ALWAYSÙQ]%×X1^FG᝱D3DRS_STENCILFAIL、D3DRS_STENCILZFAIL%D3DRS_STENCILPASSS 01「60^30MNᢈ§ooo107©Urst、Ustᜫ}ᡈ2vîn$ḄUrvÄ,ÌòwD3DSTENCILOPPp5`,ᔜPp3Oᐸõ©q⊤8.3。⊤8.3UrvÄò_____________UrvÄ________________________________________Û____________D3DSTENCILOP_KEEPÒA⌱⚗,SfHUr>?ÒḄòD3DSTENCILOP_ZEROXUr>?ÒḄò(w0D3DSTENCILOP_REPLACEᵨUr¸ὃò/ᣚUr>?ÒḄIKòD3DSTENCILOP_INCRSAT½¹᥎r>?ÒḄIKᦪò,᝞Wvᨬᜧò,ᑣ¶JᨬᜧòD3DSTENCILOP_DECRSATïÞUr>?ÒḄIKᦪò,᝞WÞñᨬÞò,ᑣ¶×ᨬÞòD3DSTENCILOP_INVERT᎔Ur>?ÒḄIKòḄᦪ£ßD3DSTENClLOP_INCR½¹Ur>?ÒḄIKᦪò,᝞Wvᨬᜧò,ᑣ¶J0D3DSTENCILOP_DECRïÞUr>?ÒḄIKᦪò,᝞WÞJ0,ᑿ¶JᨬᜧòIJZ*UrvÄ,030€?59$᪀Ḅ5Ã110Í8ᡂᕒ-ᨵo=rKḄ᪗¤÷åIK,᝞᪗D3DSTENCILCAPS_KEEPIKUrvÄD3DSTENCILOP_KEEP。e82vJ(ᜓ᪗¤bÅìû(ᜓQᔲ¿ᢝ)*UrvÄ。8.3.4á☢▢/☢2v9Ñ?1&H51^(10〜^9UrstḄᐹ#Kᵨ。KÑRá☢▢/ᦔW,J*5`Ḅ▢/¦Qo*ᩗ¬åT,ÓᯠØT½£ḄiÆ,PQᐸᦔWS᝞▢/#。▢/#ḄR·◤⌕Urst。ᨵᐵ▢/#Ḅᐹ#R,èÅ▅ᐸ¦tᧇ。1.▢/rḄ}wRá☢▢/,✌ᐜ◤⌕}ᱥ#ᢗ]ᑮ)o=á☢ÒḄ▢/r。á$ᐝAᐝVonḄ▢/᝞8.78.8ᡠ9。8.7á$ᐝonḄ▢/8.8AᐝVonḄ▢/᝞8.7ᡠ9,᝞W⍝á$ᐝḄ>ᔣᢗ/á☢,e8TÈᱥ#ᔜ⚔Aᙠᢗ/á☢Ḅᢗ/A,^·}ᱥ#ᙠᢗ/á☢Ḅ▢/r。᪵,᝞8.8ᡠ9,᝞W⍝AᐝVḄßᢗ/á☢,SãTÈᱥ#⚔Aᙠᢗ/efḄᢗ/A。Ꮇ(ᢗ/á☢Ḅá☢>Ñjᦪᵨ40ᔣ(~,AV~W⊤9,,Ꮇ}á☢Ḅᔣöᓄ。ᵨ40ᔣ1=(/,,/,,^)⊤9á$ᐝḄ>ᔣᡈAᐝVḄß,IJá$ᐝX/-(w0,IJAᐝVX^(w1。$ᮦ=(,nytnz,d)•(/x,/y,lz,lw)=nx•lx+ny•ly+ny.ly+d•lw 108oooÎ8Uᑣ:ᵨ᝞▢▣=ᱥg⚔@;ᣚnᙠC×☢àḄᢗ@。nxK+knxlynJznAnylxnyly+knylzᕷ^zKnzlynzlz+k^zKdlxdlydIz030᱄WX 030&1ᕸ51^^0Àᦪᵨwç▢▣,'ÀᦪḄô×᝞ᡠ]。D3DXMATRIX*D3DXMatrixShadow(D3DXMATRIX*pOut/CONSTD3DXVECTOR4*pLight,CONSTD3DXPLANE*pPlane)?ᐸÊ:•900(±$ᡂḄ▢▣,•?119ᓃ1:AᐝVḄßᡈá$ᐝḄ>ᔣ;•?ᓹ13Ḅᢗ/á☢。2.ᵨUrst■ÑBSᔠ}▢/rx,ᵨnw50%Ḅ|⁐ᩞWᙠᢗ/á☢¿ᑴ▢/r,e8´ᑮ▢/ᦔW。VweØÈRi=ᱥ#(ᡈoᱥ#Ḅi=%ᑖ)Ḅ▢/rÎ@`Ḅêæ,Ö@{ḄrBÌiSᔠ,^ Ú®ᩭâᨩ。.J=E⚪e82vUrst.。XUrst(w¦1óoSn$¿ᑴḄ²。ᓽᙠᔣx'>?¿ᑴ▢/î,IrKḄUr>?òn$᪗µ,µ2¿ᑴvḄ▢/r,᝞WtÙSᙠ¿ᑴvḄ▢/rᑏᐭ▢/²î(¿ᑴ@`%ᑖḄ▢/îBÈRJ*êæ),Ubstᜫ},^äBSᔠ。3.á☢▢/9ÑḄR☢#À]^M?13^(^^Ḅᐹg¯°,'Mᙠᙢ☢àMNᙊ15ᐸ▢,Óᐝᔣ5N{ᓄ,x▢~ḄL÷5N{ᓄ。¯°▢MNḄᐰ¹9ṹVÚᑮäJḄ᝞“6+᜜^^23(1^()ÀᦪÊ,'ÀᦪḄv᦮9ṹ᝞。voidRenderCylinderShadow(){//Urst(g_pd3dDevice->SetRenderState(D3DRS_STENCILENABLE,true);g_pd3dDevice->SetRenderState(D3DRS_STENCILFUNC,D3DCMP_EQUAL);g_pd3dDevice->SetRenderState(D3DRS_STENCILREF,0x0);g_pd3dDevice->SetRenderState(D3DRS_STENCILMASK,Oxffffffff);g_pd3dDevice->SetRenderState(D3DRS_STENCILWRITEMASK,Oxffffffff);g_pd3dDevice->SetRenderState(D3DRS_STENCILPASS,D3DSTENCILOP_INCR);//1k3gᔠ(g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);g_pd3dDevice->SetRenderState(D3DRSSRCBLEND,D3DBLEND_SRCALPHA);g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);//ᨚîᐵyUstg_pd3dDevice->SetRenderState(D3DRS_ZENABLE,false); 08□“30MNᢈ§ooo109//᪀⌼,(á☢▢/▣D3DXVECTOR4lightDirection=D3DXVECTOR4(g_vecLightDir.x,g_vecLightDir.y,g_vecLightDir.2,0.0f)?D3DXPLANEgroundPlane(0-0f,-1.0f,0.0f,0.0f)?D3DXMATRIXA16S,matWorld;D3DXMatrixShadow(&S,&lightDirection,&groundPlane);matWorld=g_matCylinderMatrix*S;g_pd3dDevice->SetTransform(D3DTS_WORLD,&matWorld);//(▢/ᩞWSetShadowMaterial();//¿ᑴ▢/g_pd3dDevice->SetStreamSource(0,g_pCylinderVB,0,sizeof(CYLINDERVERTEX));g_pd3dDevice->SetFVF(D3DFVF_CYLINDERVERTEX);g_pd3dDevice->DrawPrimitive(D3DPT—TRIANGLESTRIP,0,2*50-2)?//ÖᵨUst、ᐵyUrst、Ἥᵨù01^gᔠg_pd3dDevice->SetRenderState(D3DRS_ZENABLE,true);g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE•false);g_pd3dDevice->SetRenderState(D3DRS_STENCILENABLE,false);>✌ᐜÚoUrst(。XUr¸ὃò(w0><0,UrÛᦪ(w030€^>_EQUAL,2vUrstḄUrvÄ(wUrò¹1。:+FZoî,Ur>?ÌÜ0,ᡠ8ì✌Sᑏᐭ▢/Ḅ²î,ÙQ2vUrst,V ᑏᐭ▢/²,,IKḄUrò½¹w1。ìÙSᙠrḄßᑏᐭ▢/²î,VwIKḄUròw1,Ur¸ὃòw0,Urstᜫ},▢/²SÌᑏᐭx'>?,^äBSᔠ。Vw▢/Ìᢗ/ᑮᙢ☢,ᙠᙢ☢¿ᑴ▢/îeØBÈRUõ,ᡠ8ᨚîἭᵨUst。ᐸ¦"ṹ,᝞▢/▣Ḅ᪀⌼、Ò“gᔠ(8O▢/ᩞWḄ(,ÔᨵᱯḄᙢ>,SÙ³。ᨬxᙠ¿ᑴ[▢/åx,ឮcÖᵨUst、ἭᵨUrst1?1^gᔠ。ᐸ¦Rd⁚,èxÚV"ṹ,$ᦔW᝞8.9ᡠ9。8.9á☢▢/ 110oooÎ8U9:IJUrstᨵ5A◤⌕ᱯüU:oQᙠ_`07"(^30(ᜓîS⌕uµᢣ}Ur>?zb,BQᙠFîS⌕uµÜUr>?,ᐹ#>q8.3.2Þ⁚。J5A4᧕µf, ┯Û◚,S᧕Ì#R。8.4Þ$C¨1^£ᔠ<¬ᓄᦔ®:;12MÊiju⌕ḄO☢。vwC01^£ᔠḄᐵᳮᐸ)©ᳮ?,,ᙠMN▢D5ᨚDᐵ=À0´,MAᦔ®。 Î9U·5i>ᙠû☢|»Ḅ9ÑÒ,-Q2vÑ"ṹ᪀`oᓫḄ}C|)ẠDirect3DS©i¼yzU`1ôID3DXMesh,⊤9cᩖḄ}Cᱥ#U`。J*U`23QᵫᜧḄ}²1ᡂḄyz(mesh)U`,᝞9.1ᡠ9。ID3DXMesl^PöD)ID3DXBaseMesl^^ô,ID3DXBaseMesl^^ôᜐᳮyzU`ḄØ。9.1ᚆ±ḄyzU`9.1.1ûüº»103098Û1^8&1ôᒹõo=⚔A>?(ᵨJ?;yz⚔A)o=@A>?(.}⚔AK8<*ᔠ>b᪀ᡂyzḄ}ᓫᐗ)。e8ᵨ8>´ᑮᢣᔣJ1ôḄᢣ┐。HRESULTID3DXBaseMesh:;GetVertexBuffer(LPDIRECT3DVERTEXBUFFER9*ppVB);HRESULTID3DXBaseMesh::GetIndexBuffer(LPDIRECT3DINDEXBUFFER9*ppIB);:A30᱄^^ᓃ" üsᢝ]ᓄḄ:82ᑡ⊤mn)1ᐗ=>,ᓽ9]ᓄḄ:82ᑡ⊤Uᑴ·5i>。᝞WU┝}J>?,ᯠxn$/ᑏvÄ,e8ᵨ᝞>。J>┝}ḄQ᦮=⚔A>?ᡈ@A>?。HRESULTID3DXBaseMesh:sLockVertexBuffer(DWORDFlags,LPVOID*ppData);HRESULTID3DXBaseMesh::LockIndexBuffer(DWORDFlags,LPVOID*ppData);¸ᦪ³&88ᵨJᢣ}᝞]%î,ôô0»3ᢣᔣÌ┝}ᑁ?Ḅᢣ┐Ḅᙢᙬ。ìI┝}Ḅᑁ?[ᡂvÄx,◤&ᵨrKḄ┝>,᝞ᡠ9。HRESULTID3DXBaseMesh::UnlockVertexBuffer()?HRESULTID3DXBaseMeshjsUnlockIndexBuffer()? 112oooÎ9U☢Q10308&5^^©1ôḄᵨJ;Ì|<1êḄᐸ¦o>。•DWORDGetFVF();±B⚔@56Ḅ0〜00=>。•DWORDGetNumVertices();]%⚔A>?Ò⚔AḄᦪ。•DWORDGetNumBytesPerVertex();]%Z=⚔AᓰᵨḄÜ⁚ᦪ。•0%0¦0061@0^ᕸ();]%yzÒ(})☢ᱏḄᦪ。9.1.2yz}ឋ>?yzU`ᵫo=ᡈi=ᡂ。(subset)QyzU`Òoe8ᵨr}ឋn$FḄ}ᓫᐗ。J3ᡠÛḄ}ឋQᢣᩞW、[ᳮFG᝱。9.2Û᝞yzU`ÒḄZ=}☢ᱏ-Ì+to=}ឋ-,K1ôᢣ}K☢ᱏᡠ}Ḅ。᝞,^9.2e8ÚÈ,᪀ᡂᙢrḄÖ}☢ᱏḄ}ឋ10ᙳw0,⊤J☢ᱏ}J0。5DḄ,᪀ᡂᜋ¶ḄÖ}☢ᱏḄ}ឋ-ᙳw1,⊤J☢ᱏ}ñ1。}☢ᱏḄ}ឋ10Ì?;ᙠyzḄ}ឋ>?Ò,}ឋ>?▭Qo=0”0X05`Ḅᦪ。ᵫJZ=☢ᱏᙠ}ឋ>?Ò-ᨵIK⚗,ᡠ8}ឋ>?Òᐗ²Ḅ=ᦪ÷yzU`Ò☢ᱏḄ=ᦪr¶。 }ឋ>?ÒḄÖ⚗÷ᙠ@A>?Ò}©Ḅ}☢ᱏQooIKḄ,ᓽ}ឋ>?ÒḄó/⚗IKJ@A>?ÒḄó7=}。ó/=}Ḅ}=⚔AQᵫ@A>?ÒḄ᝞}=@Aᢣ}Ḅ,9.39UJ*ᐵj。A=i*3B=i*3+1C=i*3+2ឋZ[}}1}"-----------P^4-----------<—~>]Z[20222393@A>?Ò}©Ḅ}÷}ឋ>?Òᔜ⚗ḄIKᐵj᪷£9.3´,}}J0,}1}J4,}《}J2。 ·5i>ooo1139.1.3ê11êIyzU`n$)ᜐᳮ(᝞yzU`Úᓄ)î,◤⌕⍝IJ÷U}Ḅ}☢ᱏ÷☢ᱏrê1。Jê11ê-?;ᙠyzU`Ḅê1ᦪÒ。ᵫJZ=}-ᨵ}ᩩ¼,Z=}☢ᱏᨬieᨵ3=ê1},ᡠ8ê1ᦪÒᐗ²Ḅ=ᦪwyz☢ᱏᦪḄ3ë。ê1ᦪÒᐗ²Ḅ5`w0〜0&0,Z=ᐗ²᪗yzÒ)=}☢ᱏḄ@A。ᐸÒ÷ó^=}ê1Ḅ}Ḅ@A,IKJê1ᦪÒḄ8}=ᐗ²,᝞9.4ᡠ9。=i*3B=i*3+1C=i*3+2ᐗ²@A012345678ê1ᦪTriOTnlTn2194½"º»]á1üU,᝞Wê1ᦪÒ)=ᐗ²¶J4294967295(ULONG_MAX,N¤32ß᦮ᦪḄᨬᜧò),ᑣ⊤9yzÒ)oᱯ}¼Ôᨵê1☢ᱏ。·e8XK⚗(w_1⊤9J*êæ,VwXo=1)”01^)5`ḄLØòwo1÷·òw1;1^^(}o1^9¶ᦔ。¡i0309yzᦪØTÒÈê1ᦪ,·e8z1ᵨ8>wyzU`nᡂê11ê。HRESULTID3DXBaseMesh:sGenerateAd^acency(FLOATEpsxlon,DWORD*pAd3acency);•£ᓹ^1011—=ÞḄìᦪò,ᢣ}᝞W5=⚔AåÿḄ.ãÞJK¸ᦪᢣ}Ḅò,ᑣAwJ5=Awo=A。•?¥&(^^^?;ê11êḄᦪ,ᵨJ]nᡂḄê11ê。9.1.4¿ᑴyzU`103£0^38^8ᓃ1ô0^o5&᝞()>ᵨJ¿ᑴyzU`Ḅo=,K>Ḅ¯᝞。HRESULTDrawSubset{DWORDAttribId);¸ᦪPÈ^1ᢣ}⌕¿ᑴḄyz。᝞W⌕¿ᑴ᦮=yzU`,◤⌕¿ᑴyzU`Ḅᡠᨵ,23ᵨ5D☢Ḅ"ṹF᦮=yzU`。 114oooÎ9Ufor(inti=0;iSetMaterial(mtrls[i]);//w½(3ᩞᡠpDevice->SetTexture(0,textures[i]);//wᦻ([ᳮMesh->DrawSubset(i);//¿ᑴ½>9.1.5±◖yzU`ᨵî◤⌕nᡂyzU`Ḅ¹,Jîe8ᵨ8>。HRESULTID3DXBaseMesh::CloneMeshFVF(DWORDOptions,DWORDFVF,LPDIRECT3DDEVICE9pDevice,LPD3DXMESH*ppCloneMesh);ᐸÒ:•0?ᓃ01^_`yz¹îḄ᪗µᡈ᪗µᔠ。3ᵨḄ᪗µ᝞,᪗µ⌱⚗Ḅ[᦮ᑡ⊤,è¸▅50Nᦻ᫏ÒḄ0309^^^Pp5`。■D3DXMESHo32BITyzU`Xᵨ32ß@A_0309Ê£51!o^^^^0yzU`ᦪ£XÌ?;ᙠᡲ¶ᑁ?Ò■D3DXMESHoWRITEONLYᢣ}yzU`ᦪ£w¦/■D3DXMESHoDYNAMICyz>?XᵨÎ᝱ᑁ?•?9?ᢣ}ᡠ⌕_`Ḅyz¹Ḅ⚔Azb•ô069ᓄ6÷_`Ḅyz¹ᐵὶḄ0^830(ᜓ•¼(^01^^3ᓃÒÈᡠ_`Ḅyz¹ᵨCl¢meMeshFVF()>_`yz¹î,yz¹Ḅ⚔Azbe8lᩭyzU`Ḅ⚔AzbS。᝞lyzḄ⚔Azbw030?9?_9v2,_`o=⚔AzbwD3DFVF_XYZID3DFVF_NORMALḄyz¹,e8ᵨ8"ṹ。ID3DXMesh*pCloneMesh=NULL;Mesh->CloneMeshFVF(Mesh->GetOptions(),//ᵨlyzrḄ⌱⚗D3DFVF_XYZ|D3DFVF_NORMAL,Device,&pCloneMesh);9.16_`yzU`0309030᱄(^&ᓄp68ᓃ?9?()ᦪ,ᵨJ_`o=“”ḄyzU`I^,KᦪḄ¯᝞。HRESULTD3DXCreateMeshFVF(DWORDNumFaces,DWORDNumVertices,DWORDOptions,DWORDFVF,LPDIRECT3DDEVICE9pD3DDevice,LPD3DXMESH*ppMeshᐸÒ¿1^3063¿^62^1068ᢣ}}☢ᱏ⚔AḄᦪ;0?L±01^ᢣ}_`yzîᵨḄ᪗µ,q00^^^1^^^>ḄÛ,?9?ᢣ}_`ḄyzÒ⚔AḄᮣR⚔Azb, ·5i>OOO115•pD3DDevice÷_`ḄyzrᐵὶḄDirect3D(ᜓ;•ppMeshᵨJ]%_`ḄMzU`I^。0309(^316^81^^0ᦪw⚔A>?、@A>?}ឋ>?ᑖᜧÞᔠ〉Ḅᑁ?。ᯠxe8ÃiᐭyzḄᦪ£,ᓽ◤⌕X⚔A、@A8O}ឋᑖᑏᐭ⚔A>?、@A>?}ឋ>?Ò,µᯠJSQo½¾Ḅ×Ä。ᡠ823SᵨJ=>_`Ḅyz,Qᵨ03090^*jᑡᦪ_`⊤9ᓫ<#ḄyzU`,ᡈὅ^qÐᦻ_`yzU`,1ᩭḄ5⁚XᑖCDJ5%ᑖᑁ4。9.2íᓫ¹g<:;ᦻ·5i>0309#ᦪ?,oᦪᵨJ_`⊤9ᓫ#8O}CᦻḄyzU`。IJ¿ᑴᓫḄ|<#8O}Cᦻ,JᦪQ3ᨵᵨḄ。9.2.1_`ᓫ|<#yzU`0309?6=ᵨJnᡂᓫ30|<#yzU`Ḅᦪ,J6=ᦪw:•D3DXCreateBox_`o=«>#yz•D3DXCreateCylinder_`o=ᙊ#yz•D3DXCreatePolygon_¤o=i¼yz•D3DXCreateSphere_`o=ᳫyz•D3DXCreateTeapot_`o=ₐyz•D3DXCreateTorus_`o=úî☢yzF6=ᦪ3rD,,-ᵨID3DXMeshID3DXBuffer1U。☢803090(^61^^0ᦪw,ÛJᦪḄᵨ>。.✌ᐜnᡂ⊤9ₐḄyzU`,"ṹ᝞。ID3DXMesh*g_pTeapotMesh=NULL;D3DXCreateTeapot¿ᑴ_`ḄyzU`,"ṹ᝞,g_pTeapotMesh->DrawSubset(0);ᨬx³Ã_`ḄyzU`I^,"ṹ᝞。SAFE_RELEASE(g_pTeapotMesh);»9Ñ1^3?01^9ᵨ030᱄0^&16×6&001()ᦪ_`ₐU`,ᐹ#Rd⁚èÅÚV"ṹ,ᐸ$ᦔW᝞9.5ᡠ9。9:0300^10*ᑡÀᦪçḄ·5i>Vᨵ¼,,6ᮣ⚔@5^.AD3DFVF_XYZ7D3DFVF—N0RMAL。19.5çₐH·5i> 16oooÎ9U9.2.2_`}CᦻyzU`◀86=ᦪ᜜,01D130R030^ᦊ×᝞()ᦪ,ᵨJ_`⊤9}CᦻḄyzU`,KᦪḄ¯᝞。HRESULTD3DXCreateText(LPDIRECT3DDEVICE9pDevice,HDChDC,LPCTSTRpText,FLOATDeviation,FLOATExtrusion,LPD3DXMESH*ppMesh,LPD3DXBUFFER*ppAdjacency,LPGLYPHMETRICSFLOATpGlyphMetrics);ᐸ:•ᡞ069106ᵨJ_`yzḄ0]^830(ᜓᢣ┐。•ᓃ00(ᜓóF⊤。•ᡝ169Lᢣ}ᐹ#ᦻܤT。•06913L10^ᢣ}âªḄᨬᜧò。•£᱄ᓃ¿101^&}ᦻᙠ2å_>ᔣÈḄÙ。•??^^3&ᢣᔣnᡂḄÜ#yzU`ᙢᙬḄᢣ┐。•ᡝᓹ¿ᡷḄ^ᢣᔣᒹõrᐵÒÈ1ê>?Ḅᢣ┐,e8wᢕ…。•?017?1^^L&(^Òȸᦪ,8Qᢣᔣ01vᓹ1^£×XÀ5?1^0×$᪀ᦪḄᢣ┐,Kᦪe8ᒹᡠᨵܤḄrᐵᦪ£。ᦪḄᐗ²=ᦪK¶JܤTḄܤ=ᦪ。Z=ᦪᐗ²ᒹõܤTᑁrKḄܤḄß>ᔣ1ê。üU:Z=$᪀#ḄlASQrIJ᦮=ܤTḄ,QrIJK$᪀#ᡠIKḄܤ。᝞WSᐵܤᜧÞ,e8XK¸ᦪ(w>^0^ᙠ0»^^30ÑÒ,µ9}Cᦻµ9ÒḄᐸ¦}Cᱥ#Ôᨵ。»9Ñ7^130^9᝞<ᵨ0309(^ᦊ×¹0ᦪ_`}CᦻU`。ᐸÒ_`}CᦻyzU`Ḅ"ṹÌÊᑮ)}©ḄCreateTextMesh()ᦪÒ,[᦮"ṹ᝞。HRESULTCreateTextMesh(WCHAR*pText){//_`(ᜓóF⊤HDChdc=CreateCompatibleDC(NULL);if(hdc==NULL)returnE_OUTOFMEMORY;//_`Ü#HFONThFont■CreateFont(0,0,0,0,FW_BOLD,false,false,false,DEFAULT^―CHARSET,OUT■«wDEFAULTmmmPRECIS,9CLIP_DEFAULT_PRECIS•DEFAULT_QUALITY,DEFAULT__PITCH|FF_DONTCARE,L"Arial");//X/#⌱n(ᜓóF⊤SelectOb3ect(hdc,hFont);//_`}CᦻyzU` ·5i>ooo117V_RETURN(D3DXCreateText(g_pd3dDevice,hdc,pText,0.001f,0.4f,&g_pTextMesh,NULL,NULL));//³ÃÜ#(ᜓóF⊤DeleteObject(hFont);DeleteDC(hdc);>KÑḄᐹ#Rd⁚èÅÚV"ṹ,ᐸ$ᦔW᝞9.6ᡠ9。HclH)Direc^D!9.6¿ᑴ}C©9.3ᦻh·5i>cᩖᱥ#ḄyzU`23◤⌕ᑭᵨ Ḅ}C`U:ᩭᑴÄ。pû,}CU``U:i,᝞30^1、^7&¶。U`(Tᕒe8ᐜᵨ `U:_`}CU`,ᯠx2vrKḄ᜜ᢞÑXᐸÃᣚᡂ07^<^30ØTḄᦻzb(xqÈw©),J᪵ᙠ0&^30ÒᐭFᦻU`>¯。9.3.1U`ᦻzb2v3〇^、Maya¶}C`U:ᑴÄḄU`23SØz1ᙠDireCt3DÑÒᵨ,◤⌕ᑭᵨoÃᐹ、,XᑴÄḄU`ᦻÃᣚᡂᙠ07^(^30:#1ôÒe8z1ᵨḄzb。8^^30¿ᢝḄU`ᦻzbw*.9ᦻzb。ìᯠ,·e8}©)ÅḄᦻzb,:#)ÅḄU`zbÃᣚÃᐹ,¡i`ab;<·ìQJ᪵÷Ḅ。ÂQIJý2Ḅ}Cab:#ᕒ,`ÚRQᵨ*.9ᦻzb,Vw0^0^30w*©ᦻU`ᜧᑁNḄ¿ᢝ。•9ᦻQ0^^130ḄU`Îᦪ£Ḅ?;zb,.9ᦻ23?;}CU`Ḅ⚔Aᙶ᪗、7⁐、ᔣ、[ᳮᙶ᪗8Oζ1ê。2v030᡽/?ᦪ,e83>¯ᙢ^.᱄ᦻÒ;´}CU`Ḅi¼yz、[ᳮcÎᦪ£,nᙠÑÒᵨ。Û:º»Ḅᓹ7(^(50XᵨJX30”39^73ᑴÄḄU`Ãᣚw©ᦻzbḄ,ᨬHḄ07(^(50RSÙJ。᝞W◤⌕J,e8^Îὶy。 118000Î9ὥ9.3.2ÀᵨÏᦻUV1☢$ᔠ9Ñ1ᓄ^ᓄ,CD᝞<ᵨ.9ᦻyzU`。1.᪷E.ᦻUWᡂV1ᑭᵨ©ᦻF}CU`,✌ᐜ◤⌕X©ᦻÒḄᔜ*ᦪ£ᑖ¹ᑮᑁ?Ò,⌕ᒹ⚔Aᦪ£、ᩞWᦪ£[ᳮᦪ£¶。ᵨD3DXḄD3DXL0adMeShF^0mX()ᦪ,e8>¯ᙢX.9ᦻ¹ᑮᑁ?Ò,,nᡂrKḄyzU`,KᦪḄ¯᝞。HRESULTD3DXLoadMeshFromX(LPCTSTRpFilename,DWORDOptions,LPDIRECT3DDEVICE9pD3DDevice,LPD3DXBUFFER*ppAd]acency,LPD3DXBUFFER*ppMaterials,LPD3DXBUFFER*ppEffectInstance,DWORD*pNumMaterials,LPD3DXMESH*ppMesh)?ᐸÒ:•9ᓹ116¿ᢣᔣ◤⌕ᐭḄ.9ᦪ£ᦻḄqÐôÇᦻÈḄܤT0•(^&01^Pp5`030᱄p£5?1Ḅo=ᡈi=òḄᔠ。•?ᓹ&06Ḅ7ᢣᔣ?;ᒹõ}ê11êḄᑁ?Ḅᙢᙬ。•ppMaterialsᢣᔣ?;U`ᩞW[ᳮᦻÈḄᑁ?Ḅᙢᙬ。•9ᓹ£££6(2(¿1^(3b63ᢣᔣ[i>ᦔ®¯^Ḅᑁ[Ḅᙢᙬ。•ᓹÃÄ3L6^313?;ᩞWᦪpḄLḄᙢᙬ。•ppMeshᢣᔣnᡂḄDl^ect3DyzU`ᢣ┐Ḅᙢᙬ。ᙠ☢ḄᦪÒ,Aᐭo=HḄ030᱄᡽/1ôᢣ┐5`[?030980??£X(ᓽID3DXBuffer*).0^^^Å6ᖾ^4ḄpḄ,Qw>¯Iyzᦪ£ḄvÄ,K1ôe8?;⚔Aßᙶ᪗、ᩞW、[ᳮ¶i*5`Ḅ0»*^130ᦪ£,SIZ*ᦪ£¯o*1ô5`。eᵨ70308Æ76「{618^£6#01“61()>;Ì>?ÒḄᦪ£,ᵨ1030986「:0618ᢕ66()>;´>?ᦪ£ḄᜧÞ。J5=1ô>Ḅ¯᝞。LPVOIDID3DXBuffer::GetBufferPointer(VIOD);DWORDID3DXBuffer::GetBufferSize(VIOD)9Ñᓺ^^᪷£ᓹᓃH©ᦻ,nᡂo=!yzU`,"ṹ᝞。V_RETURN(D3DXLoadMeshFromX(L"plane.x",D3DXMESH_KANAGED,g_pd3dDevice,NULL,&pD3DXMtrlBuffer,NULL,&g_dwNumMatenals,&g_pMesh));2.Yᐭᩞ®ᳮᙠ☢¹yzU`Ḅ"ṹÒ,᝞Wᦪ03091Ḅ(1”81^01^()&ᵨᡂ,Ö¸ᦪ¼1^16@1(B]%.9ᦻÒ}CU`ḄᩞW[ᳮ1ê,@Ç^᝞1ᑣB;´ᩞWḄᦪp。wFU`,◤ÈXᩞW[ᳮ1êÌÈᩭ,9Ñᓄ^4ÌᩞW[ᳮḄ"ṹ᝞。D3DXMATERIAL*d3dxMaterials=(D3DXMATERIAL*)pD3DXMtrlBuffer->GetBufferPomter(); ·5i>OOO119g_pMeshMaterials=newD3DMATERIAL9[g_dwNuraMaterials];if(g_pMeshMaterials==NULL)returnE_OUTOFMEMORY;g_pMeshTextures=newLPDIRECT3DTEXTURE9[g_dwNumMaterials];if(g_pMeshTextures==NULL)returnE_OUTOFMEMORY;//⌲V^_`ᩞaឋ®bᦻUfor(DWORDi=0;i0){//c`®ᳮᦻUWCHARfilename[256];RemovePathFromFileNaune(d3dxMatenals[i].pTextureFilename,filename);//Òd®ᳮif(FAILED(D3DXCreateTextureFromFile(g_pd3dDevice,filename,&g_pMeshTextures[i]))){MessageBox(NULL,["ÔᨵÆᑮ[ᳮᦻ",L"FileMesh",MB_OK);>>>//çèᙠ>Y1ᦻUÓÒHḄÜ1ᩞ®ᳮᦪEḄ¥µ@pD3DXMtrlBuffer->Release();☢Ḅ"ṹᵨᑮo=HḄD3DX$᪀5`D3DXMATERIAL,K$᪀ᒹõ/^.9ᦻÒ;ÌḄᩞW[ᳮ1ê,ᐸ}©᝞。typedefstructD3DXMATERIAL{D3DMATERIAL9MatD3D,//Direct3D^^LPSTRpTextureFilename//ᒹõ[ᳮᦻÈḄܤT>D3DXMATERIAL;☢Ḅ"ṹnᡂ!U`ḄᩞW[ᳮ,ᑖ?Ãᙠ803ô^1×£&119LPDIRECT3DTEXTURE9nᐗ4Ḅᦪñg_pMeshMaterialsl]a[Ḅmᐝmᦪ。ᙠû☢ᑮv,yzU`23ᵫi=᪀ᡂ,ᙠᑴÄU`î23wZ=ᑖ(ᩞW[ᳮ,ᡠ8◤⌕wᡠᨵḄᑖ&?ᩞW[ᳮ。ᵨD3DXLoadMeshFromX()ᦪ¹yzU`î]%ḄᩞWᦪ,·QyzU`Ḅᦪ。ᙠ☢Ḅ"ṹÒRᵨᑮo=)}©ᦪRemovePathFromFlleNameO,Kᦪ2v[ᳮᦻḄ[᦮ôÇ´ᑮᐸᦻÈ。Vw&?ᙠ.9ᦻÒḄ[ᳮᦻôÇ,Qᙠᵨ}CU`ᑴ 120oooÎ9UÄ:ᑴÄU`îᢣ}ḄᦻôÇ, 23QWIôÇ,Vûᙠû41ᵨ^.9ᦻÒ;ÌḄ[ᳮᦻôÇ23ÆSᑮK[ᳮ©。ᙠḄ9ÑÒ.KE⚪ḄQ,X[ᳮᦻ&?ᙠìûp2,Vû¦◤[ᳮᦻÈᓽe,VwjkÒA^ìûp2ÅÆ[ᳮᦻ。!^9Í᝞…⑴1ᓄ'□⑷ᦪḄ[᦮R"ṹ᝞。voidRemovePathFromFileName(LPSTRfullPath,LPWSTRfileName){//ᐜ=11?30Ḅ=>{ᣚn[?;^1WCHARWSZBuf(MAX_PATH];MultiByteToWideChar(CP_ACP,0,fullPath,-1,wszBuf,MAX_PATH);WSzBuf[MAX_PATH-l]=L'*;WCHAR*wszFullPath=wszBuf;//fµgh`ᦻULPWSTRpch=wcsrchr(wszFullPath,•\');if(pch)lstrcpy(fileName,++pch);elselstrcpy(fileName,wszFullPath);>3.wyzU`nᡂ+9ᦻyzU`Ḅ⚔AeØÔᨵᒹõ+1ê,n$ᐝ᯿Tî◤⌕+1ê。w.J=E⚪,e8ᵨ0309Ḅ0309'ᕣᕸ>10011ᓄ0ᦪwyzUÊḄ⚔AT,8¹+,KᦪḄ¯᝞。HRESULTD3DXComputeNormals(LPD3DXBASEMESHpMesh,CONSTDWORD★pAdjacency);Kᦪ2vIᐳË⚔AḄᡠᨵ☢ḄᔣÌáᙳò,8T⚔AḄᔣ。ᐸÒᓹ⑴^⑶”¸ᦪQe⌱Ḅ。᝞Wê11ê,@`Ḅ⚔AB̵ᶍ,n$á¸ᜐᳮ,᝞WÔᨵê11ê,ᑣ@`⚔AḄᔣQᐳÌ⚔AḄᡠᨵ☢ḄᔣḄáᙳò。Vw◤⌕w⚔A(+,ᡠ8pMeshᢣᔣḄyzU`Ḅ⚔AzbᒹõD3DFVFoNORMA_i᝞W©ᦻÔᨵᒹõ+ᦪ£,ᑣᵨD3DXLOadMeshF^OmX0ᦪ᪷£.Xᦻ_`ḄyzU`,ᐸ⚔AzbSBᒹõD3DFVF_NORMAL᪗µ。ᡠ8e8᪷£⚔AzbQᔲᒹõD3DFVF_NORMAL#E,}Qᔲ◤⌕wyzU`T+。᝞W◤⌕wyzU`T+,✌ᐜ◤⌕±◖lyzU`,,ᢣ}o=ᒹõ030?9ᓃ>^(^^^᪗µḄ⚔Azb,ᯠxw±◖xḄyzU`T+。9Ѧᓄ^^51^1v8"ṹᜐᳮJ*êæ。if(I(g_pMesh->GetFVF()&D3DFVF_NORMAL)){o//±◖yz~`LPD3DXMESHpTempMesh=NULL;g_pMesh->CloneMeshFVF(D3DXMESH_MANAGED,g_pMesh->GetFVF()|D3DFVF_NORMAL,g__pd3dDevice,&pTempMesh);//.V1FKD3DXComputeNormals(pTempMesh•NULL);//³ÃlᩭḄyzU`I^,Í&?HyzU` ·5i>ooo121g_pMesh->Release();g_pMesh=pTempMesh;>4.FyzU`᪷£.9ᦻ´ᑮyzU`OᩞW[ᳮåx,FyzU`Ûᓫ。9ÑFileMeshF.XᦻU`Ḅ"ṹ᝞。for(DWORDi=0;iSetMaterial(&g_pMeshMaterials[i]);g_pd3dDevice->SetTexture(0,g_pMeshTextures[i]);//FyzU`g_pMesh->DrawSubset(i);>9Ñ116^ᓄḄᐸ¦Rd⁚èÅÚV"ṹ,ᐸ$ᦔW᝞9.7ᡠ9。9.79Ñ116^ᓄ$ᦔW9.3.3IyzU`Ḅ|AÛ1)ᑭᵨ}C`UÃᐹᑴÄḄ}CU`23Ûcᩖ,ᓽi¼ᦪi,i¼ᦪgi,F¤g᠒。ᡠ8ᙠᑴÄU`î,ᙠSµ/0féᦔWḄû,Kï´i¼Ḅᦪ。2)}CU`)HḄXyQᙠU`ᑴÄîᢣ}Ḅ,KXyeØ▭ᱥ#Xyrªᜧ,VûᙠFyzU`î,◤⌕IU`n$〉ìḄÃþ。ᨬQᙠᑴÄ}CU`îüUU`ḄXyᱥḄXy&ᢝo,ᡈ:#]Ḅ#ÃᐹIyzU`n$&᦮,XU`ḄXy&᦮ᑮ▭ᱥ#Xyo,J᪵e8äᙠÑÒIU`ᜧÞn$&᦮。ᱯQìÒ◤⌕Fi=yzU`î,J᪵e8hiÑḄ:#ã,"ṹf¹Üᨎ。3)FyzU`î,23◤⌕n$ᐝ᯿ᜐᳮ[ᳮ᧜],ᡠ8◤⌕Iᐝ᯿[ᳮn$rᐵḄ(。IJ[ᳮ,ᓽuµn$rᐵ(,8830·B)ÎᵨÒA(,rfdDirect3D 122oooÎ9UᓾÔᨵ(ÒAᐝV,ᡠ8᝞Wuµ(ᐝV,23B⌼ᡂU`µ9Sì。IJ*zὅ,eØÆSᑮE⚪ḄlVᡠᙠ,^ B⌼ᡂo}ḄÞj。4)ᙠ^yzU`ᦪ£ÒÌ[ᳮᦻÈ,wyzU`_`[ᳮI^î,◤⌕üUḄQ,ÌḄᦻÈeØQ[ᳮᦻḄWIôÇ,KWIôÇ33Qᙠᑭᵨ}CU`ᑴÄ:ᑴÄU`îᢣ}ḄôÇ,KôÇ÷ìû[ᳮᦻḄôÇ23S,Vû_`[ᳮI^îÆSᑮ[ᳮᦻ。ᡠ8KKIÌᑮḄ[ᳮᦻWIôÇn$ᜐᳮ,ᓽᑤ◀ôÇ%ᑖ,¦&ᶇ[ᳮᦻÈ,ᯠxÙ^ᢣ}ḄôÇÅÆ[ᳮᦻ。ᐹ#d⁚e8¸Ú9ÑFileMeShḄV"ṹ。9.4·5i>ᓄX.9ᦻᦪ£¹ᑮ>?åx,e8IyzU`ᦪ£n$rKḄᜐᳮÚᓄ,8F¤。᝞e8ᰚᔠ@cḄ⚔A,I⚔A>?ᦪ£n$@H᣸¶。9.4.1ÚᓄᦪÚᓄ>beᵨ1030998ᓃ1ôḄ(^711^61Í1ᡷ6()>,IyzU`n$Úᓄ,KᦪḄ¯᝞。HRESULTOptimizeInplace(DWORDFlags,CONSTDWORD*pAdjacencyIn,DWORD*pAdjacencyOut,DWORD*pFaceRemap,LPD3DXBUFFER*ppVertexRemap)?ᐸÒ:•?1£3ᢣ}Úᓄ>b,e8Q0309^5110?7Pp3Ḅᔠ。•?306᝞v3^VyzU`Ḅê11ê。•?306Ḅ70ûÚᓄxyzU`Ḅê11ê。•1^306861^?µ2ÚᓄxḄyzU`ÒZ=☢ᐹ#IKVyzU`ÒḄ=☢。᝞WS◤⌕K1ê,e8XK¸ᦪ(w~1ᓃ1。ᓹ9ᡭLḄ᝞^͵2ÚᓄxḄyzU`ÒZ=⚔Aᐹ#IKVyzU`ÒḄ=⚔A。᝞WS◤⌕K1ê,e8XK¸ᦪ(w1^;0^◀(^᝞7261Í&6()>᜜,·e8ᵨ1030᱄^1^:(^10^6()>IyzU`n$Úᓄ。5ὅåÿḄQ,0?^0^^()>Bnᡂo=HḄyzU`I^&?ÚᓄxḄyzᦪ£,0?1¹&1Í1&^()>IVyzU`Hn$Úᓄ。8^8307*yzU`Úᓄ>b,ᵫPp3D3DXMESHOPT⊤9,ᔜ*Úᓄ>bḄ᪗¤OᐸÛ᝞。•D3DXMESHOPT_COMPACT◀ÔᨵᵨḄ⚔A☢。•D3DXMESHOPT^ATTRSORT᪷£}ឋI}☢n$@H᣸,,nᡂo=}ឋ⊤(q9.4.2Þ⁚)。•D3DXMESHOPTJVERTEXCACHE⚔A¤>?(cache)ḄXÒ᳛。•D3DXMESHOPT_STRIPREORDER}ᩩ$eØᙢ«。•D3DXMESHOPTJGNOREVERTS¦Úᓄyz☢,SÚᓄ⚔A。 ·5i>ooo123•030᱄%£$^^?1[」^^078?0×I}ឋn$᣸î,Sᑖᒘᙠ5=}ឋÒᐳÌḄ⚔A。•D3DXMESHOPT_DEVICEINDHPENDENTᵨ〉ᔠJìûhḄÒA⚔A¤>?ᜧÞ。9:᪗µ03091^£5110?7_¥ÄX×£᱄0(^£030᱄^5?10?×_5×X1?X£0X0^^SØwDᵨ。9.4.2}ឋ⊤᝞WIyzU`n$ÚᓄîᵨD3DXMESHOPT_ATTRSORT᪗µ,ᑣÚᓄxḄyzU`,ᐸ}☢B᪷£}ឋn$᣸,^ }Jᱯ}Ḅ}☢BÌ&?ᙠ⚔A>?ᡈ@A>?Ḅëy?;ÿÒ,᝞9.8ᡠ9,Ò^⊤9ó0=},|⊤9ó1=},@S5。-012A<-------------------------X---------------------------------><^4—^0001111122]Z[19.8᪷¸ឋv:82z᣸M◀I☢ᱏn$᣸᜜,ᵨ0309^5¦0?×_××&50óÚᓄ᪗µn$ÚᓄîRBnᡂo=}ឋ⊤。K}ឋ⊤Qo=D3DXATTRIBUTERANGE5`Ḅ$᪀ᦪ。}ឋ⊤ÒZo⚗IKJyzḄo=,,ᢣ}KÒ}☢Ḅ|<1êÌ?;ᙠ⚔A>?ᡈ@A>?Ḅ=?;ᙽÒ,030᱄×7ᑿ817^1^^0£$᪀Ḅ}©᝞。typedefStructD3DXATTRIBUTERANGE{DWORDAttribId;//Ḅ10DWORDFaceStart;//}JKḄ}☢ᙠ@A>?ÒḄ®+ßÑDWORDFaceCount;//Ò}☢ḄÙᦪDWORDVertexStart;//÷KrᐵḄ⚔Aᙠ⚔A>?ÒḄ®+ßDWORDVertexCount?//Ò⚔AḄÙᦪ>D3DXATTRIBUTEHANGE#rLPD3DXATTRIBUTERANGE;$ᔠ9.8,Sãᳮ0309××Xù-^^^^^$᪀ÒᔜᡂᕒḄõ©。_`}ឋ⊤åx,¦⌕2voSxÆe8Æᑮ}JKḄᐰ%}☢,^e8FyzḄᦔ᳛。᝞WÔᨵ}ឋ⊤,wFyz,◤⌕I᦮=}ឋ>?n$ᓟS+ឋÅÆ,8}}JKḄ}☢Ḅß。2vID3DXBaseMeSh1ôḄ0“《¿ᕸ×3)()>e8;ÌyzU`Ḅ}ឋ⊤ᡈ}ឋ⊤Òᐗ²Ḅᦪ。KᦪḄ¯᝞。HRESULTGetAttributeTable(D3DXATTRIBUTERANGEpAttribTable,DWORD*pAttribTableSize);E}ឋ⊤◤⌕5=p。✌ᐜ&ᵨ(^《1^ᕸ7^^()>,,Xóo=¸ᦪ?111^^16(w~ô^,2vóB=¸ᦪ;Ì}ឋ⊤Òᐗ²Ḅᦪ;ᯠxÙS&ᵨ0&《¿86×3ᓃ£)>,XóB=¸ᦪ(wj;ÌḄ}ឋ⊤ᐗ²Ḅᦪ,,2vóo=¸ᦪ]%}ឋ⊤,9"ṹ᝞。 124oooÎ9UDWORDsize=O;D3DXATTRIBUTERANGE*pAttnbTable=NQLL;//;Ìឋ⊤ᐗ²Ḅᦪd,&?ᑮLn312^ÒpMesh->GetAttnbuteTable(NULL,&size);//ÒÌ}Ó⊤pMesh->GetAttributeTable(pAttnbTable,&size)943ᐸ¦yzU`ᜐᳮᦪ◀☢CDḄyzU`ÚᓄÔᦪå᜜,0309?·oIyzU`n$ᜐᳮḄᦪ,ᐸÒᨵᦪ·e8yzU`ḄFᦔ᳛。ᙠûÒCD=ÛᨵᵨḄyzU`ᜐᳮᦪ。ᐸᙠû☢ᵨᑮo=3@⌕ḄyzU`ᜐᳮᦪ,ᓽwyzU`⚔AT,8¹ᔣḄD3DXComputeNormals()ᦪ。103090^3][^5|1()ᦪᵨ03090^1^^()ᦪe8IyzU`n$᦮ᳮ、Õᓄ,KᦪḄ¯᝞。HRESULTD3DXCleanMesh(D3DXCLEANTYPECleanType,LPD3DXMESHpMeshIn,CONSTDWORD*pAdjacencyIn,LPD3DXMESH*ppMeshOut,DWORD*pAd3acencyOut,LPD3DXBUFFER*ppErr0rsAndWarn1ngs);ᐸÒ:•016&1^71^᦮ᳮyzU`Ḅ>b。23ᵨ030᱄0^^_3〖Ö1HÀ^110>1>bIyzU`n$᦮ᳮ,J᪵îe8XᐳÌr×⚔A☢ᔣSᙠo>ᔣḄ} $ᔠ,,îRe8äᙠᓄyzḄvÄÒ◍ᐭÙ+ú。•ᚄÛ©1^X⌕ÜᳮḄyzU`。•0€^3061^710᦮ᳮûyzU`Ḅê11ê。•?O<^3061^70#᦮ᳮxyzU`Ḅê11ê。•ppMeshOutᨬÐ᦮ᳮḄyzU`。•?ᡷ1^0^3᝞^^1^11^3µ2᦮ᳮvÑÈRḄÈ┯1ê>Ù1êḄ>?。2030᱄6|0^6$1065()ᦪᵨ0309〜67^ᢕD5()ᦪe8XyzU`Ò}ឋrḄ@c⚔Aᰚᔠᑮo®,^ᓄyzU`,KᦪḄ¯᝞。HRESULTD3DXWeldVertices(LPD3DXMESHpMesh,DWORDFlags,CONSTD3DXWeldEpsilons*pEps1l0ns,CONSTDWORD*pAd3acencyIn,DWORD*pAd]acencyOut,DWORD*pFaceRemap,LPD3DXBUFFER*ppVertexRemapᐸÒ:•5^68©X⌕n$⚔AᰚᔠḄlyzU`。 ·5i>ooo125•FlagsPp3ÝD3DXWELDEPSILONSFLAGSḄᔠ,ᢣ}᝞Ù1êḄ>?。944ëýᓄá°9ÑOptlnmedMeSh^9ᔆyzU`ḄᜐᳮÚᓄ,K9ÑQᙠ11^^Ạn$᡽/´ᑮḄ^^.9ᦻ¹U`ᦪ£,,nᡂyzU`åx,ᵨ8"ṹIl+yzU`n$ᜐᳮÚᓄ,ᐸ¦R"ṹ1ᓃ^ᓄ[ᐰr。//ßîyzU`L2LPD3DXMESHpTempMesh;//᦮ᳮl+yzUᑜV_RETURN(D3DXCleanMesh(D3DXCLEAN_SIMPLIFICATI0N,g_pMesh,{DWORD*}pAd]acencyBuffer->GetBufferPointer()•&pTempMesh,(DWORD*>pAd]acencyBuffer->GetBufferPointer(>,NULL));g_pMesh->Release();g_pMesh=pTempMesh;//ᰚᔠ@cḄ⚔ᓲ:D3DXWeldVertices(g_pMesh,D3DXWELDEPSILONS_WELDPARTIALMATCHES, 126oooÎ9UNULL,(DWORD*)pAd3acencyBuffer->GetBufferP0inter(),(DWORD*)pAd3acencyBuffer->GetBufferPomter(),NULL,NULL);//ÔÅᜐᳮ、ᓄxḄyzU`QᔲᨵᦔV_RETURN(D3DXValidMesh(g_pMesh,(DWORD*)pAd3acencyBuffer->GetBufferPoxnter<)•NULL));//wyzU`T+1êlf(i(g_pMesh->GetFVF()&D3DFVF_NORMAL)){//±hyzU`g_pMesh->CloneMeshFVF(D3DXMESH_MANAGED,g_pMesh->GetFVF()|D3DFVF_N0RMAL,g_pd3dDevice,&pTempMesh);//wyzU`T+D3DXComputeNormals(pTempMesh,(DWORD*)pAdjacencyBuffer->GetBufferP01nter());//³ÃlᩭḄyzU`I^,,&?HyzU`g_pMesh->Release()?g_pMesh=pTempMesh;>//ÚᓄyzU`V_RETURN(g_pMesh->Opt1m1zeInplace(D3DXMESHOPT_COMPACT|D3DXMESH0PTATTRSORTID3DXMESHOPTSTRIPREORDER,•—■™™(DWORD*)pAd]acencyBuffer->GetBufferPointer(),NULL,NULL,NULL));᝞WyzU`Ûᓫ,ÚᓄåxF¤eØÔᨵµḄ,PQIJcᩖḄU`,Iᐸn$Úᓄe8ᨵᦔF¤。9.5ᦻh·5i>=ᙠû☢|⁚ᵨᦻyzU`Ḅ9ÑÒ,oz-ᙠ@c^ᦻ¹,_`yzU`、ÌᩞW[ᳮ、FyzU`8Oᨬx³ÃᩞW、[ᳮyzU`I^¶vÄ,JvÄḄ"ṹr。᪷£☢ᔣI^ḄeA,e8XJ÷yzU`rᐵḄvÄ"ṹÊᑮo=5Ò。⁚X^9᝞#include#include"UtilMacro.h"classCXFileMesh{public:LPD3DXMESHm_pMesh;//yzU`DWORDro_dwNumVertices//⚔Aᦪ᤬DWORDm_dwNumFaces?//}ᦪ3D3DXVECTOR3m_vMin;//᜜1«>#ᨬÞA ·5i>ooo127D3DXVECTOR3m_vMax;//᜜1«>#ᨬᜧAD3DXVECTOR3m_vCenter;//᜛©1ᳫÒfloatm_fRadius;//᜜ᳫmÇprivate:DWORDm_dwNumMaterials;//ᩞWᦪ᰿D3DMATERIAL9*m__pMaterials;"ᩞWᦪLPDIRECT3DTEXTURE9*m_pTextures?"[ᳮᦪpublic:HRESULTCreate(LPDIRECT3DDEVICE9pd3dDevice,WCHAR*strFilename);HRESULTRender(LPDIRECT3DDEVICE9pd3dDevice);HRESULTDestroy();private:voidRemovePathFromFileName(LPSTHfullPath,LPWSTHfileName);public:CXFileMesh(void)?-CXFileMe8h(void);>?ᙠᓚ9¼^^ᓃ5Ò8¹oL,ᵨJµ2yzU`Ḅ1ê,ᒹyzU`Ḅ⚔Aᦪ}☢Ḅᦪ,᜜1«>#ḄᨬÞAᨬᜧA,8O᜜1ᳫḄÒmÇ。ᐸÒ᜜1«>#᜜ᳫQ5*ᵨJ⊤9yzU`ᜧᭆḄ3ᵨ>,᜜1«>#᜜1ᳫ3ᵨJeqឋbsàábs,8$ᦔ᳛。0᱄^ᓄ^ᓄ5ÒḄᐸ¦Lᙠû☢-ᵨv,SÙ³。ᓚ9¦©^^ᓄ5Ò◀᪀⌼ᦪ᪆᪀ᦪå᜜,RᨵZ=ᡂᕒᦪ,ᐸÒ0ᕸ()ᦪ_`᪷£kᦻ_`yzU`,,;ÌyzU`Ḅ1ê。X6“8()ᦪ_`FyzU`,065᝞>^)ᦪ_`³ÃK5ÒᵨḄrᐵI^。X60v6?&È?『0111?716'0^()ᦪ_`^ᦻôÇÒÌᦻÈ,ᙠû☢CDv。9.5.20᱄ᓹ776"63^1ḄR1.06316()ᦪḄR0^&()ᦪ✌ᐜ¹.9ᦻ,_`yzU`,ᯠxIyzU`n$rᐵᜐᳮÚᓄ,ᨬx;Ì,µ2yzU`Ḅ1ê。ᐸÒ¹yzU`8OIᐸn$ᜐᳮÚᓄḄ"ṹû☢(^^072&^81^^ÑÒḄrK"ṹr。;Ì,µ2yzU`1êḄ"ṹ᝞。//;Ì⚔Aᦪ3}ᦪâm_dwNumVertices=m_pMesh->GetNumVertices();m_dwNuroFaces=m_pMesh->GetNumFaces();//T,᜜1«>#ḄᨬÞAãᜧA、᜜1ᳫḄÒmÇBYTE*V=NULL;m_pMesh->LockVertexBuffer(0,(void**>&v);D3DXComputeBoundingBox((D3DXVECTOR3*)v,m_dwNumVertices,ro_pMesh->GetNumBytesPerVertex<),&m_vMin,&m_vMax};D3DXComputeBoundingSphere((D3DXVECTOR3*)v,m_dwNumVertices,m_pMesh->GetNumBytesPerVertex(),&m_vCenter,&m_fRadius);m_pMesh->UnlockVertexBuffer(); 128oooÎ9UᐸÒ᜜1«>#ḄᨬÞAᨬᜧAQᵨ03090Íᕸ80GÈÍ30()ᦪ;´Ḅ,KᦪḄ¯᝞。HRESULTD3DXComputeBoundingBox(CONSTD3DXVECTOR3*pFirstPosition,DWORDNumVertices,DWORDdwStride,D3DXVECTOR3*pMin,D3DXVECTOR3*pMax)7ᐸÒ:•ô?1『3L?031L1(^ᢣᔣ⚔A>?Òóo=⚔AḄᢣ┐。•NumVertices^5^;^&fto•<1〜5L2^(16⚔A>?ÒZ=⚔AᓰᵨḄÜ⁚ᦪ。•pMinᵨJÒÈᨬÞAḄß。•^^^9ᵨñÒÈᨬᜧAḄß。᜜1ᳫḄÒmÇQ2v0309[0£ᖾ80¿ÈÍ5ô1^"()(ᦪ;´Ḅ,KᦪḄ¯᝞。HRESULTD3DXComputeBoundingSphere(CONSTD3DXVECTOR3*pFirstPosition,DWORDNumVertices,DWORDdwStride,D3DXVECTOR3*pCenter,FLOAT*pRadius)?ᐸÒ,û}=¸ᦪ030(^Í1^80¿ÈÍ8D()ᦪḄû}=¸ᦪr,x5=¸ᦪᵨJ]%᜜1ᳫḄÒmÇ。2.¹60016「ᦪḄRX£ᓄó()ᦪ_`FyzU`,ᐸ[᦮R"ṹ᝞。HRESULTCXFileMesh::Render(LPDIRECT3DDEVICE9pd3dDevice){//✌ᐜjᑴlmᑖpd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,false);for(DWORDi=0;iSetMaterial(&m_pMaterials[i]);pd3dDevice->SetTexture(0,m_pTextures[i]);m_pMesh->DrawSubset(i);}//ᯠjᑴolmᑖpd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA)?for(DWORDi=0;iOOO129if(m_pMaterials[i].Diffuse.a==1.Of)continue;pd3dDevice->SetMaterial(&m_pMaterials[i]);pd3dDevice->SetTexture(0,m_pTextures[iJ);m_pMesh->DrawSubset(i);}//ឮcἭᵨ¿ä^gᔠpd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,false);returnS_OK;>X6'^()ᦪÒḄᡠᨵᑁ4-z{v,¦ᨵoA◤⌕üU:cᩖḄyzU`eØîᨵmn%ᑖ·ᨵSn%ᑖ,wì¿ᑴJ*U`,◤⌕ᐜ¿ᑴU`ÒḄSn%ᑖ,ᯠx¿ᑴmn%ᑖ。ᐹ#>Q,2vIyzᩞWḄ-“òn$ᑨe,}yzU`Ḅ)o%ᑖQmnRQSn。3.063Ḅ9ᦪḄR08Ḅv()ᦪÛᓫ,ᐸ"ṹ᝞。HRESULTCXFileMesh::Destroy(){//åÃyz᪥`ᩞWSAFE_DELETE_AKRAY(m_pMaterials);//³ÃyzU`[ᳮif(m_pTextures){for(DWORDi=0;i//³ÃyzU`I^SAFE_RELEASE(m_pMesh);returnS_OK;>9.5.3ᵨ09「r〜65©5FᦻyzU`☢2v9Ñ'6011^6$}^æ9K5Ḅᐹ#ᵨ,K9Ñᵨᓚ9¦7^^ᓄ5Fo=zᓣ!U`。✌ᐜ}©09ç761è1^|Ḅo=ᢣ┐L,"ṹ᝞。CXFileMesh*g_pFileMesh=NULL;"·5ÍKv、1ᩭ_`,*+ᓄyzU`,"ṹ᝞。g_pFileMesh=newCXFileMesh();V_RETURN(g_pFileMesh->Create(g_pd3dDevice,L"Heli.x"));ᯠx&ᵨRemierOᦪFyzU`,"ṹ᝞。g_pFileMesh->Render(g_pd3dDevice);ᨬxᙠÑ⌨Èåû&ᵨ'5Ḅ^()ᦪ,├éyzU`I^,"ṹ᝞ 130oooÎ9Uif(g_pFileMesh1=NULL)g_pFileMesh->Destroy();SAFE_DELETE(g_pFileMesh);e8ÚÈ09[᝞^wḄᵨ3ᓫ。9Ñê9᱄116^îRµ9yzU`Ḅ1ê,ᐹ#RÜÅÚV"ṹ。ᐸ$ᦔW᝞9.9ᡠ9,üUzᓣ!U`Ḅëè᫔%ᑖQmnḄ。BUsvCXFileMM^:«=®„.?_|-PS:120e.91mm^i^.⚔ᵯ⏺《671☢ᱏᦪ5ᑗ6᜜ᨬ(-647.019.-935)᜜ᨬᜧ :(674.19.655>᜜ᳫ:{0.02.2.09.-2.33)᜜.ᳫ9.20_____________9.99ÑUseCXFi】eMesh$ᦔW9.6ᱥgÆ1f᝱ḄÇᑴᙠR&Ò,⌕[ᐰ}ßo=ᱥ#◤⌕6=¸ᦪ:ᱥ#ßᙶ᪗Ḅ3=ᑖU,y,z)3=íÊ(âî78〜,_¤ô^©,?í□11)。3=íÊḄ}©᝞。•âîᱥ#¹)Hvå(ᓽᔣ〃1?)èÃḄ;•_¤ᱥ#¹)5^å(ᓽ~ᔣ^%81^)èÃḄ;•?íᱥ#¹)Hᑍå(ᓽûᔣ40^)Ḅ)。U`ᙠ&ÿÒḄßNï᝱-Q2vᐸ&▣ᩭ⊤9Ḅ,ᡠ8、⌕ᙠÑÒ}o=U`Ḅßï᝱,QXᑴᐸG᝱Ḅ6=¸ᦪKᵨᑮᐸ&▣Ò。ᐸ,2vᱥ#Ḅßᱥ#Ḅ3=)Hᙶ᪗åGᔣ(3=ᔣ)᪵·e8}ßU`。▭,ᙠ0ᓄ^130ÑÒ,U`Ḅ&▣HᒹõU`Ḅßᔣ3=>ᔣᔣ,Jᔣ᤬ᙠ&▣ø?;Ḅ<Q:ó}$QvL00kᔣð,óB$QvUpᔣ,óo$QvRigh0]ft,ó4$Qßñᔣ9ᓹ0¿¹。2vᦪ0301^0^10(160.7()X▣(wᓫß▣î,î·X4=ᔣ-(wÒAò,B[WLooWhi^(0.0f,0.0f,1.0f),vUpᔣw(0.0f,1.0f,0.0f),9ᑿ£ᔣw(1.0f,0.0f,0.0f),v?0317(^ᔣw(0.0f,0.0f,0.0f)eJîU`ßJ&ᙶ᪗jlA,,U`ḄGᔣ&ᙶ᪗jḄ3=ᙶ᪗å>ᔣr。ᦋLU`ḄG᝱,QXᱥ#Îᑮᢣ}ß、èÃᱥ#8ᦋLᐸGᔣ。èÃo=ᱥ#W©.QX〃1^0OOO131⌕ᱥ#on_¤,XvUpvLookᔣ¹ḼvRightᔣèÃ。⌕ᱥ#onâî,XvLookvRightᔣ¹ḼvUpᔣèÃ。ZIᔣḄèÃ◤⌕ᑖJâî、_¤?ívUp▣ᩭ[ᡂ。J▣eJD3DXMatrixRotatio^AxisOᦪnᡂ,KᦪᵨJ᪀`o=e¹÷UåèÃḄ▣。ᨵâî、_¤?í▣,e8ᵨᦪ030᱄¥^3,×ô1^001^0(^(1()Iᔣn$èÃ。ᵫJT!IôAᦪḄᜐᳮ?ᙠÖE⚪,ᡠ8ᙠᔣèÃTvÑÒB$ᩭ´¡ò¹ª。ᙠviSèÃåx,JíᐭªX19.10vUpᔣᔣD3DXVECTOK3vRight,vUp,vLook?vRight.x=g_matWorld._11;vRight.y=g_matWorld._12;vRight.z=g_matWorld._13;vUp.x=g_matWorld._21;vUp.y=g_matWorld.-22;vUp.z=g_matWorld._23?vLook.x=*g_matWorld._31;vLook.y=g_matWorld._32;vLook.z-gmatWorld.33;**^~»w9//öᓄ>ᔣᔣᨬ,,årÎᚖzD3DXVec3Normali2e(&vLook,&vLook);D3DXVec3Cross(&vRight,&vUp,&vLook);D3DXVec3Normali2e(&vRight•&vRight);D3DXVec3Cross(&vUp,&vLook,&vRight);D3DXVec3Normalize(&vUp,&vUp);//᪷£5åÿḄîÿÿ◞,T}=íÊḄLᓄafloatfRoll=0.0f,fPitch=0•Of,fYaw=0.Of;if(g-bKey[.DDfRoll=-3*elapsetime;if(g_bKey[,A,])fRoll*3*elapsetime;if(g_bKeyrs,])fPitch*-3*elapsetime;if(g_bKey['W'J)fPitch=3*elapsetime;if(g_bKey[.Q.nfYaw--3*elapsetime;if(g_bKey[_E.]>fYaw=3*elapsetime; 132oooÎ9U//᪷£}=íÊḄLᓄêæ,THḄ>ᔣᔣ3D3DXMATRIXmatPitch,matYaw,matRoll;D3DXMatrixRotationAxis(&matYaw,&vUp,fYaw);D3DXVec3TransformCoord(&vLook,&vLook,&matYaw);D3DXVec3TransformCoord(&vRight,&vRight,&matYaw);D3DXMatrixRotationAxis(&matRoll,&vLook,fRoll);D3DXVec3TransformCoord{&vRight,&vRight,&matRoll);D3DXVec3TransformCoord(&vUp,&vUp,&matRoll);D3DXMatrixRotationAxis(&matPitch,&vRight,fPitch);D3DXVec3TransformCoord(&vLook,&vLook,&matPitch);D3DXVec3TransformCoord(&vUp,&vUp,&matPitch);//(HḄ>ᔣᔣ9__matWorld.__11=vRight.:g._matWorld.__12=vRight.;g__matWorld.__13=vRight.g__matWorld._■21=vUp.x;szvUp•y;g__matWorld.—22=vUp.z;9._matWorld.__23BvLook.xg._matWorld._31g._matWorld._32=vLook.yg_matWorld._33=vLook.z//᪷£OóḄîÿHḄûᔣ3^^&TßḄLᓄᕆD3DXVECTOR3vPosDelta=D3DXVECTOR3(O.Of,0.0f,0.0f)?if(g_bKey['F'])vPosDelta=30*elapsetime*vLook;//ᔣûÎif(g_bKey['V'])vPosDelta=-30*elapsetime*vLook;//ᔣxÎ//fHßg_matWorld._41+=vPosDelta.x;g_matWorld._42+=vPosDelta.y;g_matWorld._43+=vPosDelta.z;üUᙠnᐭ_ê+úåû,✌ᐜX&▣(wᓫß▣,ᯠxᙠFîᵨ☢Ḅ"ṹ᪷£ÒᐭÚᦋ&▣,^ᦋLU`ḄÿG᝱。9Ñ'^036Ûᦊᐸ¦%ᑖḄ¾RUseCXFileMeshr。9:i>ḄM;L7ᙶ᪗NḄM;,x5Lᙶ᪗Ḅ3ᙶ᪗NM;,6ᙠM;i>Dᐸ7ᙶ᪗Nᙠ5Nᦋ{,O@KὅOO᧕é。*9.7ℳÉÊË=>·5i>ûõz>]᝞ooo1339.7.1ÎlᳮÎÉUḄ®Vᓫ。)ᯠÒḄᜧiᦪÎᱥ-ºᨵoᝅ,ÎᱥH#Ḅ÷⊈ᾙ-@▬J。ì:+ÎḄî᎛,@▬JḄ÷⊈ᾙ-do®Î。ᙠ}CÑ⚞r,⁐Ḅú#QᵫyzU`ᩭ⊤9Ḅ,yzU`23ᵫᜧ}ᐗᡂ,}-Qᵫ⚔AᡂḄ。wUhR&Ò⁐)HḄÎÄ,◤⌕w⁐yzU`8¹oᝅ,î◤⌕}⚔A@▬Jᙽ,J᪵ìÎîØᱫA@▬JḄ⚔Ao®Î,JQÎḄlᳮ。⁐U`ḄQ8᪛GjS$᪀(®ᩭḄ,᦮=$᪀Òᨵoᙽ᪷,ᐸ¦-z1ᡈÿ1ë1ᑮ᪷,ᡂ⁐U`Ḅ᦮=᪾¾,᝞9.11ᡠ9。9」1᪾¾÷8ᡠ¿ᥛḄyzU`o[Zᙽ-$ᨵ5=▣:o=Q*+Lᣚ▣(LocalTransformMatrix),⊤9rIJᐸ᱄Ḅ*+ß;=o=QᔠLᣚ▣(CombinedTransfonnMatrix),ᵨJIn$ᔜ*Lᣚ,^R⁐Î。ᙠZSF⁐U`û,◤⌕fH᦮=jS$᪀,ᔠZ=ëyḄLᣚ,XjḄÎ⌴ᑮj,ᐸlᳮeᵨb⊤9。^^child=^^childX^^parcntᐸÒ:•CMchlldḄᔠLᣚ▣;•LAfthlwḄ*+Lᣚ▣;•CMpurtot᱄ḄᔠLᣚ▣。ḄLÎú#yzU`ḄᦋL,V ᨵÎ。VwoSLᣚ¦ØXLᣚᑮo=ᱯ}ß,ᡠ8,⌕ᡂëyḄÎ,◤⌕ooᙢëyᦋLḄß。ZSᦋLḄß,-◤⌕o=Lᣚ▣。ᙠyzU`Ò,SeØ&?÷UîoḄLᣚ▣,23Q&?ᐵÏîÿAḄLᣚ▣(ᓽᐵÏ)。ᯠxᙠÂÃ⁐Îî,᪷£ÂÃîÿn$ò,8´ᑮ÷UîoýḄLᣚ▣,^ᡂëyḄ⁐Î。îᯠÎQ2vLᣚ▣RḄ,V ᙠyzU`Ò,&?Ḅ·QᐵÏîÿAḄLᣚ▣。VûòQ┐IJᐵÏîÿAḄLᣚ▣n$Ḅ。᝞,(ᙠ^îoLᣚ▣QI,,ᙠ^îoLᣚ▣Q2,ᙠ5,^åÿḄ÷Uîo5,ᐸýLᣚ▣eᵨbT。Af=(l-w)xAfj+wxA/jᐸÒ…Qᩗò,2vJ=ᩗò&⁚ᙠ^îoḄLᣚ▣Ò,1I2ᡠᓰḄ@。I 13^oooÎ9ULᣚ▣n$òḄᨬᓫ>Q+ឋò,Jî^=(^^)/(^-5])。9.7.2gᔠᢈGᙠn$Lᣚî,᝞W÷Uo=⚔A¦oᙽ/0,ÖyzU`ᙠÎî4᧕ÈRþÿ,ᱯQᙠoḄ$ᔠ%ß,᝞aᐵ⁚、ᾢᐵ⁚¶。07^830gᔠᢈG,ᓽℳᢈG,8Rᐹᨵá¸ᐵ⁚I^(ᱯQ⁐U`)ḄF。1.gᔠlᳮgᔠḄlᳮQ,07^(^30ᵨi=&▣IU`Ḅ⚔Aᦪ£(⚔Aß+)n$Lᣚ,rKᙢ´ᑮiᝅvLᣚåxḄ⚔Aᦪ£,ᯠxIiᝅ⚔Aᦪ£n$+ឋò,´ᑮoᝅ⚔Aᦪ£ᵨJᨬÐḄF,᝞9.12ᡠ9。ᙠ9.12Ò,Iᨬ*Ḅn$5SLᣚ,óoSÔᨵI⚔An$Lᣚ,rìJI⚔Aᦪ£ý8o=ᓫß▣,óBSIn$ᓫḄèÃLᣚ,rìJI⚔Aᦪ£ý8o=èÃ▣,X5SLᣚxḄ⚔Aᦪ£n$gᔠ,ᯠxn$F,´ᑮᨬе9Ḅ。19.1212£ᔠᙠI⚔Aß+ᦪ£n$gᔠî,Z=gᔠ▣(IJℳU`,gᔠ▣ᓽḄᔠLᣚ▣)IᨬÐ⚔Aß+Ḅ/0ḄᜧÞ,ᵫgᔠᩗ@.}。0^E130᪷£gᔠ▣rKḄᩗ@I⚔Aß+n$+ឋò,;b᝞:^b.end=VxMoXw0+VXM,xW,+…+VxMnxv^ᐸÒ,%16|1£1⊤9gᔠxḄ⚔A;^⊤9gᔠûḄ⚔A;M。,M,,...,I„⊤9gᔠ▣,%,^,,…,%⊤9gᔠᩜ@。ᩗ@·Q⚔Aᦪ£Ḅo%ᑖ,Vwᡠᨵgᔠᩗ@åw1.0,ᡠ8ᙠ⚔Aᦪ£Ò¦◤⌕&?û《-1=gᔠᩗ@,ó《=gᔠᩗ@w1.0ïyû〃-1=gᔠᩗ@å。¶ᙠᮣR⚔AzbÒQᵨ030?9?_9v281~D3DFVF_XYZB5#V^ᢣ}⚔Aᦪ£Òᨬie8ᒹõ5=gᔠᩗ@,PQᙠ8830AÒ,/0Z=⚔AḄgᔠ▣ᨬᜧᦪ▲}w4,ᡠ8ᨬi¦ᵨû☢3=gᔠᩗ@。9:07(^30Aw▲ᑴZ=⚔AᨬiZ=gᔠ▣Ḅ/0,IKJℳÎyzU`,ᓽZ=⚔AᨬiZᙽḄ/0。᝞Wᵨgᔠ,ᑣᙠ⚔Aᦪ£ÒᒹõrKḄgᔠᩗ@ᦪ£。ᙠℳÎy ·5i>OOO135zU`Ò,Z=⚔A-ᒹõo=/08Ḅᑡ⊤。ᑡ⊤/0K⚔AḄZ=Ḅᩗ@1ê。2.gᔠrᐵFG᝱(wᢣ907830FAw᝞。(1)(gᔠ▣Vwgᔠ◤⌕ᵨi=&▣,᝞9.10Òᡠ^9ḄgᔠᦔW,◤⌕ᵨ5=&▣,Jî&ᵨ181!1300^(^9:90^700^()>(&▣î,◤⌕Xóo=¸ᦪ(w0303_o0X0^^^^8Q,óB=¸ᦪ(wrKḄgᔠ▣。᝞☢Ḅ"ṹ^9wRᾢ%îᦔW(Ḅgᔠ▣。floatBendAngle=D3DX_PI/4.0f;D3DMATRIXmatUpperArm,matLowerArm;//ÔᨵÎ,ᵨᓫß▣D3DXMatrixIdentity(matUpperArm);d3dDevice->SetTransform(D3DTS_W0RLDMATRIX(0),&matUpperArm);//¹åèÃ45°D3DXMatrixRotationX{matLowerArm,-BendAngle);d3dDevice->SetTransform(D3DTS_W0RLDMATRIX(1),&matLowerArm);9:ᙠû☢ᵨḄ030×5_〜0X[0,▭QD3DTS_WORLDMATRI(0)。(2)(gᔠ>ᙠFî,ᐹ#ᵨ|=gᔠ▣rKḄᩗ@I⚔An$gᔠ,ᵫFG᝱D3DRS_VERTEXBLENDᑴ,KFG᝱ḄÌòwPp5`D3DVERTEXBLENDFLAGS。3ᵨḄgᔠ᪗¤Oᐸõ©᝞。•D3DVBF_DISABLEἭᵨ⚔Agᔠ,¦ᵨ030×5_〜0X1^^^^8(0)(Ḅ&▣。•D3DVBFJWEIGHTSᵨ030×5_^0X[04×X19(0)030×5_〜0X1^^4-ATRIX(1)(Ḅ5=gᔠ▣I⚔An$gᔠ。*D3DVBF_2WEIGHTSᵨ030×5_>¥0X1^1×ᑿ(0)、D3DTS_WORLDM-ATRIX(1)、D3DTS_WORLDMATRIX(2)(Ḅ}=gᔠ▣I⚔An$gᔠ。•D3DVBF_3WEIGHTSᵨ030×5^¥0X[01×X1᱄(0)、D3DTS_WORLDM-ATRIX(1)、D3DTS_WORLDMATRIX(2)、D3DTS—WORLDMATRIX(3)(Ḅ4=gᔠ▣I⚔An$gᔠ。•D3DVBF,0WEIGHTS¦ᵨᩗ@w1.0Ḅo=▣。ᙠℳýÎÒ,IJÖ¦oᙽý/0Ḅ⚔A,◤⌕ᵨK᪗¤。3.@A⚔Agᔠ04^〖302v@A⚔Agᔠ,᡽/Iᵨi=gᔠ▣gᔠ⚔AḄ¿ᢝ。ᙠ@A⚔AgᔠÒ,gᔠ▣Ì&?ᙠ▣&⁐r(e8Úᡂo=▣ᦪ)Ò,ᵨ▣@AᩭAᵨᱯ}Ḅgᔠ▣,▣@AÄw⚔Aᦪ£Ḅo%ᑖᵫZ=⚔A。▣@Aᵨ8ßN¤᦮ᦪ⊤9,ᨬᜧ@Aw255,ᡠ8ᙠ▣&⁐rÒ,ᨬieØ◤⌕&?256=gᔠ▣。030€?59$᪀Ḅ^^881E41^^^1818ᡂᕒ⊤9ìû(ᜓI@A⚔AgᔠḄ¿ᢝêæ。᝞W93%"88^41^ᓄ18^Ḅòw0,⊤9ìûh(ᜓS¿ᢝ@A⚔Agᔠ。᝞W 136oooÎ9UMaxVertexBlendMat^ixIndexḄòSw0,⊤9gᔠ▣Ḅᨬᜧ@7SMaxVertexBlendMatrixIndex,ᓽìûh(ᜓ¿ᢝḄ▣&⁐rᨬᜧ4wMaxVe^texBlendMatrixIndex+l。᝞Wᵨ:⚔AᜐᳮUb,ᑣ▣&⁐rḄᨬᜧ4w256,S¶Qᔲ◤⌕I+ᔣn$gᔠ。Vw0©6830Ò▲}Z=⚔Aᨬiᑮ4=gᔠ▣Ḅ/0,ᡠ8Z=⚔Aᨬiᨵ4=▣@A,Z=⚔AḄ▣@AÌᔠᡂo=0>^010)ᦪn$?;⊤9。VwZ=⚔Aᨬi4=gᔠ▣Ḅ/0,ᡠ8ᙠFo=}î,ᨬieØ◤⌕ᵨ12=gᔠ▣,ᙠJ*êæ,▣&⁐rÒᨬ´◤⌕ᒹõ12=gᔠ▣。9.13^9o=⚔Aᵨ▣@AAᵨ4=gᔠ▣,ÒḄ⚔A2v▣@AAᵨ▣&⁐rÒ@Aw0、2、5、6Ḅgᔠ▣。9.14^9Fo=}î,᝞<2v▣@AAᵨ▣&⁐rÒḄ12=gᔠ▣。Paletteof------------,256matricesDWORD—______0•------vertex6789255C^325519.13⚔@Ḅ4▣]19.14:823⚔@Ḅ12▣]⌕UÖᵨ@A⚔Agᔠ,◤⌕XFG᝱D3DRS_INDEXEDVERTEXBLENDENABLE(w1X0£。᝞WÖᵨ@A⚔Agᔠ,ᑣᙠ⚔Aᦪ£Ò◤⌕ᒹõ▣@Aᦪ£。᝞WἭᵨ@A⚔Agᔠ,PQ-ÖᵨgᔠØ,Jîᙠ⚔Aᦪ£ÒS◤⌕ᒹõ▣@Aᦪ£,Z=⚔AḄ▣@AÒAw0、1、2、3。4.⚔ ᔠ 1)S¶Qᔲᵨ@A⚔Agᔠ,-Q2v@A^▣&⁐rÒAᵨgᔠ▣。2)᝞WSᵨ@A⚔Agᔠ,ᑣgᔠ▣@Aᨬᜧw3, ᙠ⚔Aᦪ£ÒS◤⌕ᒹõ▣@A,▣@AÒAw0、1、2、3。3)᝞Wᵨ@A⚔Agᔠ,▣@Aᨬᜧòw255, ᙠ⚔Aᦪ£Ò◤⌕ᢣ}/0K⚔Agᔠ▣Ḅ@A。e4)ᵨgᔠåû,✌ᐜ◤⌕bÅìû(ᜓ¿ᢝḄ&⁐r4Qᔲg⌕Õ。Vwᵨ:⚔AᜐᳮUbî,ᨬᜧgᔠ▣@Aw255,}g⌕Õ。᝞Wᙠh⚔AᜐᳮUb,▣&⁐4SØg⌕Õ,¦◤ᓫÃᣚwᵨ:⚔AᜐᳮUbᓽe。9.7.3ℳ½ë}õôℳÎyzU`ᦪ£Ḅ¹8OFÛcᩖ,w¯Jᵨ,ᙠûXᜐᳮℳÎyzU`ḄvÄÊᑮo5$᪀Ò,8ÐåÿḄᐵj᝞9.15ᡠ9。ᔜ5$᪀Ḅᐹ#Rè¸ὃV"ṹ,V"ṹÒÈ*dḄü³,ᙠûIJ5$᪀n$⌕CD。 ·5i>ooo137CSkinMeshCAllocateHierarcby«1ô》U)3DXAllocateHierarchy«ᦪ£5`》«ᦪ£5`》D3PXFRAME_DERIVEDD3DXMESHCONTAINER_DERIVEDr^t«ᦪ£5`》«ᦪ£5`》_______D3DXFRAME______________D3DXMESHCONTAEVER_______♦-------19.15ℳÉÊË=>·5i>=11.D3DXFRAME^^IJℳÎ,wØTRU`HᒹõḄÎ,◤⌕ᑖ&?U`Ḅᔜ%ᑖOrᐵ1ê,,2v᪛G$᪀Xᔜ%ᑖᔠ®ᩭ。ᙠ0ᓄ30Ê,ᵨ0309?^^$᪀&?U`Ḅᔜ%ᑖ,K$᪀Ḅ}©᝞。typedefstructD3DXFRAME{LPSTRName;//᪾¾È7D3DXMATRIXTransformationMatrix;//*+Lᣚ▣LPD3DXMESHCONTAINERpMeshContainer//@▬JKḄyzD3DXFRAME*pFrameSibling;//ᐘQ᪾OD3DXFRAME*pFrameFirstChild;//óo=᪾¾};D3DXFRAME,*LPD3DXFRAME;ᐵJK$᪀ᨵ5A◤⌕Û:oQ2v??8068ᓄ17Í??0^1^€^1<1J5=ᡂᕒX᦮=U`᪾¾(¾)8᪛G$᪀ᔠ®ᩭ;BQpMeShC0ntainerᡂᕒᢣᔣo=@⊤,@⊤Ò&?@▬JKḄyzᦪ£。w¯JÑḄR,ID3DXFRAMEn$᡽/,8¹o=&?᪾¾ᔠLᣚ▣Ḅᡂᕒ,᝞ᡠ9。StructD3DXFRAME_DERIVEDspublicD3DXFRAHE{D3DXMATRIXA16CorobinedTransformationMatrix;//ᔠLᣚ▣2.D3DXMESHC0NTAINER^K$᪀&?᪾¾Ò÷yzU`rᐵḄᦪ£,ᐸ}©᝞,typedefstructD3DXMESHC0NTAINER{LPSTRName;//yz4ᘤÈ7D3DXMESHDATAMeshData?//yz5`ᦪ£LPD3DXMATERIApMaterials;//yzᩞWᦪLPD3DXEFFECTINSTANCEpEffects//ᵨJeÑOà+,qó13» 138oooÎ9UDWORDNumMaterials;"ᩞᦪDWORD*pAdjacency;//ê11êLPD3DXSKININFpSkinInfo;"ℳ1êD3DXMESHC0NTAINER*pNextMeshContainer;//᪾¾ÒḄo=yzK$᪀ḄᡂᕒÛ4᧕ᳮ,᪵w¯JÑR,·ID3DXMESHCONTAINER$᪀n$᡽/,8¹ᐸ¦oᡂᕒ,᝞ᡠ9。StructD3DXMESHC0NTAINER_DERIVED:publicD3DXMESHC0NTAINER{LPDIRECT3DTEXTURE9*ppTexturesj"[ᳮᦪ//8Q÷ℳᜐᳮrᐵḄᡂᕒLPD3DXMESHpOrigMesh;DWORDNumAttributeGroups;DWORDNumlnfl;LPD3DXBUFFERpBoneCombinationBuf;D3DXMATRIX**ppBoneMatrixPtrs;D3DXMATRIX*pBoneOffsetMatrices;DWORDNumPaletteEntries;boolUseSoftwareVP;>?3.〇5"63!ô05^0^8115QᨬcᩖḄo=5,ᡠᨵ÷ℳÎrᐵḄᢈGRd⁚-ÊᙠK5Ò,K5Ḅ}©᝞ᡠ9。classCSkinMesh{private:LPD3DXFRAMEm_pFrameRoot;ID3DXAnimationCantroller*m_pAnimController;UINTm_NumBoneMatricesMax;public:boolm_bPlayAnim;//᪗QᔲÂÃÎD3DXVECTOR3m_vObjectCenter;floatm_fObjectRadius;private:HRESULTSetupBoneMatrixPointers(LPD3DXFRAMEpFrame);HRESULTSetupBoneMatrixPointersOnMesh(LPD3DXMESHC0NTAINERpMeshContainer);voidUpdateFrameMatrices(LPD3DXFRAMEpFrameBase,LPD3DXMATRIXpParentMatrix);voidDrawFrame(IDirect3DDevice9*pd3dDevice,LPD3DXFRAMEpFrame);voidDrawMeshContainer(IDirect3DDevice9*pd3dDevice,LPD3DXMESHC0NTAINERpMeshContainerBase,LPD3DXFRAMEpFrameBase);public:HRESULTCreate(IDirect3DDevice9*pd3dDevice,WCHAR*strFileName);HRESULTRender(IDirect3DDevice9*pd3dDevice,D3DXMATRIXA16*pMatWorld,floatfElapsedAppTime=O.Of);HRESULTDestory();public: ·5i>Qoo139CSkinMesh();}?2v☢Ḅ}©e8ÚÈ,05—4^ᓃ5¦I᜜;:}=ᡂᕒᦪ。ᐸÒ,0^()ᦪ_`ℳÎyzU`Ḅ_`,⌕"ṹ᝞。HRESULTCSkinMesh::Create(IDirect3DDevice9*pd3dDevice,WCHAR*strFileName){HRESULThr;CAllocateHierarchyAlloc;//¹ℳÎ_yzU`D3DXLoadMeshHierarchyFromX(strFileName•D3DXMESH_MANAGED,pd3dDevice,&Alloc,NULL,&m_pFrameRoot,&m_pAnimController));//(▣SetupBoneMatrixPointers(m_pFrameRoot));//T,¼ᳫḄÒmÇD3DXFrameCalculateBoundingSphere(m_pFrameRoot,&m_vObjectCenter,&m_fObjectRadius);returnS_OK;>Create()ᦪ✌ᐜ&ᵨD3DXLoadMeshHierarchyFromX()Àᦪ,ᙠ0C110。&'À61^1^=Ḅ,^.9ᦻ¹jS$᪀Îᦪ£,Jᦪ£Q8᪛GjS(®ᩭḄ,ᐸÒᡂᕒLm_pF^ameR00tᢣᔣyz᪾¾Ḅ᪷⁚A,î_`Îᑴᘤ1ô。ᯠx&ᵨᨵᡂᕒᦪ86ᖼ80¹{^1½?07ᕸ£)ᦪ,wᔜḄᔠLᣚ▣ᑖrKḄ?;ÿ,,*+ᓄwḄ*+Lᣚ▣。ᡂᕒᦪX6^᝞^)_ï⁐U`ḄF,"ṹ᝞。HRESULTCSkinMesh:sRender(IDirect3DDevice9*pd3dDevice,D3DXMATRIXA16*pMatWorld,floatfElapsedTime){if(m_bPlayAnim==true&&m_pAnimController!=NULL)m_pAnimController->AdvanceTime(fElapsedTirae,NULL);UpdateFrameMatrices(m_pFrameRoot,pMatWorld);DrawFrame(pd3dDevice,m_pFrameRoot);returnS_OK;>X6'6[()ᦪ✌ᐜ2v1』&0^0P01^ᡂᕒ᪷£5åÿḄîÿÿ◞nU`Î,ᯠx&ᵨᨵᡂᕒᦪUpdateFrameMat^ices()fH᦮=᪾¾jSÒZ=᪾¾ḄᔠLᣚ▣,ᨬx&ᵨᨵᡂᕒ01^^3()ᦪF᦮=᪾¾jS,ᐸÒDrawF^ame()ᦪᨬÐQ2v&ᵨᨵᡂᕒ£^^1^0ᡷ᝞ó()ᦪF᪾¾ÒḄyzU`Ḅ。068107()ᦪ_`³Ã_`ḄrᐵI^,✌ᐜ&ᵨ030᱄?^11^068^<^0ᦪ,ᙠ0110(^#^3^1^()5Ḅ³Ã᦮=yz᪾¾,ᯠx³ÃÎᑴᘤI^,"ṹ᝞。HRESULTCSkinMesh::Destory(){CAllocateHierarchyAlloc; 140oooÎ9UD3DXFrameDestroy(m_pFrameRoot,&Alloc);//├᪾¾OᐸyzSAFE_RELEASE{m_pAnimController);returnS_OK;>9:1)ℳyzU`Q8᪛GjS$᪀(®ᩭḄ,SffASD3DXFRAME_DERIVED^᪀5`,ᐸÒZ=᪾¾⁚A-2vD3DXMESHCONTAINER_DERIVED$᪀&?÷årᐵὶḄyzᦪ£。2)┐I᦮=yzU`Ḅ}=vÄ:(▣、fH▣、F᦮=U`,-◤⌕┐I᪛G᪾¾jSÒḄZ=᪾¾n$,wû◤⌕ᔊ᦮=᪾¾jS。ᙠCSkinMesh5Ò,Q2v¤ð&ᵨḄ>bRᔊḄ。 J}=vÄᨬÐ-⌕ᑮ᪾¾ᡠᒹõḄyzᦪ£。4.〇1700316^^「3「(^^5᝞û☢ᡠñ,Direct3DD3DXMESHCONTAINERD3DXFRAME5=$᪀,ᵨJ᪀`U`Ḅ᦮=᪾¾$᪀,PQ23◤⌕IJ5=$᪀n$᡽/,8&?ᐸ¦ᡠ◤⌕Ḅᦪ£。JQ᦮=U`᪾¾$᪀ÒḄZo%ᑖ(Z=᪾¾⁚A)ᐹ#◤⌕ᒹõᦪ£,¦ᨵÑᕒ)Å⍝,ᡠ8ᵨ030᱄[ᢕ(1?᝞81^^ᖾ(^^^011^0ᦪ¹U`î,07830S⍝◤⌕wU`ḄZo%ᑖ(Z=᪾¾⁚A)&?ᦪ£, &ᵨ030᱄?81^0^0*()ᦪ³ÃU`î,·S⍝◤⌕³ÃI^。ᡠ8Ñ◤⌕)Å_`_`³ÃZ=᪾¾⁚A,JìQ011003161^ᖾ'v5ḄÄᵨ。ᓚ1100316È6ß^1^5öD)1030110^^6È6ß1。ᓃv1ô,1030110。16□68。1^¦Z=³ᦪ。0110(^7ᕸ^1^5◤⌕@ᑏJZ=³ᦪ,[ᡂ☢ᑮḄ_`³ÃZ=᪾¾⁚AḄÃÄ。ᐸÒCreateFrame()CreateMeshComainer()ᦪ_`_`᪾¾⁚A,068ᓃ0>^『36()068ᓄ0>^6$1^01^*7H1()ᦪ_`³Ã᪾¾⁚A。û᜜,2*CAllocate1148^1^58¹5=ᨵᦪ,ᵨJ#᪾¾⁚AḄ_`。ì&ᵨ0309[0&4^᱐^(%?«¤ᦪ^.9ᦻ¹U`î,Kᦪ◤⌕ᔊU`Ḅ᪾¾jS。ᙠᔊvÑÒ,┐IZo%ᑖ,&ᵨ€1100316È6ᕸ(^5Ḅᕸ16?^6()CreateMeshCOmainer0ᦪwK%ᑖ_`o=᪾¾⁚A,îX᪾¾⁚A8᪛G$᪀(®ᩭ,^ [ᡂℳÎyzU`Ḅ¹_`ÃÄ。ì&ᵨ0309?^1^06·()ᦪ³ÃyzU`î,᪵◤⌕ᔊ¹yzU`î_`Ḅ᦮=᪛GjS$᪀,,┐IZ=⁚A&ᵨ01】00816È6^1^&>^5068“0>^^0^0068᝞>^681^0ᡷ&^1()ᦪ³ÃrᐵI^。9:103091100316È687(±>^1ôḄZ=ᦪ▭QZ=%&ᦪ,ᵫÑᕒ}©,8"830jk&ᵨ。5.ℳÎyzU`5ᵨÓᯠℳÎyzU`ḄRÛcᩖ,PQ05^1^^81^|Ḅᵨᓾᓝᑖ>¯。9Ñ'©5^1^^ᓄ^9K5Ḅᵨ,✌ᐜ}©€5—^©5Ḅo=ᢣ┐L。CSkinMesh*g_pSkinMesh=NULL?"yzU`I^1ᩭ_`,*+ᓄℳÎyzU`I^,⊤9o=⁐。 ·5i>OOO141g_pSkinMesh=neyCSkinMesh();V_RETURN(g_pSkinMesh->Create(g_pd3dDevice,L"tiny.x"));ᯠx&ᵨX61^ª()ᦪn$F。g_pSkinMesh->Hender(g_pd3dDevice,&g_matWorld,timeDelta);ᐸÒ9」^^011(1Q⁐Ḅ&▣,L1061L3Q5åÿḄî|]7]◞,ᵨᓝn⁐)HḄÎ。ᨬxᙠÑ⌨Èåû&ᵨ'ᕸ()ᦪ,³Ã⁐U`I^。f(g_pSkinMesh1=NULL)g_pSkinMesh->Destory();SAFE_DELETE(g_pSkinMesh);e8ÚÈCSkinMesh59.5⁚}©ḄCXFileMesh5ᙠᵨ>QrḄ。9Ñ1^05^0ᔖ68ᓃḄ$ᦔW᝞9.16ᡠ9。9.16ℳÎyzU`9.8yzU`ᙠ0^^30:#Òᓰᨵ@⌕Ḅᙢß,ᡠ8»áâÛᜧḄ©CDrᐵᑁ4,ᒹID3DXMeSh1ô 、᝞<ᑭᵨ0309?Ḅᦪ_`ᓫ|<#yzU`}CᦻyzU`、yzU`Úᓄ,8O᝞<ᵨ.9ᦻyzU`¶ᑁ4。»RRo=ᓫḄ.9yzU`5,ᨬxCD᝞<ᑴ}CÿÒᱥ#ḄG᝱,8OℳÎyzU`Ḅrᐵᑁ4。2v»Ḅz{,e88^^30ÒyzU`Ḅᵨ,PQ᝞W◤⌕UᐭᳮyzU`,`Ú/ὅẆñᑖ᪆.9ᦻḄzb。7ᦻQo*:ÃzbḄᦻ,DirectX.ᦻ᫏I.9ᦻzb*dḄÛ。a!1.ᑖ_`,Fo=«>#、ᳫ、i¼8Oᙊ#yzU`。2.ᐜFo=yzU`,ᯠx8+᪾Ub¿ᑴKyzU`Ḅ᜜1#。3.ᐜFo=yzU`,ᯠx8mnḄᩞW¿ᑴyzU`Ḅ᜜1ᳫ。• 142oooÎ9U4.Úᦋ09116?^^&5Ḅ¦ᓺ¹[()ᦪ,ᐕ¡⌱àQᵨyzU`)HḄᩞWRQᵨᐸ¦ᩞW,^e8ᜐᳮÖÔᨵᒹõᩞWᦪ£ᡈᩞWᦪ£SìḄyzU`。5.ᵨSḄÚᓄ>bOᐸᔠÚᓄyzU`,ᑖ᪆ÚᓄᦔW。6.Úᦋ9Ñ(^^^(^^8〖&',zᓣ!U`᪷£ìûÑ$îÿSeòḼo=ᙊᕜ$。7.$ᔠ9.7⁚ÒḄCD,ᑖ᪆€1100316^^ᖾv5€5&^^68ᓃ5ḄR。 Î10U@Yᮣ.μjkQ}CÑ⚞rÒᵨJRᱯPᦔWḄo*3@⌕ḄᢈG,KᢈGQᵫReeveSJ1983✌SÈḄ。2vjke8ᵨ3ᓫḄᩭ᪀⌼cᩖḄᱥ#,8wUÎ᝱ḄSöᑣᱥ#,᝞o、íᯚ、、¶,£ᨵÔḄᢈGf。10.1μ)©ᳮo[êæ,Ḅ|<ᱯᓝᑖᓫ,e8¬ᵨo=²ᡈo=ÞḄi¼ᩭ⊤9。23Qo=$ᨵ[ᳮḄZ¼。᝞WÈÒAḄᙶ᪗ḄᜧÞ,SãTÈ¿ᑴᡠ◤⌕Ḅ4=⚔AḄßᙶ᪗。ᵫJ23ᵨá☢SQ#⊤9o=,ᡠ8◤⌕Z¼+Ð☢ᔣe8ὅ,J⌕ᵨâÙr(billboard)ᢈG。âÙrᢈGḄlᳮQ,ᙠFo=i¼î,✌ᐜ᪷£e8>ᔣ᪀⌼o=èÃ▣,ᑭᵨKèÃ▣èÃi¼ᐸ☢ᔣe8ὅ,᝞We8>ᔣSeLᓄ,⌕SeèÃi¼。jkᵫᜧḄ᪀ᡂ。Z=ᐹᨵo}ឋ,᝞ß、ᜧÞ8O[ᳮ,eØR◤⌕7⁐、n、Τ、¹¤、nX»¶}ឋ。o=ñᨵ᪵Ḅ}ឋ,⌕Ì.Jᐹ#ḄKᵨ。o=jkQdîÿSeLᓄḄ,ᙠnX»ḄZoo,-⌕[ᡂ84pÃÄ。1)^VonH。ono}ᦪpḄH,ᐸ*+}ឋ23ᵫd!vÑᑴ。iiᵫßJÿ)=ßḄVon。2)fHRᨵḄ}ឋ。᪷£$îÿfHᡠᨵḄrᐵ}ឋ,᝞,ᨵߤ}ឋ,◤⌕᪷£lᩭḄß、¤OóḄîÿTḄHß、H¤¶。3)ᑤ◀“Ù”Ḅ。bÅᡠᨵḄnX»,᝞W#R)“Ù”,ᐸnX»w0ᡈ¤ᔠᐸ¦Ùᩩ,ᑣXK^jkÒᑤ◀。4)¿ᑴ。XjkÒᡠᨵḄ?R¿ᑴÈᩭ,^ ´ᑮᡠ◤⌕ḄféᦔW。9:5ᡠᨵḄμVᵨᵫO:82ñᡂḄ2ᩭ⊤]Ḅ。^᝞,ᙠiØR×D,:ᵨO⚔@᪀ᡂḄᩩ¢ᩭ⊤]R@μ。wD,ᓽãμÊḄμVᵨ2⊤],5áᕡḼᙠMNμD,ä⌕ᵨdT³ᢈ4。^᝞,ᙠiØÖ×D,9jᵨ2⊤]ÖÙμ,|n iØÖÙᙠUÊ¿VWXḄY᝱,Ò5ðᵨdT³ᢈ4。 144oooÎ10U10.2μ<@Yᮣ883ô2vAÖᮣ(pointspirits)ᢈGIjkḄRḄ¿ᢝ。e8AwAÖᮣQᐹᨵÒAßᜧÞḄ,ᙠFîØT᪷£ᐸÒßᜧÞ)ÎTÈi¼Ḅ4=⚔A,,)ÎèÃ,8ᐸ☢ᔣe8>ᔣ。10.2.1AÖᮣ⚔A$᪀⚔AzbᙠÑÒ,o=AÖᮣᵫo=⚔A⊤9,⚔A◤⌕ᒹõß1ê,᪷£◤⌕eØRᒹõAḄᜧÞ、7⁐、[ᳮᙶ᪗¶1ê。ᐸÒAḄᜧÞQAÖᮣ⚔AᱯᨵḄ⚔Aᐗ²,Kᐗ²ᵫ030?9?o?15£2᪗¤ᢣ}。᝞☢Qo=AÖᮣ⚔A$᪀Ḅ9。structPOINTVERTEX{D3DXVECTOR3position?D3DCOLORcolor;floatsize;>;#defineFVF_POINTSPRITE(D3DFVFXYZ|D3DFVF_DIFFUSE|D3DFVFPISEZ)10.2.2AÖᮣḄᜧÞZ=AÖᮣḄᜧÞ,ᵫ£^^830᪷£ᙠÑÒᢣ}ḄᜧÞᐸᑮe8AḄ.ãT´ᑮ。AᐗᜧÞḄ},e8ᭆw8}=p。óop,wZ=AÖᮣᢣ}o=ᜧÞ,Jî◤⌕w⚔A8¹⊤9AÖᮣᜧÞḄᡂᕒL,,ᙠ⚔AzbÒᒹõ030?¥?_?15£2᪗¤,ᡈ2v030&5_?(^^5£FG᝱wᡠᨵAÖᮣᢣ}rḄᜧÞ。9:᝞®⚔@zᨵEL&ᓃᜐᳮḄ⚔@,ᑣ@Yᮣᜧ ×Æ1ᙶ᪗ᓫL0Ḅ。ᔲᑣ,@YᮣᜧMNµ᪗àḄ34nᓫL,wDµZ`☢ḄOö。óBp,᪷£FG᝱D3DRS_POlNTSCALEENABLE,}AᜧÞḄT>b。᝞WKFG᝱w〖31#,ᑣXopÒᢣ}ḄᜧÞz1ÄwefÿAḄᜧÞ。᝞WKFG᝱Stme,ᑣ᪷£☢Ḅ;bTAÖᮣᙠefÿÒAḄᜧÞ。ᐸÒ:•ᡀwÑÒwZ=Aᢣ}ḄᜧÞ,ᡈᵫFG᝱030X5』0Ì×512£wᡠᨵAÖᮣᢣ}ḄᜧÞ。•A、B、0nᦪ,ᑖ,ᵫMNf᝱0308_?0[L30C1R_C、D3DRS_POINTSCALE_B<0301^_ᓹ0L5€C1£_〔[÷。•ᓃwìûfô。•'wAᑮe8AḄ.ã。01"(^30FAwB᪷£AḄß)ÎTÈAᑮe8AḄ.ã。ó}p,ᑴAÖᮣḄᨬÞᨬᜧXy。ᨬÐᙠFp᪗FAÖᮣî,ᐸᜧÞᨬᜧ @Yᮭ.μOOO145SØvᵫFG᝱D3DRS_POINTSIZE_MAX(ḄᨬᜧXy,·SØÞJᵫFG᝱D3DRS_POINTSIZE_MIN(ḄᨬÞXy。ᐸÒ030X5_?0«^5I£_^᱄(ḄòÞJ¶Jìûh¿ᢝḄᨬᜧò。9:MNf᝱0305_?0^L512R_^^᱄<0305_?01〜L517£」^û▲ᑴḄᨬᙠMNµ᪗àMN@YᮣDḄ`,x59à☢ḄÜ6BÀḄᙠ ×Æ1ÊḄ`,ᓫLn34。9::9030€C?59᪀Ḅ^J?08å5126ᡂᕒ·äA$*hsᢝḄ@YᮣᜧḄᨬᜧ。10.2.3AÖᮣḄ[ᳮᙶ᪗FG᝱D3DRS_POINTSPRITEENABLEᑴQᔲwAÖᮣḄ4=⚔AT[ᳮᙶ᪗,Kᵨ[ᳮ。᝞WKFG᝱w^^,ᑣw4=⚔AᑖT[ᳮᙶ᪗,,X᦮©[ᳮ᧜]ᑮAÖᮣ⊤☢。ìᜧÞᜧJo=²ᜧÞî,JQᨵᵨḄ。᝞WKFG᝱w〖&1^,ᑣì>4=⚔AḄ[ᳮᙶ᪗¦Qᓫᙢ^AḄ[ᳮᙶ᪗cᑴvᩭ,ᡠ84=⚔AḄ[ᳮᙶ᪗QrḄ。10.2.4AÖᮣḄF(AÖᮣḄᜧÞw^ᙠefÿÒḄᙶ᪗w^(^,>2,^),ᑣXKAÖᮣᐝ᪕ᓄwo=ì>î,4=⚔Aᑖw:(Cx+s/2,y+s/2,Zyvv)、(s+s/2,y-s/2,z,w)、(x-sl2,y-s/2,z,w)、(x-s/2,j+5/2,z,w))0ì>Ḅ7⁐koFwAḄ7⁐。᝞W030X5_?01!^5?X0^^81^FG᝱wᓄû,ᑣì>4=⚔AḄ[ᳮᙶ᪗w:(0.0f,0.0f),(0.0f,1.0f),(1.0f,0.0f),(1.0f,1.0f),᝞10.1ᡠ9。PosiUon=Cc-(x-st2,yfs^,z)(x+s^lt>4-s/2,z)(w,v)=(0,1)(w,v)=(l,1)】0.1AḄF9Uh⚔AᜐᳮUbeØS¿ᢝAḄᜧÞ(Ãþ)。᝞,᝞Wo=HAL(ᜓᙠ_`îᵨD3DCREATE_HARDWARE_VERTEXPROCESSING᪗¤,,030ᓚ?59$᪀Ḅ^?0×52£ᡂᕒLÌ(w1.0ᡈ0.0,ᑣᡠᨵḄA-ÌFwo=²。 146................................................................................................................................ooo^10¾10.3μḄᐹg¯°☢$ᔠ9Ñ5?87?&1&1^,CDjkḄᐹ#R。K9Ñ2vjkUà=àḄᦔW。K9Ñᵨ@⊤&?ᡠᨵ,᪷£$ḄîÿfH@⊤ÒᡠᨵḄ}ឋ,ᑤ◀ÙḄ,8¹H。ᯠx,ᵨÒ÷FrᐵḄᦪ£iᐙ⚔A>?,ᵨ⚔A>?¿ᑴ@⊤ÒḄᡠᨵ。10.3.1$᪀÷⚔A$᪀jkÒḄZ=23ᵨo=$᪀ᩭ⊤9,ᡠ8✌ᐜ◤⌕(TᔠᳮḄ$᪀。ᙠ9Ñ$0^>^111(^5Ò,}©Ḅ$᪀᝞。tPARTICLED3DXVECTOR3m_vPosO;//*+ßD3DXVECTOR3m_vVel0;//*+¤floatm_fTime0;//_`îÿD3DXVECTOR3m_vPos?//ìûßD3DXVECTOR3ro_vVel?//ìû¤D3DXCOLORm_clrDiffuse;//7⁐PARTICLE*m_pNext;//ᢣᔣoḄᢣ┐☢Ḅ$᪀ÒÔᨵᵨnXòᱯឋ,ᙠÑÒ2vᑨeQᔲᑮᙢ☢ᩭᑨeQᔲ?R。VwᙠÑÒᵨ@⊤ᩭ&?jkÒᡠᨵ?RḄ,ᡠ8ᙠ$᪀Ò8¹o=ᢣᔣo=$᪀Ḅᢣ┐。wFjkÒḄᡠᨵ,◤⌕ᵨ⚔A>?&?÷FrᐵḄ⚔Aᦪ£。9Ñ5ᓹ^ᓹ?&1ᓄ^ᵨḄ⚔A$᪀O⚔Azb᝞。structPOINTVERTEX{D3DXVECTOR3pos;D3DCOLORcolor;>;#defineD3DFVF_POINTVERTEX(D3DFVF_XYZ|D3DFVF_DIFFUSE)9:Táᑖ᪆@1ᐗḄ⚔ᮞ᪀<⊤]μḄμ᪀#1Ḅὶ<,。10.3.2jk5Ḅ}©9Ñ5?〜?3[ᓄ18X÷jkrᐵḄvÄÊᑮ€?3『ᓄ1478165Ò,Ro=2ᵨḄ$᪀ᓄjk,K5Ḅ}©᝞。classCParticleSystem{private:LPDIRECT3DVERTEXBUFFBR9m_pVB;//&?ᦪ£Ḅ⚔A>?LPDIRECT3DTEXTURE9m_pTexture?//[ᳮPARTICLE*m_pParticles;//ìû@⊤PARTICLE*m_pParticlesFree;//ᵨJ%ᦈÙḄ@⊤DWORDm_dwParticleaLim;//@⊤ÒḄᨬᜧᦪ( AÖᮣ÷jkOOO.............................................................I47DWORDdwDiscard;//⚔A+?ØT4ḄᨬᜧᦪDWORDdwFlush;//⚔A>?Z=ᱏfØT4Ḅᦪ(DWORDdwBase;//┝}⚔A§?ᱏfîḄ®+ßpublic:DWORDdwParticles;//ìû@⊤ÒḄᦪpublic:CParticleSystem(DWORDdwFlush,DWORDdwDiscard);—CParticleSystem();HRESULTCreate(LPDIRECT3DDEVICE9pd3dDevice);HRESULTUpdate(floatfSecsPerFrame)HRESULTRender(LPDIRECT3DDEVICE9pd3dDevice,floatfSecsPerFrame);HRESULTDestroy();>;0^^3"7(^8ᡂᕒᢣᔣ&?jkÒìûᡠᨵ?RḄ@⊤。0^??&1^(^8?^6ᡂᕒᵨJ%ᦈÙḄ。ì)=Ùåx,SQ³ÃKᓰᵨḄᑁ?,QXᐸ@1ᑮ0^^»^768?HᢣᔣḄ@⊤Ò,ì◤⌕onHî,¦⌕^0?&È<^5ᓹ"6@⊤Sw,^ÒÌÈo=⁚A⊤9H,^äSewÙ³Ãᑁ?,w_`Hᑖᑁ?。9:᝞®5NᙢncdḄμÿᑁ[、nμᑖöᑁ[,=µeu½MḄឋð。4nÿᑁ[<ᑖöᑁ[7◤⌕ὑg¼eḄ€ᓹ。D1,wDÁµ⌼ᡂᑁ[hᱏ。☢@AI0?3101&78^15ÒḄᡂᕒᦪn$ᑖ᪆,î³ᐸ¦|=ᡂᕒLℏḄÄᵨ。10.3.3jkḄ_`├éw_`├jk,0?&"ᡷ1781ᕸ5᪀⌼ᦪ、᪆᪀ᦪ、Create()®*6068-0d()ìᦪ01.᪀⌼ᦪ᪆᪀ᦪ᪀⌼ᦪᵨJ*+ᓄᔜᡂᕒL,ᐸ"ṹ3ᓫ,S◤⌕fiḄ³。᪆᪀ᦪ_`³Ã11^^&È(^50_ô?3È(^8?"65=@⊤ÒḄᡠᨵ⁚A,᝞³Ã11^^^0&8@⊤Òᡠᨵ⁚AḄ"ṹ᝞。while(mpParticles){PARTICLE*pSpark=m_pParticles;m_pParticles=pSpark->m_pNext;deletepSpark;>2.〇「8316()ᦪ06509()ᦪᡂᕒᦪ0^&()_`_`[ᳮᵨJFḄ⚔A>?,"ṹ᝞。V_RETURN(D3DXCreateTextureFromFile(pd3dDevice,L"particle.bmp",&m_pTexture));V_RETURN(pd3dDevice->CreateVertexBuffer(m_dwDiacard*sizeof(POINTVERTEX),D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY|D3DUSAGE_POINTS, 148oooÎ10UD3DFVF_POINTVERTEX,D3DPOOL_SYSTEMMEM,&m_pVB,NULL));ᐸÒ_`[ᳮḄ"ṹᡃÐ៉。PQ_`⚔A>?Ḅ"ṹRᨵ|A◤⌕ᱯÛ:1)Vw_`Ḅ⚔A>?ᵨJFAÖᮣ,ᡠ8063^96^8ᓄ1^『0ᦪóB=¸ᦪ1^O§6◤⌕ᒹõ030150_?0^×5᪗¤。2)wឋØ,ᙠóB=¸ᦪ。ᢓ86Ò8¹030-0£_ᑈX0^(^1^᪗¤,^¦ØIK>?n$“ᑏ”vÄ。3)wFᡠᨵ,◤⌕⚣ᙢXᦪ£ᑏᐭ⚔A>?,IJJ*êæᵨÎ᝱>?QᔠᳮḄ,ᡠ8ᙠóB=¸ᦪ'3Ò8¹030-0£」^^«[᪗¤。4)_`Î᝱>?î,ᑁ?ü5`SØwD3DPOOL_MANAGED, ¦ØᵨD3DPOOL_SYSTEMMEMD3DPOOL_DEFAULT。030?00—0£ᓹ01^ᑁ?üឋØ⌕ÚJD3DPOOL_SYSTEMMEM,PQᙠ(ᜓÅᜫî³Ã⚔A>?,ᙠ(ᜓឮcî·◤⌕@Hwjk_`⚔A>?。w¯JÑR,⌱ᵨ030?001^v5×£^£1ᑁ?ü5`,ᐸ"PQ⌕ᜫo}ḄឋØ。ᡂᕒᦪ0^P^0_`├ᵫ<^^ἄ0ᡂᕒᦪ_`Ḅ[ᳮ⚔A>?。10.3.4jkḄfHᡂᕒᦪ。?(^&()_`᪷£ìû$îÿfH᦮=jk。Kᦪ✌ᐜᔊ@⊤ÒḄᡠᨵ,᪷£ìûḄ?RîÿTḄìûߤ,^RIÎḄᑴ。ᯠx᪷£Qᔲᑮᙢ☢,ᑨeìûQᔲÙ,,ᑤ◀ÙḄ。1ᩭ#]HḄ,᪷£5åÿOóḄîÿ.}#]HḄᦪ。IJZ=H,✌ᐜ◤⌕wᐸᑖ?;ÿ,ᯠxØt*+ò,8¹ᑮ@⊤Ò。wHᑖᑁ?î,✌ᐜbÅÔ@⊤QᔲRᨵ⁚A,᝞Wᨵ,ᑣz1Ìo=⁚AÄwHḄ?;ÿ,,@1ᑮìû@⊤Ò,᝞WÔ@⊤w,ᑣwH@H:!?;ÿ。1?ᦪḄR"ṹ᝞。HRESULTCParticleSystems:Update(floatfSecsPerFrame){PARTICLE*pParticle,**ppParticle;staticfloatfTime=0.0f;fTime+-fSecsPerFrame;//fH?ᙠḄ}òppParticle=&m_pParticles;//@⊤while(*ppParticle){pParticle=*ppParticle;//ÌÈìû//TḄHßfloatfT=fTime-pParticle->m_fTimeO;//ìû?RḄîÿfloatfGravity=-9.8f;pParticle->m_vPos=pParticle->m_vVelO*fT+pParticle->m_vPos0pParticle->m_vPos.y+=(0.5f*fGravity)r(fT*fT);pParticle->mvVel.y=pPartJ,cle->mvVel0y+fGravity*fT; @Yᮣ.μooo149//ᑤ◀Ùif(pPart1cle->m_vPO8.y<0//ᑮᙢ{*ppParticle=pParticle->m_pNext;pParticle->m_pNext=m_pParticlesFree;m_pParticlesFree=pParticle;mdwParticles--;>else//Zᜓᜐᳮo={ppParticle&pParticle->m_pNext;>>//8¹HDWORDdwEmited=0;UINTnumEmitedPerPrame=(UINT)(1000*fSecsPerFrame);//"S#]Ḅᦪwhile(m_dwParticlesm_pNext;}else{if(NULL=5=(pParticle=newPARTICLE))returnE_OUTOFMEMORY;pParticle->m_pNext=m_pParticles;mjpParticles=pParticle;mdwParticles++;^―9dwEmited++;//wH(}ឋḄ*+òfloatfRand-((FLOAT)rand()/(FLQAT)RAND_MAX)*2.0f1.0f?//[-l,l]pparticle->m_vPo80=D3DXVECTOR3(0,1,0)//*+ßpParticle->m_vVelO.x=8.Of*fRand;//*+¤pParticle->m_vVelO.z=10.0f;pParticle->mvVel0.y=0.0f;pParticle->m__vPos=pParticle->ro__vPosOpParticle->m_vVel=pPartxcle->m_vVelO;pParticle->m_clrDiffuse=D3DXCOLOR(1.0f,1.0f,1.0f,0f)?//7⁐pParticle->m_fTimeO=fTime;//_`îÿ>returnSOK;ᙠ☢Ḅ"ṹÒ,ᑤ◀ÙḄ"ṹᢈឋ3£,Ûãᳮ,ᙠûÈo9^✌ᐜ,᝞W@⊤ÒḄóo=Ùᑣ◤⌕Úᦋ0_0?3"7(^«Ḅò,᝞Wóo=SÙS◤⌕Úᦋ0^^1^&Ḅò。ᙠóoS+úåû,???3"1(^ᢣᔣḄQ0^^^"1(^5,᝞Wóo=Ù,ᑣ"ṹ*ôô?3ᕲ(^=ô?301¸->11^^^1;BᦋL01_0?3"ᓄ165Ḅò,PQ^óBS+ú:+,???&È016ᢣᔣḄᙢᙬSÙQ!^9?3È(^,K&RS*ppParticle= 150oooÎ10Eᓹ?(^->11^^^1;SBᦋL^^^$ᓄ168Ḅò。 Jាg☢Ḅ◤Õ。`Ú/ὅHdᑖ᪆ᑤ◀ÙîJf"ṹḄ᡻$vÑ。10.3.5jkḄFfHᡠᨵḄrᐵ}ឋåx,1ᩭḄÃÄQXÒ÷FrᐵḄᦪ£iᐕᑮ⚔A>?,8n$F,FvÄQᵫ1^0々4)ᦪ_`Ḅ。Kᦪ✌ᐜ◤⌕(÷AÖᮣrᐵḄᔜ*FG᝱,ᯠxwF([ᳮ8Oᐸ¦FG᝱。Jᑁ4ᙠû☢CDv,SÙF。(rᐵFG᝱åx,X68!^()ᦪXᦪ£cᑴᑮ⚔A>?n$F。23SBXᡠᨵoSឋᙢiᐙᑮ⚔A>?Ò,ᯠxoSឋFÈᩭ。J᪵÷Óᯠze,PQᦔ᳛i。o=lVQ,◤⌕_`T4ᡠᨵᦪ£Ḅ⚔A>?;f@⌕ḄlVQ,ᙠXᦪ£cᑴᑮ⚔A>?ḄvÑÒ,µᓱozᜐJÔG᝱,JQ0?0µᓱÔᨵᙢ)ÃÄḄᐺ`êæ^FjkfḄ>Q,_`o=%&ᔠᳮḄ⚔A>?。ᯠxX⚔A>?ᑖwñᱏf,᝞10.2ᡠ9。iᐙg-=ᱏfåx,FKᱏf,î┝}o=ᱏf,^ᙠµᓱFìûᱏfḄî,0?ôØTöyiᐙ/o=>?ᱏf。⚔A>?:Ùᐳe41^(1^'078€01(1=<ᱏf1ᱏf2ᱏf*.V____________J"=ᱏfe4ó/=ᱏfḄ®+ß⁜m_dwFlush=10.2ᑜᑖwñᱏfḄ⚔A>?Vwozᡈᙠ%ᑖn?»ᑁᜐJ¤ḄÎG᝱,ᡠ8ᓫ☠ᑴḄÎᩭUᔜ*ᱯPᦔWRST,w$iᙢUᔜ*ᱯPᦔW,ÎUᦔWḄᵨQSeᡈḄ。RÎUᦔWḄlᳮQ,IJZ=FiS,ZSòḼḄÎ>ᔣ(9ÎoḄß,ᙠF⊤☢onojᑡḄ,^ onÎUᦔW。X6&ª()ᦪḄR"ṹ᝞。HRESULTCParticleSystem::Render(LPDIRECT3DDEVICE9pd3dDevice){HRESULThr;//AÖᮣrᐵFG᝱pd3dDevice->SetRenderState(D3DRS_.POINTSPRITEENABLE,TRUE);pd3dDevice->SetRenderState(D3DRSPOINTSCALEENABLE,TRUE);pd3dDevice->SetRenderState(D3DRS_POINTSIZE,FtoDW(0.1f));pd3dDevice->SetRenderState(D3DRSPOINTSIZE_MIN,FtoDW(0.00f)pd3dDevice->SetRenderState(D3DRSPOINTSCALE_A,FtoDW(0.00f)pd3dDevice->SetRenderState(D3DRSPOINTSCALE_B,FtoDW(0.00f)pd3dDevice->SetRenderState(D3DRS_POINTSCALE_C,FtoDW(1.00f)//Ust、¿1?&3gᔠ、ᐝ᯿( @Yᮣ.μooopd3dDevice->SetRenderState(D3DRS__ZWRITEENABLE,FALSE);pd3dDevice->SetRenderState(D3DRS_7LPHABLENDENABLE,TRUE);pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE);pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ONE);pd3dDevice->SetRenderState(D3DRS_LIGHTING,false);pd3dDevice->SetTexture(0,m_pTexture);//([ᳮ//wF(ᦪ£OᮣR⚔Azbpd3dDevice->SetStreamSource(0,m_pVB,0,sizeof(POINTVERTEXpd3dDevice->SetFVF(POINTVERTEX::FVF);PARTICLE*pPar^ticle=m_pParticles;POINTVERTEX*pVertices;DWORDdwNumParticlesToRender=0;//}┝}⚔A>?Ḅ®+ßm^―dwBase+=m^―dwFlush;,if(m_dwBase>=m_dwDiscard)m_dwBase=0;//┝}o=⚔A>?ᱏfV_RETURN(hr=m_pVB->Lock(m_dwBase*sizeof(POINTVERTEX),m_dwFlush*sizeof(POINTVERTEX),(void**)&pVertices,m_dwBase?D3DLOCK_NOOVERWRITE:D3DLOCK_DISCARD));//X+ᦪ£cᑴᑮ⚔A+?ᱏf,,n$Fwhile(pParticle){//᪷£ḄΤ}ᐸUÑD3DXVECTOR3vPos(pParticle->m_vPos);D3DXVECTOR3vVel(pParticle->m_vVel);floatfLengthSq=D3DXVec3LengthSq(&vVel);UINTdwSteps?if(:fLengthSq<1.0f)dwSteps=2;elseif(fLengthSq<4.00f)dwSteps=3elseif(fLengthSq<9.00f)dwSteps=4elseif(fLengthSqdwSteps=5elseif(fLengthSq<16.00f)dwSteps=6elseif(fLengthSq<20.25f)dwSteps=7elsedwSteps*8;vVel*=-0.04f/(float)dwSteps;DWORDdwDiffuse=(DWORD)pParticle->m_clrDiffuse;//2vIᐸᙠSßFiSᩭRUᦔWfor(DWORDi=0;iv=vPos;//AᐗḄßpVertices->color=dwDiffuse;//AᐗḄ7⁐pVertices++;vPos+=vVel;//wRUᦔW,}KAᐗḄoß//᝞Wiᐙ[o=ᱏf,ᑣn$F,,┝}o=ᱏfif(++dwNumParticlesToRender==m_dwFlush) 152oooÎ10Um_pVB->Unlock()?//┝iᐙḄᱏf,n$Fpd3dDevice->DrawPrimitive(D3DPT_P0INTLIST,m_dwBase,dwNumParticlesToRen,der);//To=ᱏfḄ®+ß,,┝}oᱏfm_dwBase+=m_dwFlush;if(m_dwBase>=m_dwDiscard)m_dwBase=0;m_pVB->Lock(m_dwBase*sizeof(POINTVERTEX),m_dwFlush*sizeof(POINTVERTEXj,(void**)&pVertices,m_dwBase?D3DL0CK_N00VERWRITE:D3DLOCK_DISCARD));dwNumParticlesToRender=0;//X◤⌕FḄ⚔Aᦪ@HÄpParticle=pParticle->m_pNext;>m_pVB->Unlock();//Fᒖ¤Ḅif(dwNumParticlesToRender){hr=pd3dDevice->DrawPrimitive(D3DPT_POINTLIST,m_dwBase,dwNumParticlesToRender);>//ឮcrᐵ*FG᝱pd3dDevice->SetRenderState(D3DRS__POINTSPRITEENABLE,false);pd3dDevice->SetRenderState(D3DRS__POINTSCALEENABLE,false);pd3dDevice->SetRenderState(D3DRS__ZWRITEENABLE,true)?pd3dDevice->SetRenderState(D3DRS__ALPHABLENDENABLE,false);pd3dDevice->SetRenderState(D3DRS__LIGHTING,true);returnS0K;>VwZiᐙgo=>?ᱏfåxÙn$F,ᨬxo%ᑖiiSBាigo=ᱏf,ᡠ8ᙠ+úF"ṹåxᓫä8¹of"ṹ,ᵨJFᨬxo%ᑖ。R◤⌕ᱯüU┝}Z=⚔A>?ᱏfîḄ┝}᪗。᝞W⚔A>?èg,ᵨD3DLOCNOOVERWRITE┝}᪗¤,᝞W⚔A>?g,^ᜮ:+┝}⚔A>?ᱏf,,ᵨ᪗¤03010(^_0150X0。J5=┝}᪗¤-¦ØᵨJÎ᝱>?。D3DLOCK_0150X0᪗¤ᢣ9hX>?ᑁ4Åx,,]%o=ᢣᔣ@HᑖḄ>?ᢣ┐,.^ᐕ¡ᙠEHᑖḄᑁ?î,ØTöyᵨÌÉxḄ>?ÒḄᦪ£n$¿ᑴ,ᓽ^ᜮ:+iᐙóo=ᱏfî,ØTöyᵨᨬxo=ᱏfn$F1D3DLOCK_NOOVERWRITE᪗¤ᢣ9ᦪ£¦Ø8+¹Ḅ>bᑏᐭ>?,ᓽSØ⌚6ìûᵨJ¿ᑴḄᱏfÒḄᑁ4,^ᙠiᐙo=ᱏfî,e8ᵨiᐙḄᱏfn$F。10.3.6jk9ÑXjkḄrᐵvÄÊᑮ€?3ᡭᓃ1&7ᕸ5Òåx,9Ñ5?87?&ᡭ7(^8ᒕ¤Ḅ @Yᮣ.μOOO153ÃÄQ_`€?3«4178^5ḄI^,&ᵨrᐵḄᡂᕒᦪ[ᡂjkI^Ḅ*+ᓄFÃÄ,ᨬxᙠÑ⌨Èû³ÃjkI^。•✌ᐜ}©o=ᢣᔣ0?3"1(^5785I^Ḅᢣ┐,"ṹ᝞。g_pSprayParticles=newCParticleSystem(500,2000);_`jkI^î,◤⌕w᪀⌼ᦪᐭ5=¸ᦪ:óo=¸ᦪQ⚔A>?ᱏfØT4Ḅᦪ,óB=¸ᦪQ᦮=⚔A>?ØT4ḄÙᦪ。µᯠóB=¸ᦪòQóo=¸ᦪòḄ᦮ᦪë,q10.2。ᯠx&ᵨ(^^()ᦪ,_`FᵨḄ[ᳮ⚔A>?,"ṹ᝞^g_pSprayParticles->Create(pd3dDevice);1ᩭ&ᵨ1?(1&&0X᝞々1()ᦪ,fHjk,F,"ṹ᝞。g_pSprayParticles->Update(fElapsedTime);g_pSprayParticles->Render(pd3dDevice);ᨬx&ᵨ0^Ḅ^()ᦪ³ÃrᐵtV,,ᑤ◀jkI^,"ṹ᝞。if(g_pSprayParticles1=NULL)g_pSprayParticles->Destroy();SAFE_DELETE(g_pSprayParticles)?ᐸ¦ᐹ#Rd⁚è¸ὃV"ṹ,K9Ñ$ᦔW᝞10.3ᡠ9。110.3]^M5?^>^^ᓄ168Aᦔ®jkḄᦔW÷Kᵨ,ᐵÏᙠJ᝞<óFḄÎ,·-᪀⌼ḄÎᦪ。Îᦪ᪀⌼Ḅាì÷ᔲ,z1.}hiᦔWḄ$iÑ。ᙠ9Ñ8?^7?3"ᓃ1^ÒRḄjk,ḄÎᑴÛᓫ。ᐸlᳮQìonî,✌ᐜ+tZ=o=*+¤ß,n$o ⌕Ḅ*+ᓄ,ᯠxᙠZSFjkû,᪷£*+¤、ß@Ô¹¤TZ=Ḅìûß,^ ´ᑮḄÎ。᝞Wὃ⇋ᑮà=Ḅ=¤、à./Ô、0^¶V²,Re8nophi,JV²⌕/0Ḅ#]¤Τ。=᜜,᝞WÙ¹ᑮᙢ☢xḄI]Î,ᦔWBf¹$i。PQ,SQᦔWg$ig,Vw$iḄᦔW◤⌕f¹cᩖḄT,^ B/0ÑḄឋØ。 154oooÎ10UCPartideSystem5Èo=jkḄ᪾¾,¦⌕ᦋLIZ=Ḅᑴ,e8´ᑮUᔜ*SᦔWḄjk。9:]^M5?¥?3À(^8¯°Ḅμ,vTμḄA=ijzÇᑴ¯°íᓫḄᦔ®。n ¯°ÕFᩖḄᦔ®,:ðÁ◤⌕vμzÕeḄÇᑴ,^᝞᪷¸Î¼Ḅ$%&5Nᦋ{μḄX⁐ḄûQ,áḄᦪℏQ³}Ḅ。10.4.3Fááᵨý2Ḅᵫ5=}ᡂḄì>n$F,ᙠFZ=áåû,✌ᐜ◤⌕᪷£áḄßèÃ,᪀⌼rKḄá▣èÃ▣ᩭᑴáḄßï᝱,û᜜R◤⌕(rKḄá[ᳮ。FáḄᐹ#"ṹ᝞ᔆ。for(inti=0;iSetTransform(D3DTS_WORLD,&matWorld);//Fìûápd3dDevice->SetTexture(0,m_pTex[m_Snows[i].TexIndex]);pd3dDevice->SetStreamSource(0,m_pVB,0,sizeof(POINTVERTEX));pd3dDevice->SetFVF(D3DFVF_POINTVERTEX);pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);>9:üU☢Ḅ4F"ṹo⁚Ò€ᓹ3[ᓄ165>^6015ḄX61^6[0ᦟḄR"ṹåÿḄ。9Ñ5^^1%Ḅᐸ¦Rd⁚è¸ὃV"ṹ,ᐸ$ᦔW᝞10.4ᡠ9。〖0.4ᦔWU 156oooÎ10U10.5»✌ᐜCDjkḄlᳮAÖᮣᢈG,ᯠx$ᔠ98?^#?5141^CD0©^130ÑÒjkḄᐺ`R,ÈRjkḄ᪾¾。jkQᵨJRᱯPᦔWḄo*Éô,ᐹ#¬ᵨ<*ᢈG8O¬ᵨ<*>n$R,Ôᨵ▲ᑴ。᝞,e8SᵨAÖᮣ, [ᐰᵫÑᑴZ=ḄF,·e8ᙠ*+ᓄîoSឋonᡠᨵḄ。a!1.ᙠïôÒËFo=AÖᮣ(Aᐗ),,stᔜ*FG᝱IAÖᮣFᦔWḄ/0。2.8»RḄCPartideSyStem5wẠ,(To=2ᵨḄjk5。3.᪷£9Ñ8^(^£〖&^,Ro=UᦔWḄÑ,ᐸÒAe8ᵨ+ᑡ⊤(D3DPT_LINELIST)ᐗ5`⊤9。 Î11U)ÛØÜ×᪀⌼ᙠû☢ÚᑮḄᡠᨵ9Ñ,-¦µ9o=ᓫḄᱥ#;ᯠ ᙠab:#Ò,23◤⌕᪀⌼cᩖḄ}C。ᙠÒ,ᙢᜩQᨬḄᡂ%ᑖ。»✌ᐜXz{᝞☢Ḅᑁ4:oQ᪀⌼⊤9ᙢḄyzU`;BQ;Ì,TᙢḄÑᦪ£,᪷£Ñᦪ£ÚᦋᙢyzU`ÒᔜAḄ(7ᙶ᪗ò),8Uᙢ®ÆSáḄÆé;}QwᙢyzU`(ᔠ〉Ḅ7⁐。☢✌ᐜᑖ᪆᝞<᪀⌼ᙢyzU`,,wᙢyzᢣ}[ᳮᙶ᪗8Kᵨ[ᳮ。1ᩭ8ᙢUw,ᑖ᪆᝞¯ᙢTÈZ=⚔AḄß。TᐸIKḄ,UÈᙢ®ÆSáḄᦔW。1.ᙢyzḄrᐵL᪀⌼ᙢyz,ᐵÏQTZ=⚔AḄßᙶ᪗[ᳮᙶ᪗,ᯠxw᪀ᡂᙢyzḄ}☢Ḅ⚔Aᢣ}@A,^e82v@A¿ᑴ⊤9ᙢyzḄ}ᑡ⊤。w¯J᪀⌼ᙢyz,ᙠ07^1^^1}©8rᐵL。floatm_XRange;//ᙢnyᔣ²(/0>floatm_ZRange;//ᙢ22ᔣ²(o0)floatm_CellWidth;//ᓫ=yzḄOintm_numVertsPerRow;//Z$⚔Aᦪ6intmnumVertsPerCol;^M•//Zᑡ⚔AᦪðintmnumCellsPerRow;m^■//Z$ᓫᐗzᦪintm__numCellsPerCol;//ZᑡᓫᐗzᦪintmnumVertices;^m,//⚔Aᦪ 158oooÎ11Uintm_numTriangles;//}ᦪᙢyzrᐵLḄᐹ#õ©q11.1。Z_XRange6.p!MllW3MuCIrtEsl6x11.1öᑣᙢyzḄ᪀⌼9U▭w᪀⌼ᙢyz,☢ÈḄᨵLSQ◤Ḅ,Vw8Ðe82vᐸ¦LT´ᑮ。᝞11.1ᡠ9,Z$⚔Aᦪµᯠ¶JZ$ᓫᐗzᦪ¹1,Zᑡ⚔Aᦪ¶JZᑡᓫᐗzᦪ¹1,Bp:m^―numVertsPerRow=m^―numCellsPerRow+1;•m«"numVert8PerCol=m^BnumCellsPerCol+1;,ᙢyz⚔AḄᦪw:m_numVertices=numVertsPerRow*m_numVertsPerCol:ᙢyz}☢Ḅᦪw:m_numTriangles=m_numCellsPerRow*m_numCellsPerCol*2|ᙢ9>ᔣ(O)Ã>ᔣ(«)ᑖw:m_XRange=m_numCellsPerRow*m_CellWidthjm_ZRange=m_numCellsPerCol*m_CellWidthjW]:ᯠᨵ{5%◤Ḅ,|n pà÷,ᙠ0^0^ᓃ=Êv{ᐰ¹z äJ,᪵:9ṹÕb*ᨎ、Õ᧕ᳮ。2.⚔@ᦪ¸B•ᙢyz⚔A◤⌕ᒹõßᙶ᪗、[ᳮᙶ᪗+}%ᑖᦪ£。w>¯&?ᙢyz⚔Aᦪ£,}©8⚔A$᪀。StructTERRAINVERTEX{floatx,y,z;floatnx,ny,nz;floattutv: )ÛØÜ×᪀⌼ooo159wTßᙶ᪗,✌ᐜwᙢyzU``᝞11.1ᡠ9Ḅᙢᙶ᪗j。SÕ(ßJó1$ó]ᑡḄ⚔Aw9,,Ꮇ(ᙢyz$@Aᑡ@A^0:+,ᑣ9Ḅᙶ᪗᝞^V.x=j*m_CellWidth,V.z=i*m_CellWidth|V.y=GetHeight(posX,posY);ᐸÒ,060^78ᓃ()Q)}©Ḅᦪ,ᵨJ᪷£⚔AḄßT⚔AḄ,ᐹ#RXᙠx☢CD。᝞WXᙶ᪗jḄlAÎᑮᙢyzḄÒ,ᑣ⚔A9Ḅᙶ᪗᝞ᡠ9。CellWidth-XRange/2CellWidth-ZRange/2⚔A9Ḅ[ᳮᙶ᪗e᝞T。V.tu=j/m_numVertsPerCol;V.tv=1.0f-i/m_numVertsPerRow,᪷£☢ÈḄT>,2vᔊᡠᨵ$ᑡ,¯e8TÈᡠᨵ⚔AḄßᙶ᪗[ᳮᙶ᪗。⚔A+ḄTXᙠx☢CD。3.}@AT᝞11.1ᡠ9,(ᙢyzÒḄ⚔AQ⌲$&?Ḅ,ᓽ✌ᐜ^·ᔣ~⌲=&?ᨬ☢o$⚔A,ᯠx&?o$⚔A。ᑣßJó1$ó』ᑡḄ⚔AḄ@Ae᝞T。i*m_numVertsPerRow+j᝞11.2ᡠ9,(ᓫᐗz800ßJ÷Uß(ó0$ó^ᑡ),◤⌕üUḄQ,ᙠûᡠÛḄó①$Qᢣó^^^ᓫᐗz,SQó^$⚔A,ónᑡQᢣónᑡᓫᐗz。ᑣ⚔AßJó01$ó《ᑡ⚔A,BßJóm+l$ónᑡ⚔A,0ßJó1$ó!^1ᑡ⚔A,DßJóm+l$ón+lᑡ⚔A。ᡠ8、B、C、ôḄ@Aᑖw:m*m_numVertsPerRow+n(m+l)*m_numVertsPerRow+nm*m_numVertsPerRow+n+l(m+l)*m_numVertsPerRow+n+lᓫᐗz8ᓚ0e8ᵫù80ù080᪀ᡂ。᪷£ᓫᐗz800⚔AḄ@A,e8´ᑮßJóm$ónᑡᓫᐗzḄ5=}☢ᱏḄ⚔A@A,ᔊᡠᨵᓫᐗz,e8´ᑮᡠᨵ}Ḅ⚔A@A。9:·a:82:⚔@Ḅ¤Mn¤D┐,xᢣäḄ:82n£☢,ar𶣷[]ᙢ2·5i>。11.24ᐗz⚔Aᙠ07^0^^5Ò,X_`ᙢyzḄᡠᨵ"ṹÊᑮᨵᦪ0^16^ᑴ)Ò。Kᦪ✌ᐜ_`⊤9ᙢyzḄ1030᱄p61ôI^,ᯠxᑖT,(ᙢyzḄ⚔Aᦪ£@Aᦪ£,ᨬxᵨ030^?86>100¿180ᦪwᙢyzT+1ê。ᐹ#R"ṹ᝞。HRESULTCTerrains:CreateMesh(LPDIRECT3DDEVICE9pDevice) 160oooÎ11U//_`yzV_RETURN(D3DXCreateMeshFVF(ro_numTriangles,m_numVertices,D3DXMESH_32BIT|D3DXMESH_MANAGED,D3DFVF_TERRAIN,pDevice,&m_pMesh));//iᐙ⚔A?TERRAINVERTEX*V=0;V_RETURN(m_pMesh->LockVertexBuffer(0,(void**)&v));for(DWORDi=0;i}m_pMesh->UnlockVertexBuffer();//iᐙ@A>?DWORD*indices=0;V_RETURN(m_pMesh->LockIndexBuffer(0,(void**)&indices));DWORDbaseIndex=0;for(DWORDm=0;m•>m_pMesh->UnlockIndexBuffer();//wyz⚔AT+V_RETURN(D3DXComputeNormals(m_pMesh,NULL))returnSOK;} )ÛØÜ×᪀⌼ooo1619:w_`ᙢyØ,◤⌕:!ᜧḄ⚔A>?@A>?,ᵫJhḄ▲ᑴ,JeØB⌼ᡂE⚪。᝞,07(^30(ᜓ-⚜(ᨬᜧᐗᦪᨬᜧ⚔A@Aò,e82vbÅD3DCAPS9$᪀ḄMaxP^imitiveCountMaxVertexIndexᡂᕒ´ᑮìûh¿ᢝḄᨬᜧᐗᦪᨬᜧ⚔A@Aò。11.1.2÷Ñᦪ£ᙢ☢UḄo=@⌕ᑁ4Q;ÌÑᦪ£,Ñᦪ£238ᦻḄb&?。ᵨᦻ&?ᙢÑᦪ£Qo*3qḄ>。ᨵi*eØḄ⊤9b,ᐸÒᨬ3qḄᨵ5*。óo*QZ=²¦ᒹõLòḄ|l(e8Q60^、jpg、1ᢓ¶ᦻzb);óB*Qᮞ,J*23&?w.ß^zbḄᦻ,J*ᦻ⌲=Ü⁚ᙢ&?ᮞò。w´ᑮᙢḄÑᦪ£,✌ᐜ◤⌕/Ìᦻ,XÒ&?ḄÑᦪ£/ÌᑮrKḄᑁ?Ò,8>¯᪀⌼ᙢyzîᵨ。ᵨóB*;ÌÑᦪ£,óo*⌕cᩖo,AQN ⍝ḄBCXy。☢@ACD᝞<ᵨóo*;ÌᙢḄÑò。óo*Qo*BCᦻ,ÒZ=²ḄßIKJ▭ᙢḄo=ß。Z=²Ḅò"⊤IKßḄÑᦪ£:gLḄ²,IKßḄg。VwJ*ḄᦻzbeØᨵi*,◤⌕┐ISḄzb/Ìᦻᑁ4。ᯠ ,◀@?ᦻå᜜,z1/ÌᦻSQo½¾Ḅ_ê。wᓄÑÃÄ,e✌ᐜᑭᵨ0309Ḅ03100^×80^^^00^1ᔢ1()ᦪ,᪷£ᦻ_`rKḄ07830[ᳮI^,ᯠx^[ᳮI^Ò/ÌZ=²。J᪵/ÌSzbᦻḄcᩖÃÄ▭ᵫ0309&^ᓄ-7^0»^0^11ᔢᦪ"Í,^e8SᵨᐵᦻḄᐹ#zb。(^⛭᝞5X/ÌᦻḄvÄÊᑮᨵᡂᕒᦪX6&(»^1^@?[000^1£)Ò,KᦪḄR"ṹ᝞。//_`[ᳮLPDIRECT3DTEXTURE9pTexHeight=NULL;V_RETURN(D3DXCreateTextureFromFileEx(m_pDevice,fileName,D3DX^MDEFAULT,•D3DX^―DEFAULT,•D3DX^»FROMmmm^FILE,,0,D3DFMT^mX8R8G8B8,,D3DPOOL—MANAGED,D3DXDEFAULT,w^~wD3DX—DEFAULT,0,NULL,NULL,,&pTexHeight));//;ÌḄOD3DSURFACE_DESCddsd;pTexHeight->GetLevelDesc(0,&ddsd);m_HeightMapWidth=ddsd.Width;ro_heightMapHeight=ddsd.Height;//w&?ᦪ£ᑖᑁ?m_pHeightData-newfloat[m—HeightMapWidth*m_heightMapHeight];if(m_pHeightData==NULL)returnfalse;///Ìᦪ£D3DLOCKED_RECTd3drc;pTexHeight->LockRect(0,&d3drc,NULL,D3DLOCK_READONLY);for(DWORDrow=0;row>pTexHeight->UnlockRect(0)?SAFE_RELEASE(pTexHeight);ᙠ☢Ḅ"ṹÒ,ᨵZA◤⌕Û。―Qwᑴ_`Ḅ[ᳮḄ²zb,Ôᨵᵨᙠû☢3ᵨḄ0309(^^-TextureFromFile()ᦪ,Qᵨ03090^316×6È"?[01^716£()ᦪ_`[ᳮ。[ᳮḄzbᢣ}w030?198X80888,8>¯[ᳮ²Ḅ/Ì,,X[ᳮḄn¸ᦪ(w0309_?&€^^?|£,⊤9¦nᡂᐹᨵo=Ḅ[ᳮ,,[ᳮḄXy¶JᦻḄXy。BQᙠ_`[ᳮåx,;Ì[ᳮḄO(Z$²ᦪ)($ᦪ),ᓽḄO,,&?ᑮᙠCTerrain5Ò}©Ḅm_HeightMapWidthm_heightMapHeightᡂᕒLÒ,ᙠx☢T⚔Aî,⌕ᵨᑮḄO。}Qᙠ&?ÒḄᦪ£î,◤⌕A᎔ᔜ$Ḅ<,Vw[ᳮ²$Q^ᔣ᣸ᑡḄ,᪀⌼ḄᙢyzQ^ᔣ᣸ᑡḄ。ᓽóo$&?ᑮᨬxo$,óB$&?ᑮ᎔ᦪóB$,8û5。ᡠ8ᙠTZ=²ᙠÑᦪ£ᦪÒḄ@Aî,ᵨ8"ṹ。DWORDindex=(m_heightMapHeight-row-l)*m_HeightMapWidth+col;ZQÑᦪ£ᦪ1k#&0}©w0(^5`。Ò&?Ḅᦪ£23w0〜255åÿḄᦪò,JS8g◤⌕。ᡠ8ᵨ110»5&?ᦪ£,8¯JIᦪ£n$þÃ。11.1.3ᙢ÷UAḄTᙠ᪀⌼ᙢyzî,◤⌕wZ=⚔Aᢣ}ò。᝞WᙢyzḄ⚔AḄ²ooIK,Ö;Ìᙢyz⚔AḄQÛᓫḄ。᪷£⚔AḄ$@Aᑡ@A,TÑᦪ£ᦪḄIK@A,ᯠx/Ìᦪ£ᓽe。PQJ*>Bᙢyz¨ᙢ὚ᔠᙠo®,S¯Jn$᡽/, wnᡂo}ÖḄÛᜧḄᙢ,◤⌕ᵨÛᜧḄᦻ,^◤⌕ᵨfiḄᑁ?&?ᦪ£。û᜜wRᙠᙢ“$”,R◤⌕⍝ᙢ÷UoAḄò。▭,wᙢyzZ=⚔ATò,QTᙢ÷oAòḄᱯPêæ。ᙠ0^Â3ᓄ5Ò}©o=ᨵᦪ0^}16§ᓄ(),Kᦪ᪷£^Ò/ÌḄÑᦪ£÷oAḄß,T;KAḄÑò。᝞11.3ᡠ9,(ᔆwᙢᓃ÷UoA,A^ᕜZ=²4、z2、z3.24ḄÑᦪ£ᑖw>^、y2、h、y4。T^ḄòḄo*>QÌ>^、h、h、%Ḅáᙳò,fÖoḄ>Q,I、A、h、Ôn$+ឋò,GetHeight(mS,¬ᵨḄ。᝞11.3ᡠ9,(ᙢᓫᐗzḄOw《,²21ᙠᙢḄIKA^åÿḄ.ãw77, )ÛØÜs᪀⌼ooo1632v+ឋòe´^^AḄÑᦪ£ᑖ᝞:yP=yi+Cy2-yi)v^yP2=^+Cy3^4)^?/a,(þ,^åÿḄ.ãw?,2vI^〜AḄÑᦪ£n$+ឋò,e᝞TA^ḄÑᦪ£:yP=yP+iyP2-yP)yo,wn$òT,◤⌕᪷£A^Ḅᙶ᪗²^ᙠᙢIKAḄᙶ᪗,TÈ^?=3ò。0^0^7§ᓄ0ᦪ✌ᐜ}÷ᢣ}ßrIKḄᕜZ=.11.3÷UAÑòḄT²Ḅ@A,xDÈᕜZ=²⊤9Ḅò,,T²^ᙠᙢIKAḄᙶ᪗,ᯠxIJZ=òn$ò。n$FòTḄ᪶"ṹ᝞,KᦪḄ[᦮Rd⁚èÅÚV"ṹ。//T·²(21>ᙠᙢIKßḄᙶ᪗floatwidthDelta=mXRange/(m_HeightMapWidth-l);floatheightDelta=m_ZRange/(mheightMapHeight-l);floatLBX=colLB*widthDelta-m_XRange/2;floatLBZ=rowLB*heightDelta-m__ZRange/2;//IᕜZ=²Ḅòn$+ឋò.floatzScale-(z-LBZ)/m_CellWidth;floatxScale=(x-LBX)/m_CellWidth;floatpl=temp[0]+(temp【2]-temp[0】)*zScale;floatp2=temp[l]+(temp[3]-temp[1])*zScale;floatp=pl+(p2-pl)*xScale;returnp*m_heightScale;ᙠ☢Ḅ"ṹÒ,000^^^ᓃ8Q·²Ḅᑡ@A$@A,temp〖0]、temp[.],1611^[2]【01Í[1]IKñ☢ᑮḄḄ>^、y2、y3、}4。_[^81^0316Q€^0^45Ḅo=ᡂᕒLᨠ,ᵨJIT´ᑮḄòn$þÃ。"#:vᵨ¨BßᯠFᩖ,|¨Ëᙢ2·5<ßᦪᣮ/uᑖ$。4x,ᓽᙢ2ßᦪ¸5ᵨß01a[,?⌕061«^81^0Àᦪ" 5{,᦮ᙢ2iØḄ9ṹÒ:aᢝ5{。06,688^0ÀᦪᐙA ᙢ2i><ßᦪ¸#1Ḅ" 。ᱯ,ᙠᙢᳮº»~Ḅvᜩ,4¯ᙢ2ßᦪ¸ᦻh56ee᪵。vᵨ¨,:ᙢ2iØ9ṹð¶〉b5wḄßᦪ¸ᦻh。11.1.4$%Ḅ&'w8¹ᐝ᯿ᦔW,◤⌕wᙢyzḄZ=⚔Aᢣ}+。IJyzU`ᨵ5*+:ᓽ☢+⚔A+,ᐸÒ⚔A+ḄT⌕ᵨᑮ☢+。•1.☢$%☢+ᓽ}☢ᱏḄ+,☢+ḄTSQcᩖ。✌ᐜ;Ì}☢ᐳÌo=⚔AḄ5ᩩ¼,ᯠx}©5=íℏ(Vl*v2),8ÐḄlAᓽᐳÌ⚔A,>ᔣòḼᔜ)¼Ḅ>ᔣ。☢+(《f)Qo=ᓫßí,>ᔣ÷V1V2ý$WḄ>ᔣo,᝞11.4ᡠ9。2.⚔ $%IJo=}Ḅ☢ᩭÛ,¦ᨵoḄ☢+,PQo=}Ḅ⚔AᓾeØᨵ|=+, 164oooÎ11UZ=+-÷o=☢ᡈo☢rᐵὶ。ᯠ ,IJrIᐝ¸ḄyzᩭÛ,eIZ=÷û⚔Ar1TḄ☢Ḅ☢+n$áᙳ,´ᑮo=ᔠᳮḄoḄ⚔A+。e8ᵨZ=☢ᙠ⚔AᜐḄᜳ $¹ᩗ,8■ÑvÞᡈvJᑖᙽᓄḄ☢onvî。Ꮇ({~,n2,…,nJQ1T⚔AvḄᔜ}☢Ḅ+,{〜a2,…,~}Qó1ᑮó《=}☢åÿḄᜳ,᝞11.5ᡠ9。⚔AvᜐḄ+nveᵫbT´È。᪷£☢Ḅᑖ᪆e8ÚÈ,⚔A+ḄT☢+ḄT⌕cᩖ´i。òḄQ,e8ᵨ0309Ḅ030᱄0^^ᕸឱ0^180ᦪ,>¯ᙢwZ=yz⚔AT+。111.4:82☢¨ḄB111.5ᵨ☢¨B⚔@¨11.1.5ᙢU9Ñ☢2v9Ñ1^7§ᓄ^?1^8&,^9}CᙢUḄᐹ#R。K9Ñᵨû☢CDḄ^^^^5Ḅ⊤9ᙢ。0^—5ᵨ10309^3?11ô⊤9ᙢyz,^e8ᐙᑖᑭᵨ07"830ḄrᐵᦪᓄÑÃÄ。ᙠ0^0^ᓄ5Ò,◀☢ÈḄ÷ᙢyzrᐵḄLå᜜,R}©8ᖾ〖30(ᜓI^、ᙢyz、ᙢ[ᳮ¶L。ᙠ01⛭᝞5Ò,◀᪀⌼ᦪ᪆᪀ᦪ,8O☢ᑮḄ}=ᨵᦪå᜜,R}©8}=;ᨵᦪ。HRESULTCreate(LPDIRECT3DDEVICE9pDevice)voidRender(LPDIRECT3DDEVICE9pDevice);voidDeatroy();ᐸÒ:᪀⌼ᦪ᪷£¸ᦪᢣ}ḄᙢO、«、ᓫᐗzO,*+ᓄrᐵᡂᕒL,᪆᪀ᦪ_`³Ã&?Ñᦪ£Ḅᦪ,0^ò6()ᦪ&ᵨrKḄᨵᡂᕒᦪ,/Ìᦪ£、_`ᙢyz[ᳮ,X6'6^)ᦪ_`Fᙢyz:06P07()ᦪ_`³Ãᙢyz[ᳮI^。9Ñ11≆1^^?1^᝞01⛭᝞5Ḅᐸ¦ᐹ#Rd⁚,èÅÚV"ṹ。KÑᵨḄ_`Ḅᙢ᝞11.6ᡠ9。111.6ß015/bḄᙢ2i> )ÛØÜ×᪀⌼00016511.2ᜩÆUᑴᜩQT᜜ᕆḄ@⌕ᡂ%ᑖ,ᙠkḄ}CefᓄjkÒ,IJᜩḄhi,Ñᕒii^îᓫḄÈ#,¬ᵨ3ᓄḄᜩU`。pû3ᵨḄᜩUᓄ>ᒹ8}*。•ᜩ•ᜩ}•ᳫᜩ‘☢ᑖCDJ}*ᓄḄᜩU>Ḅᐹ#RÚA。11.2.1ᜩᜩQᨬᓫḄo*UᜩḄ>,ᵨo=ᚖzJᙢ☢ᡈ÷ᙢ☢ᕈo}Ḅ⊤9ᜩú。XᜩúḄ7⁐(w1 ᜩḄ@¬⁐,ᡈᙠcLAB[ᳮ。w´ᑮÎ᝱ᦔW,Re8ᦋLᜩúḄ[ᳮᙶ᪗,AB[ᳮᙠÎ。☢$ᔠ9ÑReCtSky,CDᜩḄᐹ#R。ᙠReCtSky9ÑÒ,XᜩḄRd⁚ÊᑮCRectSky5Ò,K5Ḅ}©᝞。classCRectSky?floatm_Width;//Ofloatm_Height;//floatm_Distancej//.ã&ᙶ᪗j90¥☢Ḅ.ã,ᓽ⚔AḄᑍᙶ᪗public:CRectSky(floatwidth,floatheight,floatdistance);HRESULTcreate(LPDIRECT3DDEVICE9pDevice,LPWSTRstrTexture);voidRender(LPDIRECT3DDEVICE9pDevice,floatfElapsedTime);voidDestroy();>;K5Ḅ}©Ûᓫ,ᔜᡂᕒLḄõ©2vü³Sãᳮ。᪀⌼ᦪ᪷£¸ᦪ_`*+ᓄrᐵᡂᕒL,&⑷ᦪ_`_`⊤9Ḅ⚔A>?☢Ḅ[ᳮ,0Û《^()ᦪ_`³Ãᙠ0^&0ᦪÒ_`Ḅ⚔A>?[ᳮI^,X61^6『()ᦪ✌ᐜ᪷£5åÿḄîÿÿ◞ÚᦋZ=⚔AḄ[ᳮᙶ᪗,ᯠx(rᐵFG᝱,F,ᐸÒÚᦋ[ᳮᙶ᪗Ḅ"ṹ᝞。RECTSKYVERTEX*pVertices;m_pVB->Lock(0,0,(void**)&pVertices,0);for(inti=0;i<4;i++)pVertices[i].tu+=0.15f*fElapsedTime;m_pVB->Unlock();9ÑRectSkyᙠ9ÑHeightMapTerrainẠ,8¹o=ᜩI^,$ᦔW᝞11.7ᡠ9。 166oooÎ11U111.72ᜩÆ•ᜩḄÚAQRᓫ,ᦔWÛ。PQ,᝞WÑᙠ$vÑÒ◤⌕ᦋLfḄ),᝞Cᜮe8%Ḅᜩ,J*>B☄ÈẚF。=᜜,◤⌕Se┝},Úᦋ⚔A>?,ᡠ8BI$ᦔ᳛⌼ᡂo}Ḅ/0。ᙠᱯ}Ḅêæ,ᓽf³}SLḄêæ,ᜩQo*S┯Ḅ⌱à。11.2.2ᜩ}ᜩ}>ᵨo=>}⊤9ᜩ,23¦◤⌕ᵨ>}ḄZᕜ⚔%=☢,,ᙠ=0☢c©.rKḄ[ᳮc。ᡠ8ᜩ}>,e8ᙠo}Ñ.ᜩḄE⚪。J*>Ḅo=ᐵÏE⚪Q,©[ᳮc⌕ØTrβ1ᙠo®。w´ᑮÎ᝱ᦔW,e8¹våÃÎᜩ}。☢$ᔠ9ÑB0xSky,CDᜩ}>Ḅᐹ#R。ᙠK9ÑÒ,Xᵨᜩ}UᜩḄrᐵvÄ,Êᑮ08(^545Ò,K5}©᝞。classCBoxSky{private:LPDIRECT3DVERTEXBUFFER9m_pVB;//⚔@Z[LPDIRECT3DTEXTURE9m_pTex[5];"ᜩÆã5☢Ḅᳮfloatm_L;//ᜩ}¼«public:CBoxSky(floatL);HRESULTCreate(LPDIRECT3DDEVICE9pDevice);voidRender(LPDIRECT3DDEVICE9pDevice);voidDestroy();}?ᜩ}>Ḅᐹ#Rᜩr,PrÛ ¡(9cᩖo。0[^A()Àᦪᑖwᜩ}Ḅ5=☢_`⚔A>?,,ᑖw5=☢_`[ᳮI^,0^^(^()ᦪ_`³Ã⚔A>?[ᳮI^。^。^⑴ᦪ2vᑖᑩFᜩ}Ḅ=☢,Rᜩ}ḄF,F"ṹ᝞。for(inti=0;i<5;i++) )ÛØÜ×᪀⌼ooo167pDevice->SetTexture(0,m_pTex[i】);pDevice->DrawPrimitive(D3DPT_TRIANCiLESTRIP);9ÑBoxSkyReCtSkyr,¦Qᵨᜩ}"/ᜩ,,Se¹våFᜩ},8UABÎᦔW。K9Ñ$ᦔW᝞11.8ᡠ9。11.8G}Û:wᓄÑḄR,9ÑBoxSkyᑖwᜩ}ḄZ=☢_`Z=⚔A,ᐳ20=⚔A。▭,ᜩ}¦◤⌕8=⚔Ae8。ᜩ}>I[ᳮᑴÄḄ⌕ÕÛ,ᔜ=☢Ḅ[ᳮåÿḄÊ1ᜐ◤⌕ØTា1®k^ᜩ}>Ḅ=᜜o=AQ,ìf☢I5=☢ḄÊ1ᜐî,ØTµÚᑮÊ1H,᝞11.8ᡠ9,᝞Ww8¹oᓄᦔW,ᑣe8ᙠo}Ñ#⊡KA。11.2.3ᳫᜩᳫᜩ23ᵨmᳫyzU`⊤9ᜩ,,ᙠmᳫyzco©AB[ᳮ,w´ᑮÎ᝱ᦔW,e8¹^åÃÎmᳫyzU`。ᳫᜩe8äᜩ}>ᙠ5=☢ḄÊ1ᜐᨵµHḄA。J*>ḄAQ,◤⌕ÛiḄ}☢⊤9mᙊḄᜩ,ᡠ8B½¹FḄ_ÿ。wFmᳫᜩI^,◤⌕Imᳫ☢n$ᒈᑖ,᝞11.9ᡠ9,ᯠxT(Z=⚔AḄßᙶ᪗÷[ᳮᙶ᪗。µᯠ,ᒈᑖᳫ☢,T⚔AḄß[ᳮᙶ᪗SQo4᧕Ḅ_ê,ᡠ823ᑭᵨ}C`UÃᐹ_ᐜᑴÄ⊤9ᜩḄmᳫ☢yzU`。9ÑD0meSky^9ᳫᜩḄR,K9Ñᑭᵨó9»RḄ09?ᓄ^5,Fᜩ•#yzU`。D0meSkyḄRÔᨵfi◤⌕³Ḅᙢ>,¦SvQᵨ0^ᓃ1^^115Fo=⊤9ᜩḄyzU`,,¹våèÃyzU`,8´ᑮÎ᝱ᦔW。9ÑD0meSkyḄ$ 168oooÎ11UᦔW᝞11.10ᡠ9。111.10ᳫ2ᜩÆ⁚CDḄ}*ᜩU>,Óᯠ-SQ$i,PQRᓫ,F_ÿrI·ÛÞ,Qpû3ᵨḄᜩU>。Sv,dḼT!ឋØ◤ÕḄSe,pû·ᨵ¡iẆñᵨf¹$iḄ>nᡂÎ᝱ḄAB,᝞JᱥᳮU`ḄABnᡂ、Jjk8OJJ¯ḄABnᡂ¶>。11.3ÛØ᤬3½.ÛØÜ×{2vû5⁚Ḅz{,ᡃÐ᪀`o=ᐹᨵᙢᜩḄ。⁚ᡃÐXz{᝞<ᙠÒn$a。11.3.1alᳮe8ὅᙠ}CÒaî,ÚᑮḄe8AwQ2vHI“'᤬”ᑮḄ,}C2ve8ὅHIᡂḄvÑ᤬!'᤬vÑ35D。ìe8ὅᙠ}CÒaî,B2vHIÚᑮSḄ,JrìJᦋL᤬!Ḅßï᝱'᤬ᑮSḄ。ᡠ8ᙠÒ,[ᐰe82v(o¾᤬!,2vᑴJ=᤬!ᩭRᙠÒḄa。2vᑴ᤬!Ra,▭Q2vSeᦋL᤬!Ḅrᐵ¸ᦪ,ᯠx᪷£J¸ᦪ᪀⌼e8▣ᢗ/▣ᩭ[ᡂe8Lᣚᢗ/Lᣚ。ᐸÒ⌕Qᑴ᤬!ḄßGᔣ,8´ᑮSḄe8▣,2vSḄe8Lᣚ,8RᙠÒḄa。ᙠó9»ÒᡃÐz{v,e8ᵨß}=>ᔣᔣ[ᐰ}ß}CÿÒḄo=ᱥ#。a▭ᑴ᤬!ᙠ}CÿÒḄß}=>ᔣᔣ,ᯠx᪷£᤬!Ḅß}=>ᔣᔣ᪀⌼e8▣^(᤬!Ḅßᔣw᜛、~ᔣwᔆ、ᔣw《、ûᔣw1ᑣe8▣^^᝞ᡠ9:’ )ÛØÜ×᪀⌼OOO169:᝞<᪷£᤬!Ḅß>ᔣᔣ᪀⌼e8▣,ÈḄ,ÆᐶLḄ/ὅe8Å▅rᐵtᧇ。=᜜◤⌕üUḄQ,᪷ᣮß>ᔣᔣ᪀NR8▣÷ó9»Ò᪀⌼&▣QᨵḄ。ᙠûᵨZ=ᔣóF᤬!,^e8I᤬!86*Lᣚ:•¹~ᔣ『èÃ(_¤,pitch)•¹ᔣ〃èÃ(âî’yaw)•¹ûᔣ^èÃ(?í,roll)•ò~ᔣ⁎Î(Pf,strafe)•¹ᔣℏ〃Î(ᓣh,fly)•¹ûᔣ@Î($’waIk)2vF6*Lᣚ,᤬!eòḼ3=åèÃÎ,ᓽ᤬!ᐹᨵ6=)ᵫ。Svᙠ)êæ,᝞ᙢ☢ÎḄᱥ#,¦ØòḼᱯ}Ḅ)ån$Î。11.3.2(^36□5w>¯ᑴ᤬!RᙠÒa,ᙠûÊ,Ro=᤬!5CCamera.☢*dᑖ᪆0^0^35Ḅ}©ᐹ#R。1.〇08□6「3ôḄ)*0^1^85Ḅ}©᝞:classCCamera{public:enumCAMERATYPE{LANDCAMERA,AIRCAMERA>?//᤬!5`Ppprivate:D3DXVECTOR3m_vPos;D3DXVECTOR3mvLook;^^,D3DXVECTOR3m_vUp;D3DXVECTOR3m_vRight;CAMERATYPEm_CameraType;public://(R8▣¸ᦪᡂᕒL&voidSetPos(D3DXVECTOR3vPos){m_vPos=vPos;>voidSetLookVec(D3DXVECTOR3vLook){m_vLook=vLook;>voidSetUpVec(D3DXVECTOR3vUp){m__vUp=vUp?>voidSetRightVec(D3DXVECTOR3vRight){m_vRight=vRight;//;Ìe8▣¸ᦪᡂᕒLðD3DXVECTOH3GetPos(){returnm_vPos?>D3DXVECTOR3GetLookVec(){returnm_vLook;>D3DXVECTOR3GetUpVec(){returnro_vUp;>D3DXVECTOR3GetRightVec<){returnm_vRight;//;Ì(᤬!5`voidSetCameraType(CAMERATYPEtype){m_CameraType=type;}CAMERATYPEGetCameraType(CAMERATYPEtype>{returnm_CameraType;>public:CCamera(CAMERATYPEcameraType); 170oooÎ11U//᤬?☢ᑖCD0^311^^5ḄᡂᕒL,8O᪀⌼ᦪ、ᑴ᤬!èÃÎ5ᦪ8O06^6¥^1^()ᦪḄᐹ#R。2.ᡂᕒL0^1«^&5Òoᐳ}©5=ᡂᕒL,ᐸÒ4=w᤬!Ḅß>ᔣᔣ,IᔜᡂᕒLRrKḄ(;ÌᡂᕒLòḄᦪ。ᡂᕒL_030^^>^⊤9᤬!Ḅ5ᛯ,e8QLANDCAMERAAIRCAMERAPp5`。ᐸÒ,1ᡷ^X⊤9ᐹᨵ6=)ᵫḄ᤬!,LANDCAMERA⊤9¦ØòḼᙢ☢ÎḄ᤬!,J*5`Ḅ᤬!I))ᵫn$▲ᑴ,ᐹ#d⁚ᙠx☢CDrᐵᑴ5ᦪîRB*d³^3.᪀⌼ᦪ᪀⌼ᦪ᪷£¸ᦪ(᤬!Ḅ5`,,w᤬!Ḅß>ᔣᔣ(ÒAò,ᐹ#"ṹ᝞。CCamera::CCamera(CAMERATYPEcameraType){m_vPos=D3DXVECTOR3(O.Of,0.0f,0.0f);m_vRight=D3DXVECTOR3(l.Of,0.0f,0.0f);m_vUp=D3DXVECTOR3(O.Of,1.0f,0.0f)?m_vLook=D3DXVECTOR3(O.Of,0.0f,1.0f);m_CameraType=cameraType;>4.ᑴ5ᦪw>¯ᙢᑴ᤬!8Ra,0^0^85┐I6=)ᵫrKḄᑴᦪ,8R᤬!¹}=>ᔣᔣḄèÃÎ。ᡂᕒᦪᓽ(^()、v3〜()X011()R᤬!ḄèÃᑴ。IJLANDCAMERA5`Ḅ᤬!,ᙠYawOᦪÒᐸ¹&S᪗jḄYån$èÃ,SQ¹ᐸᔣn$èÃ,,ἭÑ?í,ᓽἭѹᐸûᔣn$èÃ。J}=ᡂᕒᦪḄR"ṹ᝞。voidCCamera:sPitch(floatfAngle)//_¤{D3DXMATRIXA16matPitch?D3DXMatrixRotationAxis(&matPitch,&m_vRight,fAngle);D3DXVec3TransformCoord(&m_vLook,&m_vLook,&matPitch);D3DXVec3TransformCoord(&m_vUp,&m_vUp,&matPitch);>voidCCamera::Yaw(floatfAngle)//âî )ÛØÜ×᪀⌼ooo171D3DXMATRIXA16matYaw;if(m_CameraType==LANDCAMERA)D3DXMatrixRotationY(&matYaw,fAngle);if(m_CameraType==AIRCAMERA)D3DXMatrixRotationAxis(&matYaw,&m_vUp,fAngle);D3DXVec3TransformCoord(&m_vLook,&m_vLook,&matYaw);D3DXVec3TransformCoord(&mvRight,&m_vRight,&matYaw);>voidCCamera::Roll(floatfAngle)//?í{D3DXMATRIXA16matRoll;if(m_CameraType==AIRCAMERA){D3DXMatrixRotationAxis(&matRoll,&m_vLook,fAngle);D3DXVec3TransformCoord(firro_vUp,&m_vUp,&matRoll);D3DXVec3TransformCoord(&m_vRight,&m_vRight,&matRoll);>>ᡂᕒᦪ51^&()、[&()”3ᓄ()R᤬!ò}=>ᔣᔣḄÎ。ᐸÒIJLANDCAMERA5`Ḅ᤬!,Xᐸ$▲ᑴᙠ92á☢,PQIJTᚁîKKᦋL᤬!Ḅ,Jîe8ᵨ5^?05()ᦪ,w᤬!ᢣ}o=ᔠ〉Ḅ。J}=ᦪḄR"ṹ᝞S。voidCCamera::Strafe(floatfDistance){if(m_CameraType==LANDCAMERA)m_vPos+=(D3DXVECTOR3(m_vRight.x,0.Of,m_vRight.z)*fDistance);if(m_CameraType==AIRCAMERA)m_vPos+=(m_vRight*fDistance>;>voidCCamera:sFly(floatfDistance){if(m_CameraType==LANDCAMERA)m_vPos.y+=fDistance;if(m_CameraType==AIRCAMERA)m_vPos+=(m_vUp*fDistance);>voidCCamera::Walk(floatfDistance){if(m_CameraType==LANDCAMERA)m_vPos+=(D3DXVECTOR3(m_vLook.x,0.0f,m_vLook.z)*fDistanceif(m_CameraType==AIRCAMERA)m_vPos+=(m_vLook*fDistance); 172oooÎ11U5.661^^^31々()ᦪGetViewMatdx()ᦪ,᪷£᤬!Ḅß>ᔣᔣ᪀⌼e8▣,J·QᡃÐḄᨬÐpḄ。Kᦪ✌ᐜfHᔜ>ᔣᔣ,&ᔜ>ᔣᔣwᓫßᔣ,rÎᚖz,ᯠxwᔜ▣ᡂᕒL(rKḄò,ᐸ[᦮"ṹ᝞:voidCCamera::GetViewMatrix(D3DXMATRIXA16*pMatView){//fHᔜ>ᔣᔣ3D3DXVec3Normalize(&mvLook,&m_vLook);D3DXVec3Cro8S(&m_vUp,&m_vLook,&m_vRight);D3DXVec3Normalize(&m_vUp,&m_vUp);D3DXVec3Cross(&m_vRight,&m_vUp,&m_vLook);D3DXVec3Normalize(&m_vRight,&m_vRight);//᪷£rᐵ¸ᦪ᪀⌼e8▣pMatView->__11=ra_vRight.x;pMatView->__12=m_vUp.x;pMatView->__13=m_vLook.x;pMatView->__14=0.0f;pMatView->__21=m_vRight.y;pMatView->_22=m_vUp.y;pMatView->__23=m_vLook.y;pMatView->24=0.0f;pMatView->__31=m_vRight.z;pMatView->__32=m_vUp.z;pMatView->__33=m_vLook.z;pMatVxew->__34=0.0f?pMatView->__41=-D3DXVec3Dot(&m_vPospMatView->_42=-D3DXVec3Dot(&m_vPospMatView->__43=-D3DXVec3Dot(&m_vPospMatView->__44=1.0f;11.3.3}~ḄJK9Ñ9^ᕸ'6û0^Ûᑭᵨ☢RḄ《^^^5,ᙠo⁚9ÑDomeSkyḄẠ,RᓫḄa,2vZ=VᜮÏᑴ$>ᔣ、ûnx⌨。✌ᐜ_`<^^1^^5Ḅo=,,X᤬!Ḅ5`(wLANDCAMERA。g_pCamera=newCCamera(CCamera::LANDCAMERA);ᙠFZoåû,᪷£ᢥḄVᜮÏ,ᑴÎ>ᔣQᔲÎ,,᪷£ìûßḄ,rKᙢᦋL᤬!Ḅ,ᨬxT,(e8▣。9Ñ%᝞^1506î00^6XJvÄÊᑮW40(15v%〜^ᓄ1()ᦪÒ,ᐸ"ṹ᝞。voidUpdateAndSetViewMatrix(floatfElapsedTime) )ÛØÜ×᪀⌼OOO173//wxyᜮ:ᦋ{$zᔣif(g_bKey[VK_LEFT])g_pCamera->Yaw(-1.0f*fElapsedTime);if(g^bKey[VK_RIGHT])g_pCamera->Yaw(1.Of*fElapsedTime);//àyᜮ:$z`⌨if(g_bKey[VK_UP])gpCamera->Walk(10.Of*fElapsedTime);if(g_bKey[VK_DOWN])g_pCamera->Walk(-10.Of*fElapsedTime);//᪷¸A$L÷ß0,[÷ÛØ᤬3½Ḅß0D3DXVECTOR3pos;pos=g_pCamera->GetPos();floatheight=g_pTerrain->GetHeight(pos.x,pos.z);pos.y=height+2.0£;g_pCamera->SetPos(pos);//(ᐣe8▣D3DXMATRIXA16matView;g_pCamera->GetViewMatrix(&matView);g_pd3dDevice->SetTransform(D3DTS_VIEW,&matView);>ᐸ¦Rd⁚èÅÚV"ṹ,ᐸ$ᦔW᝞11.11ᡠ9。FPS:1539.45#yᜮ{:w;ᜮ:ᜮ:ïúᜮ:⌨11.11a11.4»✌ᐜCD᝞,8ORḄ᤬!5,-Ûᓫ,¦〉ᵨJ᪀⌼ᓫḄ。 174oooÎ11Ua!1.ᙠ»RḄ<^^^3ᓃᙢ5Ò8¹5=L,&?ᨬAᨬiAḄò。2•Úᦋ9ÑReCtSky,ᜩ☢ᙢ☢åÿḄÞJ90°,,îᦋL。、95=>ᔣḄ[ᳮᙶ᪗,e8FḄᦔW。3.ᵨo=⊤☢cᨵAB[ᳮḄ[᦮ḄᳫUᜩ,^e8¹÷UåèÃᜩᳫ。4.Úᦋa9Ñ,ᵨ《^^&5`Ḅ᤬!,,stᡠᨵᑴᦪḄᦔW。 Î12U^^3[ßḼ⁐èéᙠ07(^309Ò,ᨵ5*⌶ÇRF:o*Qᵨ³}ØOà+(fixedfunctionpipeline);=o*ᑣQᵨo»X⌕CDḄeÑOà+(programmablepipeline)。ᵨ³}ØOà+n$F,▭Q2vSetRenderState()>(SḄFG᝱,8Oᵨ561530^^Û&ᓄ()560^0^5138651316()>(÷[ᳮ¬᪵[ᳮgᔠrᐵḄG᝱,Ḅᜐᳮ¿ᑴᵫ8^^30Aw᪷£(Ḅᔜ*G᝱ᩭ[ᡂ。Óᯠ2vrKḄG᝱e8IFÛᮣRᙢn$ᑴ,PQ᦮=ᜐᳮOÑQ³}Ḅ,¦ØR³}ḄØ,J·ìQ³}ØOà+È7Ḅᵫᩭ。ᵨeÑOà+,Qᵨ)ÅᑏḄ⚔AḼ⁐ᘤ(VenexShader)²Ḽ⁐ᘤ(PixelShader),ᑖ"/³}ØOà+Ò⚔Aᜐᳮ²ᜐᳮḄᐰ%ᡈ%ᑖØ。V ,·8Y£)ÅḄ◤⌕RᱯᨵḄØ,J*ᢈGᜧᜧFḄᮣRឋ。ᑏḼ⁐ᘤ◤⌕rKḄÑ ¡。9:ᙠ#07^^308î,o*5Dù ¡ḄḼ⁐ᘤÑ ¡,WASM(AssemblyShaderModel).^07¿8309:+,Ro*5Dᓚ ¡ḄÈ^ᓃ(HighLevelShadelLanguage,ᓽḼ⁐ ¡)。»✌ᐜCD11131Ḅ ,@ACD÷。 ¡SḄᙢ>,8Oᵨ^^^ᓃᑏḼ⁐ᘤḄvÑ。o»X*dCD᝞<ᑏᵨ⚔AḼ⁐ᘤ÷²Ḽ⁐ᘤ。9:Ḽ⁐ᘤᙠGPU(GraphicsProcessingUnit,12ᜐᳮᓫᐗ)Ê᡻Ḅ,Ḽ⁐ᘤÒᡠ}ḄGPU。0?1µ$:;12⚞~Ḅ~,ᨬ᱐Ḅ08A(^3010*Direct3D11Cᣵäïð~,sᢝ:~。12.1ᦪ¸=>^!!^!^ÒḄᦪ£5`⌕ᨵ᪗Zᦪ£5`、ᔣ、▣cᩖᦪ£5`|ᜧ5。12.1.1᪗Zᦪ£5`151¿ᢝḄ᪗Zᦪ£5`q⊤12.1。⊤12.1^^31᪗Zᦪ£5`5`____________Ìò5m_______________Ìò__________boolTRUE^FALSEfloat32ß110òᦪòint32ß$7§û4᦮ᦪdouble64ß0<^ᦪòhalf16ßfloatᦪò 176000Î12U9:ᨵá'eØS¿ᢝ7P、halfdoubk5`,JîXᵨ^0»5`ᩭU。12.1.2ᔣ+HLSLÒḄᔣ5`Qo*ᱯPḄ$᪀,eᒹõ1〜4=ᐗ²。1.ᔣ⌾5`!!!^ᓃ8ᔣ5`。•vector—=40ᔣ,ᐸÒZ=ᐗ²-Q11(^5`。•vectoro=^Cᔣ,Z=ᐗ²ᙳw᪗Zᦪ£5`×。ᐸÒ”CJ1〜4åÿ。᝞960ᕸ<$0^,3>⊤9Z=ᐗ²ᙳwᡭ0315`Ḅ30ᔣ。•Tn÷9680[<1«>¶P,᝞ûû⊤9Z=ᐗ²w᝞⑶ᓃ5`Ḅᔣ。e8ᙠ¯ḄîIᔣn$*+ᓄ,᝞ᡠ9。intliVector~1;float3fVector={0.2f,0.3f,0.4f>;vectordVector={0.2,0.3,0.4,0.5>;2.ᔣᐗ²Ḅ?Ì•e82v5*XÈᔠᩭEᔣḄᐗ²。o*Qßᔠ,ᵨ^y、z、…n$cᙬ,=o*Q7⁐ᔠ,ᵨ1g、b、&n$cᙬ。float4pos=float4(0,0,2,1);IJᔣô(^,ô082ô05-]%ó3=ᐗ²Ḅò,ᓽ26ᙠoS?ÌvÑÒ,e8ᵨo=XÈᔠ;Ìo=ᡈi=ᐗ²,PXÈᔠSØgᔠᵨ,᝞ᡠ9。float4pos=float4{0,0,2,1);float2temp;temp=pos.xy//ᨵᦔtemp=pos.rg//ᨵᦔtemp=pos.xg//ᦔ3.ᔣᐗ²Ḅgᔠ?Ì/Ìo=ᡈi=ᢣ}Ḅᔣᐗ²,7wgᔠ?Ì(swizzling),·QÛ,ᙠ/ᑏᔣᨬḄî᎛îNOi=ᐗ²。᝞:float4pos=float4(0,0,2,1);float2f2D;f2D=pos.xy///Ì5=ᐗ²99f2D=pos.xz//e88÷UḄ[/Ìᐗ²f2D=pos.zx//ᐗ²e8⌮/Ìf2D=pos.xx//@c/Ì,ᐗ²e8ÌiS/Ìᙠn$ᑏvÄî,e8ᢣ}ᨵi´ᐗ²e8Ìᑏ,᝞ᡠ9。float4pos_float4(0,0,2,1);float4f4D;f4D=pos;///Awd40.᱄=pos.x;f4D.y=pos.y;f4D.z=pos.z;f4D.w=posf4D.xz=p0s.x2;///Aw£4.᱄=pos.x;f_4D.z=pos.zf4D.zx*=pos.xz;//tB^j^f4D.z=pos.x;f4D.x=pos.zf4D.X2yw=Ḅ8.^;//rìX£40ḄZ=ᐗ²-(w?03.^f4D.wzyx=pos;//+0^^pf4D.w=pos.x;f4D.z=pos.y;f4D.ypos.z;fD.x=pos ^31ß⁐èéooo177ᙠoSØòvÄÒ,p᪗ᔣḄo=ᐗ²SØÈR5S。f4D.xx=pos.xy;//Nᦔ4.ᔣḄᦪzHLSLÒḄᦪz᪗ZḄᦪzᨵᡠS。ìᙠ^11^ᓃ ¥ÒIᔣᡈ▣(▣XᙠoÞ⁚ÒCD)n$î,HLSLXIᐸÒḄᔣᡈ▣⌲ᐗ²n$ᦪz,᝞ᡠ9。//a,&-Q£10&L45`float4v=a*b;rìJ4S᪗ℏ。’ZSḄ$W-?;ᙠᔣ¥ḄIKᐗ²Ò,J*Ì7ÄZᐗ²ý。¦15ᓃᵨᐗ²ÄwᦪzḄᓫᐗ,J´ᑏḼ⁐ᘤL´f¹ᦔ。12.1.3▣▣Qo*8$ᑡXᦪ£(®ᩭḄᦪ£$᪀。Jᦪ£e8Q÷U᪗ℏᦪ£5`,P◤⌕üUḄQ,ᙠo▣ÒḄᡠᨵᐗ²Qo*ᦪ£5`。1.▣5`ᔣ5D,e82v8}*>}©o=▣。•matrix—=4><4▣,Z=ᐗ²ᙳwᡭ0&【5`。•matrixo=ᡠ><«▣,Z=ᐗ²ᙳw᪗Zᦪ£5`×,ᐸÒᡠ《CJ1〜4åÿ。᝞11^0^4021,3,3>⊤9Z=ᐗ²-w$(^Ḅ3x3▣。•Tmxn0^^<×,ᡠ,”>¶P,᝞40ûᓃ2><2⊤9Z=ᐗ²-w60'16Ḅ2><2▣。2.▣ᐗ²Ḅ?Ì▣Q8$ᑡXᦪ£(®ᩭḄ,e82vvĤ“.”ᩭ?ÌᐸÒḄᦪ£。ᐹ#Ḅ>ᨵ5*,᝞ᡠ9:0Z$ᑡß1Z$ᑡß.m00_m01_m02_m03_11_12_1314ml0_mll_ml2_ml3—21_22—23-24m20__m21_m22^_m233132_33_34.m30__m31_m32_m3341424344ᙠJ5*>Ò,Z=ᐗ²Ḅ᪗-Q8ᑜ+:+Ḅ,x☢ᨵ$ᑡ。Q0ZßÒ,$ᑡûRᨵo=Üõ0^☢Q/Ì▣ᐗ²Ḅ9"ṹ。float2x2fMatrix={1.0f,l.lf,2.0f,2.1f>;floatf_lD;f_lD=fMatrix.__mOO;///Ìó1$ó1ᑡᦪ£:1.0f_lD=fMatrix._22;///Ìó2$ó2ᑡᦪ£:2.1÷ᔣ5D,e8ᙠoSØòvÄÒE▣Ḅi=ᐗ²。float2x2fMatrix={1.0f,1.If,2.0f,2.If};float2temp;temp=fMatrix._m00_mll| 178000Î12Utemp=fMatrix._mll_mOO}temp=fMatrix._ll_22?temp=fMatrix._22_ll<3.▣ᐗ²Ḅgᔠ?Ìᔣ5D,I▣Òo=8Ḅᐗ²n$/ÌᡈØòvÄ7wgᔠ?Ì。ìiJo=ᐗ²ÌØòî,oS¦Øᵨo*?Ì>。float4x4worldMatrix=float4({0,0,0,0},{1,1,1,1},{2,2,2,2},{3,3,3,3});float4x4tempMatrix;tempMatrix._m00_rol1=worldMatrix._mOO_mll;//iᐗ²·òvÄtempMatrix.__m00_ml1=worldMatrix._ml3_m23;tempMatrix._ll_22_33*=worldMatrix._ll_22_33;//gᔠ?ÌîḄAÔᨵ⌕ÕtempMatrix._l1_22_33=worldMatrix._24_23_22;᪵,ᙠoS+òvÄÒ,5*>Segᔠᵨ,·SØᙠoSØòvÄÒIo=ᐗ²n$5S+ò。4.▣ᐗ²Ḅᦪ>b?Ì▣·e8ᵨ5DEᦪḄ>bIᐸn$E,JîḄZQ0,SQ1。Z=ᐗ²Ḅ@AßJo=>ᑁ。44▣e82v☢Ḅ@AEᐸÒḄZ=ᐗ²。[0][0],I0)[1],[0][2],[0][3][l][0],[l][l]rH][2],[l][3]l2J[0],[2][1],[2][2],[2][3][3][01,[3][1],[3][2],[3][3]᝞:float2>^2fMatnx={1.0f,1.floattemp;temp=fMatnx[0][0],temp=fMatnx[0][1],ᙠ▣Ḅᦪ?Ì>bÒ,SØᵨ$᪀#vĤ“.”。ìᵨᦪ?Ì>bî,·SØᵨgᔠ?Ì>/Ìo=8Ḅᐗ²。᝞,☢Ḅ ¥QNᦔḄ。float2temp;temp=fMatnx[0][0J_[0][l]PQ,ᦪ?Ì>be8ᵨᩭ?Ìiᐗ²Ḅᔣ,᝞ᡠ9。float2temp?float2x2fMatnx;temp=fMatnx[0]//=▣£-31^1ḄÎ#ᔣ᤬(60^)5.▣Ḅᦪzᙠ11131Ò,▣Ḅᦪz·Q⌲ᐗ²n$,᝞8"ṹ:float3x3matl,mat2;float3x3mat3=matl*mat2;ᐸ$W▣^3L3ÒḄò,Q▣matlmat2ÒḄᐗ²⌲=n$rýxḄò,SQ᪗ZḄ3><3▣rýḄ$W。·QÛ,《^L3Ḅóo=ᐗ²Ḅòw:mat3.m00=matl.m00*mat2.m00;———*9:᝞®◤⌕z᪗ãḄᔣ5▣#1ḄP¨AB,:ᵨ1«^[Ḅᑁ÷*ᦪ ^^ᓚßḼ⁐èéooo179mul,Kᦪe8[ᡂᔣý8ᔣ、ᔣý8▣、▣ý8ᔣ、▣ý8▣Ḅ。12.1.4cᩖᦪ£5`ÄwIᓫᦪ£5`Ḅ⊡ᐙ,?0^1¿ᢝcᩖḄᦪ£5`,᝞ᦪ、$᪀8O11151ᱯᨵḄ¬᪵ᘤ(sampler)、[ᳮ(texture)¶。1.ᦪ1^51ÒᦪḄ}©0 ¡5D,᝞:halfp[4]//ᐹᨵ4=ᐗ²ḄoCᦪ,Z=ᐗ²w^^1£5`floatm[4](4]//ᐹᨵ4$4ᑡḄBCᦪ,Z=ᐗ²w£10&5`vectorv[12]//ᐹᨵ12=ᐗ²ḄoCᦪ,Z=ᐗ²w96^0『5`Ḅᔣ62.$᪀ᙠ11151Ò,$᪀Ḅ}©>0 ¡r,᝞:structureVertexData{float3position;float4color;>e8ᵨvĤ“.”?Ì$᪀Ḅᡂᕒ,᝞:structureVertexDatadata={{0.0f,0.0f,0.0f,>,{0.3f,0.5f,0.2f,1.0f}data.position=float3(1.Of,2.0f,Of)data.position=(1.0f,2.Of,3.0f)float4tempColor=data.color;3.16。8"ᙠ11151^Ò,·e8ᵨ〖7?6᝞〖ᐵÏÜ}©)ÅḄᦪ£5`,᝞☢Ḅ"ṹ}©?0ᓃ1ᦪ£5`。typedefvectorpoint;᪷£☢Ḅ}©e8ÚÈ,?011^WQZ=ᐗ²w00᝞5`Ḅ}Cᔣ。4.®ᳮ[ᳮᵫ〖^È"5`⊤9,᝞☢Ḅ"ṹ¯o=[ᳮI^180。texturetexO;☢Ḅ"ṹeᑖw3%ᑖ:5`¯4᱄L^~$*^texO,LÈ7xḄü³。ü³QᵨᡝᦔW(ᦔWḄᭆùqó13»)ᵨḄ1ê,8ÐXÌHLSLᡠµᶍ。◀e8ᵨ^^^5`¯[ᳮå᜜,Re8ᵨfᐹ#、5`bÅf|zḄTexturelD、TexturelDArray、Texture2D、Texture2DArray、×6^6308O×6«^0^6<>ᙠÒᡃЦᵨBC[ᳮ,ᓽ×^0«^205`Ḅ[ᳮ,ᐸ¦5`Ḅ[ᳮ,è¸ὃrᐵtᧇ。᝞e8ᵨ8"ṹ¯o=BC[ᳮ。 180000Î12UTexture2Dtex0;5.¬᪵ᘤ¬᪵ᘤQᵨJI[ᳮn$¬ᵨḄI^,ᵫ8&0^1ó5`⊤9。¬᪵ᘤÒᒹõᨵ¬᪵G᝱,e82v¬᪵G᝱ᢣ}̬᪵Ḅ[ᳮ、ᑴ[ᳮ¬᪵Ḅva>bcᙬUb。◀e8ᵨ#ᡭ5`}©¬᪵ᘤå᜜,Re8ᵨfᐹ#、5`bxf|zḄ8311^1810、sampler2D,sampler3D&&samplerCUBE。ᙠÒ¦CD20[ᳮ¬᪵ᘤ,J·Qᨬ3ᵨḄ[ᳮ¬᪵ᘤ5`。e8ᙠ}©[ᳮ¬᪵ᘤḄî,*+ᓄᐸ[ᳮ᪵G᝱,᝞ᡠ9。texturetexO;sampler2Ds_2D=sampler_state{Texture=?ᙠ☢Ḅ"ṹÒ,ᵨL16⊤9o=[ᳮI^,ᵨ830^4005`ᐵÏÜ^0^1^_^3ᓄ¯o=¬᪵ᘤI^5_20。K¬᪵ᘤᙠᜧᑁᢣ}⌕¬᪵Ḅ[ᳮrᐵḄ¬᪵G᝱。9:᝞®ᙠᳮv᪵ᘤÊzᨵᢣäᳮv᪵f᝱,=ᵨ¥ZḄv᪵f᝱:ᳮ6nឋ;ᳮᙬi6nuᳮᙬ。ᵨ☢}©Ḅ[ᳮ¬᪵ᘤ5_20¬᪵o©20[ᳮḄ"ṹ᝞:float4sample_2D(float2tex:TEXCOORD):COLOR{returntex2D(s_2D,tex);>ᙠ☢Ḅ"ṹÒ,¬᪵ᢣ$tex2DᵨoIBCḄôA[ᳮᙶ᪗ÄwÒᐭ,,]%o=7⁐ᔣN。Û:ᙠà☢Ḅ9ṹÊ,L£᱄0300<0010v{z×ḄèJ(Semantic)。ᨵᐵèJḄ/ᐵᑁ,ᙠ`☢µr' 。¦1^[¿ᢝ4*¬᪵ᘤ5`:sampler_lD、sampler_2D、sampler_3D、sampler_CUBE。IKḄ[ᳮ¬᪵ᢣ$ᑖQ【610、tex2D,tex3D、texCUBE,☢Q3ô¬᪵Ḅ。texturetexO;sampler3Ds_3D=sample_state{texture=;};float3sample_3D(float3tex:TEXCOORDO):COLOR{returntex3D(s_3D,tex);>9:9à☢Ḅ :2À,ᳮ、.v᪵ᘤ5v᪵ᢣ/uvbḄ,ᐳwᵨwvᡂᳮm。ᙠUÒµ2ᑮ,Ï(᝞¹/uöᔠᐳwvᡂᳮv᪵ѳḄ。 ^^3ᓃßḼ⁐èéooo18112.1.5LḄûqᙠᵨᦪ£5`¯Lî,e82voûqILḄ)>☢n$ᑴ。ᐸÒᑡᐵÏÜe8ÄwLḄûq。•static᝞WᐰþLℏᙠ¯îᵨᐵÏÜ8vᓄ,UᕡḼJ=LᙠḼ⁐ᘤÑ᜜Seq,J=ᐰþLLᡂKḼ⁐ᘤḄþ%L。᝞Wo=᥅%Lᙠ¯îᵨstatic,ᑣKL÷0+ ¡ÒḄþ%Lℏᐹᨵ[ᐰrḄ$w。、•uniform᝞WL¯îᵨâᐵÏÜ7ᓄ^⊤KLeᙠḼ⁐ᘤÑå᜜n$E。᝞ᙠ0++"ṹÒILn$*+ᓄ,ᯠxÙÄwÒᐭḼ⁐ᘤ,,¦Øᙠ5SFåÿᦋLLḄò,V Iñᡠᨵ⚔A²,KLᐹᨵrḄò。•extern᝞ÔÓÀᵨÈᐵ"6^^1^⊤+ᙠḼ⁐ᘤ᜜úû,¢᝞ᵫ++¸ṹµᐸúû。ᨵᐰ+ØÀᵨᐵ"^ᓄ^,(ì*☟᝱ḄᐰᙠA᝱¼§6^Ḅ。•shared᝞WL¯îᵨᐵÏÜ51^«^1,ᑣ9ᦔW᪾¾,KLeᙠi=ᦔWåÿᐳÌ。¦ᨵᐰþLe8ᵨKᐵÏÜn$¯。•volatile᝞WL^¯îᵨᐵÏÜÍ7vᓄ,ᑣ9ᦔW᪾¾,KLNX3ÌÚᦋ。¦ᨵᐰþLe8ᵨKᐵÏÜn$¯。•constÈ^ᓃÒḄ⑶DᐵÏÜ÷ᙠᓚ ¡ÒḄõ©[ᐰr。pᓹ,᝞Wo=Lᙠ¯îᵨ001^ᐵÏÜ,KLQo=3,ᙠÑ$îSØÚᦋLḄò。9:6©16ᓺ¿7ᓄ0115`ḄLBÌÃᑮḼ⁐ᘤḄ3⊤Ò,ᙠ0++"ṹÒe82”3⊤EJL,ᙠo»XBÚᑮᐹ#Ḅ。12.2ABî<èï¤.}L3*᝞<(ᙠo®ᡂ⊤®b。⊤®bᵫ3、L、44ᡂ。 ¥.}⊤®bᵨᩭÕòḄ<。ᙠ1^^ᓃÒ,¤、⊤®b ¥Ḅᭆù÷0 ¡r。12.2.1¤j(151Ḅᔜ*¤q⊤12.2。*12.2HLSL+Ḅ¤_______________________5`___________________________________•¤___________________·ò¤=+='—%*%/—*oᐗ¤!、+(ì>、o(_>.iᐗ¤+(¹)、_(ï>、*、/、%ä¤&&、71、?Û¤<、>、==、<=、>=、!=ûqx,¤++、oᢗ]¤(5`Ãᣚ)(type>⌹¤♦$᪀ᡂû⌱à«ᦪᡂᕒ⌱à__________________m________________________________ 182000Î12U2v⊤12.2SãÚÈ,^0^1ÒḄ¤÷0 ¡ÒḄ¤QrḄ。)¤ᙠöᑣ0 ¡ᨵª,☢¦CDJᨵªḄᙢ>。1)ᙠ^1151Ò,ÌU¤(%)〉ᵨJ᦮`ôA`,,·vÄᦪ~vÄᦪ,᝞WvÄᦪwôAᦪ,$WÒḄÞᦪ%ᑖBÌ9e。2)ᙠ^11^ᓃÒ,¡ivĤQ┐IZ=ᐗ²n$Ḅ,JQVwᔣ▣-Q1^51Ḅᑁ5`, J5`-ᵫñᑖᡂ。JoA`ᙠᔣ▣ḄᦪzÒᑮv。3)䤷Q┐IZ=ᐗ²n$ÛḄ,⌕Û5=ᔣ,ÖZ=ᐗ²ḄÛ$WXᡂo=HḄᔣÄwÛ$W]%。12.2.25`Ãᣚᙠ⊤®bÒ,᝞W5=vÄᦪḄ5`S,B#n5`Ãᣚ(ᢗ]),11151ÒḄ5`Ãᣚ ᓚ ¡[ᐰr。û᜜,ᙠ{11^1^ÒBNO᪗5`ᔣ8O▣åÿḄÃᣚ,J*êæᙠ0 ¡ÒQS?ᙠḄ,ᡠ8☢Iûn$@Aᑖ᪆。ᙠ¦ᓃ51^Ò,ᨬýḄᢗ]#nᙠ^᪗ᑮᔣ,ᡈὅ^▣ᡈᔣᨬᑮ=o=ᓫᦪ£5`ḄÃᣚ。Jᢗ]>bQᵫᘤ)ÎᜐᳮḄ。ᢗ]ᑖw55,o5Qᓣᢗ],o5Qhᢗ]。1.ᓣᢗ]J*ᢗ]>b#nᙠìo=᪗Ãᓄwᔣᡈὅ▣Ḅî᎛。J=᪗BÌØòᑮᔣᡈὅ▣Ḅ"=ᐗ²。᝞:float4v;Jî,ᘤBn$ᓣᢗ],Xᔣ〃Ḅ4=ᐗ²-(w1。2.hᢗ]hᢗ]#nᙠo=Cᦪ£(᝞ᔣᡈ▣)Ì+òᑮo=iCᦪ£î,᝞:float4c;float3a,b;ᙠû,0ÌÃᓄw^0᝞35`,ᙠ5€rýî,Sᵨ〜ᐗ²,ᐸiìõ©᝞:a=b*float3(c.x,c.y,c.z);12.2.3 ¥÷<⊤®bx¹o=ᑖ“;”᪀ᡂoᩩ ¥。1. ¥ᙽ,8ᓃ81Ò ¥ᙽḄ 0 ¡[ᐰr,o= ¥ᙽQoᩩᡈiᩩ ¥,᝞☢Qo=ᒹõiᩩ ¥Ḅ ¥ᙽ。{statement1;statement2;statement3; ^^3[ßḼ⁐èéooo183ìo= ¥ᙽ¦ᨵoᩩ ¥Ḅî᎛,e8ḕᶍ。ᙠ ¥ᙽÒ¯ḄL,¦ØᙠK ¥ᙽÒÌ,·QÛ,ᙠK ¥ᙽÒ¯ḄL,ᙠK ¥ᙽå᜜QÔᨵU©Ḅ。2.OÑᑴ ¥OÑᑴ ¥.} ¥Ì᡻$Ḅ<。HLSL¿ᢝḄOÑᑴ ¥C ¡r,ᒹᵨJ⌱àᑴḄ7◉^^(± ¥,ᵨJ+úᑴḄ^、while,᝞..〜ᓃ4 ¥, ·e8Sbreak、(^᝞û8O⑴ᓺ¶ᐵÏÜ⌨È+ú。•12.3Àᦪᵨᦪe8XᜧᙽḄ÷zᑜᑖwÞᙽᩭ[ᡂ。ÞᙽÃÄf¹4᧕&t,,ØRᦪbᵨ。ᦪe8ᵨᩭ◚¢ᐸ¦ᦪḄd⁚,J´ᵫᦪᡂḄÑf4᧕ᳮ。12.3.1)}©ᦪ^^5ᓃᦪ÷(:ᦪ35D。8Ð-ᒹõo=ᦪ}©ᦪ#,-◤⌕ᨵ]%ò¸ᦪᑡ⊤。<:ᦪo᪵,ᙠḼ⁐ᘤ"ṹḄî᎛,·bÅ11151ᦪḄ¸ᦪ、¸ᦪ5`]%ò。ᦪᒹõ¯#5%ᑖ,¯ᙠᦪ#åû,᝞ᡠ9:float4VS(float4inPos:POSITION):POSITION{returnmul(inPos,WorldViewPro]);>ᦪ¯QᜧûḄᡠᨵᑁ4,ᦪḄ¯ᒹ:]%5`、ᦪÈ7、¸ᦪᑡ⊤(e⌱)、ÒÈ ©(e⌱)8Oü³(e⌱)。◀ᓚ ¡ᐹᨵ5DḄ ᜜,8ᓃ81ÒḄᦪRᐹᨵ8ឋW:•¸ᦪÙQᢥòn$⌴。•S¿ᢝ⌴ð。•ᦪÙQᑁὶḄ。12.3.2ᑁᦪ1«^1¡izᴊ,JᦪÌ7wᑁᦪ(imru^cfuncuon),Vw8ÐÌᐭ^1131 ¡Ò。ᑁ&ᦪn$Úᓄ,e8ᨬ±ឋØ。ᑁ%ᦪᨵ¡i,ᜧe8ᑖw845。•ijSḄᦪzᦪ,᝞:abs、clamp、clip、max,min、signt•jSḄᦪzᦪ,᝞:cross、determinant、lerp、log、noise、pow、sqrt;•}ᦪ,᝞:sin,cos,tan、atan、sinh,•¬᪵ᦪ,᝞:texlD、tex2D、tex3D,texCUBE。2vᦪÈSãᳮᦪḄØ。DirectXSDK(August2009)130i=È^[ᑁᦪ,56â+ḄvÄ,/ὅe8ᙠ30XÒ´ᑮ8ÐḄ[᦮ᑡ⊤OÛ。12.4èJ ©ᵨJᢣLḄᵨ⌶。^jḄeAÚ, © `Ḽ⁐ᘤÒḄL÷hd?ᘤåÿḄὶj。 ©23ᵨJÛḼ⁐ᘤḄÒᐭÒᐭ,o[ÈRᙠ8}*ß: 184000Î12U•Ḽ⁐ᘤᦪÒᐭÒÈ$᪀Ḅᡂᕒåx,ᢣ$᪀ᡂᕒḄᵨ⌶。•Ḽ⁐ᘤᦪḄ)=¸ᦪåx,ᢣ¸ᦪḄᵨ⌶。•Ḽ⁐ᘤᦪḄ¯åx,ᢣᦪ]%òḄᵨ⌶。Òᐭ ©ᵨJXᢣ}ḄÒᐭë1ᑮOà+Òûo▤fḄ)=ÒÈ。᝞,⚔AḼ⁐ᘤᵨḄ?081×10>1Òᐭ ©,ᢣ}ᩭ)⚔A>?Ḅᦪ£XÌ@1ᑮ<ᜐ。⚔AḼ⁐ᘤÒᐭ ©X^⚔A>?¹ḄZ=⚔AḄ1ê(᝞ß、+、[ᳮᙶ᪗、7⁐¶)óFw⚔AḼ⁐ᘤe8ᵨḄb。²Ḽ⁐ᘤÒᐭ ©óFᵫᐝ᪕ᓄᓫᐗḄZ=²Ḅ1ê。Ḅ²Ḽ⁐ᘤÒᐭ ©X⚔AḼ⁐ᘤÒÈḄ⚔A7⁐[ᳮᙶ᪗1ê@1ᑮ²Ḽ⁐ᘤḄÒᐭ。ÒÈ ©ᵨJᢣ}Ḽ⁐ᘤnᡂḄᦪ£᝞<ë1ᑮo=▤fḄÒᐭ。᝞,⚔AḼ⁐ᘤḄÒÈ ©ᵨJXᐝ᪕ᓄᘤÒòḄÒÈë1ᑮ²Ḽ⁐ᘤḄÒᐭ。9:᝞®Ḽ⁐ᘤḄHᐭzᨵᵨ/bḄèJᡈ8Aæ1ᐵÂz᪗,,ᡈὅHÀzᨵᵨ/bḄèJz᪗,,ᑣóḼ⁐ᘤ9ṹDµᜫ。ᐸÊᵨ8011ᐵÂ᪗,ḄHᐭᦪµÿᐭḼ⁐ᘤḄj⊤Ê,:3Ḽ⁐ᘤḄᐰ{᪵ᙠ0+9ṹÊzKLᓄ,ᯠ`⌴#Ḽ⁐ᘤmnHᐭ。3ᵨḄ⚔AḼ⁐ᘤ ©²Ḽ⁐ᘤ ©q⊤12.3⊤12.4。______________⊤12.33ᵨḄ⚔AḼ⁐ᘤ ©_______________Òᐭ ©____________Û_____________________________5`•4BLENDINDICES[n]gᔠ@AuintBLENDWEIGHT[n]gᔠᩗ@floatCOLOR(n]I]☢I]7⁐float4NORMALfn]+ᔣnfloat4POSITION[n]I^ÿÒḄ⚔Aßᕴfloat4POSITIONLᣚåxḄ⚔Aßfloat4PSIZE[n]AḄᜧÞfloatTEXCOORD[«][ᳮᙶ᪗_____________________________________float4ÒÈ ©Û5`COLOR[n]I]☢I]7⁐float4FOG⚔AofloatPOSITION[n]#SÿÒḄ⚔Aß。2vX(7,2)◀8〜,TefÿßN。float4Z=⚔Aὅ⁐ᘤÒÈo=ᐹᨵK ©Ḅ¸ᦪPSIZEAḄᜧÞfloatTEXCOORD[n][ᳮᙶ᪗fIoat4__________⊤12.43ᵨḄ²Ḽ⁐ᘤ ©_______________Òᐭ ©eÛ5`COLOR[n]I]☢I]7⁐float4TEXCOORD[n][ᙶ᪗______________________________________float4_____ÒÈ ©__________Û________________________________5`_____________COLOR[rt]ÒÈ7⁐float4DEPTH[n)ÒÈUfloatÛ:ᙠèJ`☢Ḅ”:⌱Ḅ᦮ᦪ,⊤][ᘤḄMÏ0?L,ᨬᜧ5ðåA$ HLSLßḼ⁐èéooo185ᵨḄḼ⁐ᘤ᱐ᡠᐕ¡Ḅò,᝞2.0᱐Ḅ⚔AḼ⁐ᘤ¿ᢝ16=⚔Aᐗ²d?ᘤ、ᨬ´256=3d?ᘤ。᝞/0ᶍ23,rìJ”w0,ᓽᓹ051×10>}?051×1(^[0Q¶PḄ。12.5ᑏ%3[Ḽ⁐ᘤᨵû☢|⁚ḄẠ,☢8ᑏo=ᓫḄ⚔AḼ⁐ᘤw,CDᑏHLSLḼ⁐ᘤḄvÑ。12.5.18¹ᦻe8ᙠ0+VᦻÒᵨܤᦪ&?Ḽ⁐ᘤ"ṹ,PJ᪵÷BÑ"ṹÛÄf,$᪀ឋS£,ᡠ823XḼ⁐ᘤ"ṹÃᙠᓫäḄᦻÒ。Ḽ⁐ᘤ"ṹe8&?ᙠ÷<ᦻᦻÒ,wÐᨎ®q,Ḽ⁐ᘤ"ṹᦻḄxq23Q-vsh、.pshS.fx。.^11⊤9⚔AḼ⁐ᘤ"ṹᦻ,.psh⊤9²Ḽ⁐ᘤ"ṹᦻ;.〖⊤9ᦔW"ṹᦻ。wᑏḼ⁐ᘤ"ṹ,✌ᐜᔣ⚗p8¹o=ᦻᦻ。ᐹ#pw,ᓫD【⚗p18¹H⚗】ìᓫ⚗,ᡭ(“8¹H⚗”I)᪾。ᙠ“Ur”ogÒ,⌱à“ᦻᦻ”⌱⚗,ᯠxᙠ“È7”ᦻ᪾ÒÒ⌕8¹ḄᦻḄÈ7,ᨬxᓫD【ᡭ:1ᢥ。·e8ᙠ÷<ᦻᦻÏÃᐹÒᑏḼ⁐ᘤ"ṹ,᝞µ_。Svw¯J⚗p¶ᳮ,`ÚRQᵨ95)$Ḅ"ṹÏᘤᑏḼ⁐ᘤ"ṹ。12.5.2ᑏḼ⁐ᘤ"ṹ☢8o»XBᵨᑮḄo=R⚔Aᙶ᪗LᣚḄᓫ⚔AḼ⁐ᘤw,CD᝞<ᑏḼ⁐ᘤÑ。KḼ⁐ᘤ"ṹ&?ᙠ11151#1^-ᓄ0^78&ᦻÒ,[᦮"ṹ᝞。//ᙶ᪗Lᣚ▣float4x4matWorldViewProj;//ÒÈ$᪀5`structVS_OUTPUT{float4Pos:POSITION;float4ColorsCOLOR;>;//⚔Ah⁐ᘤᐭôᦪ•VS_OUTPUTVS(float4Pos:POSITION,float4ColorsCOLOR){VS_OUTPUTOut=(VS_OUTPUT)0?Out.Pos=mul(Pos,matWorldViewProj);Out.Color=Color;returnOut;>☢Ḅ"ṹ✌ᐜ}©o=ᐰþL*,ᓽo=4><4Ḅ▣0^1〜0『1(1%〜?^<]。K▣ᵨJXᙢᙶ᪗jÒḄ⚔Aᙶ᪗,2v&Lᣚ、e8Lᣚᢗ/Lᣚ,LᣚwᨬÐḄefᙶ᪗。ᯠx}©o=$᪀95__(^71?。×。Vw⚔AḼ⁐ᘤ23ÒÈ⚔AḄᜧ%ᑖ1ê,ᡠ8o[◤⌕}©o=$᪀Äw⚔AḼ⁐ᘤḄÒÈ5`。▽5_€^×?171ᒹõ5=ᡂᕒ,ᡂᕒ?08ᵨ 1860〇0Î12U ©?051×10^n$Û,⊤9?05ᡂᕒᵨJ&?vᙶ᪗LᣚåxḄ⚔Aᙶ᪗,=o=ᡂᕒ00^ᵨ ©€0^3Xn$Û,⊤9ᓚ01(^ᡂᕒᵨJ&?⚔AḄ7⁐ò。ᓚÑo᪵,1^51Ñ·KKᨵo=ᐭôA,ᙠ☢Ḅi^ᓃ"ṹÒ,ᐭôᦪw9ᕂ。ᙠ⍳+ᦪXÈöᑣḄû,e8ᵨ÷<ᦪÈ7。Ḽ⁐ᘤᦪ95ᨵ5=¸ᦪ,Po0nColor,ᑖ⊤9ìû⚔Aᙠᙢᙶ᪗jÒḄß7⁐。ᙠ⚔AḼ⁐ᘤḄÒᐭ¸ᦪÒ,o}⌕X⚔AᒹõḄᡠᨵ1ê-ᒹõny,ᔲᑣÑᨵeØSØì3$,ᡈὅÈRUUSᑮḄ┯。᝞WRwI^Kᵨ[ᳮ,·QÛ,⚔A1êÒᒹõ[ᳮᙶ᪗1ê,ÖRKKX[ᳮᙶ᪗ÄwÒᐭ1ê8¹ᑮ⚔AḼ⁐ᘤḄÒᐭ¸ᦪÒ,¶IJ[ᳮḄrᐵvÄQ}J²Ḽ⁐ᘤḄ÷z。o[êæ,ᙠ⚔AḼ⁐ᘤÒ,⚔AßQSe´ḄÒᐭᦪ£。w"ṹf¹Üᨎ,ᨵîw⚔AḼ⁐ᘤᦪ}©o=Òᐭ$᪀#,XᡠᨵÒᐭ¸ᦪᒹõᑮo=Òᐭ$᪀#Ò,᝞。structVS_INPUT{float4vPos:POSITION;float3vNormal:NORMAL;float2vTexCoord:TEXCOORD;>ᙠ☢ḄḼ⁐ᘤ"ṹÒ,ᐭôᦪ95ḄRSQcᩖ,✌ᐜ}©$᪀#95_(^^?0×Ḅ〜=L0᝞,,n$*+ᓄ。ᯠx,&ᵨÈ^ᑁᦪᑣ7,ᵨᐰþL&1>^0D-%6〜?0^Iìû⚔An$ᙶ᪗Lᣚ。1ᩭ,z1Xìû⚔AlᩭḄ7⁐+òÒÈ$᪀#08Ḅ(^11ᡂᕒ,&⚔AḄ7⁐1êSBÅᜫ。ᨬx]%L08。tû,o=ᓫḄ⚔AḼ⁐ᘤᐰ%R。VwᙠJ3,Ôᨵᑏ²Ḽ⁐ᘤ,ᡠ8²Ḽ⁐ᘤḄrᐵvÄRQᵫ³}ØOà+_`[ᡂ。ᙠ☢ᑏḄ⚔AḼ⁐ᘤÒ,¶ᨬÐÒÈḄ¦ᨵo=$᪀#L08,PQ⚔AḼ⁐ᘤ▭Q┐IìûFI^ÒḄZ=⚔Aᑖn$⚔AḼ⁐ᘤÒ}©ḄvÄ,ᓽXZ=⚔AḄßᙶ᪗-ý8ᐰþL0^^0¿%〜?£,Z=⚔AḄ7⁐1ê-ÌØòv。Û:ᙠUÁµᵨᑮà☢ᑏḄ⚔@Ḽ⁐ᘤ,ᙠ=µ2ᑮ⚔@Ḽ⁐ᘤ᝞¹.C+ᓝM9ṹᔠàᩭvᡂ12MNḄ。12.5.3Ḽ⁐ᘤ"ṹwØTᙠÑÒᵨḼ⁐ᘤ,R◤⌕I&?ᙠᦻᦻᡈܤTÒḄḼ⁐ᘤ"ṹn$。e8&ᵨ0309<^1^᝞51^8ç0«^L0ᦪI&?ᙠᦻÒḄḼ⁐ᘤ"ṹn$,KᦪḄ¯᝞。HRESULTD3DXCompLleShaderFromFile(LPCSTRpSrcFile,CONSTD3DXMACR0*pDefmes,LPD3DXINCLUDEpInclude,LPCSTRpFunctionName,LPCSTRpProfile,DWORDFlags,LPD3DXBUFFER*ppShader,LPD3DXBUFFER*ppErrorMsgs, HLSLßḼ⁐èéooo187LPD3DXC0NSTANTTABLE*ppConstantTable);ᐸÒ:•pSrcFileZᜓḄḼ⁐ᘤV"ṹᦻ。•pDefinese⌱¸ᦪ。030990X05`Ḅ$᪀#ᦪ,ᵨJóFᦔWI^ᵨḄ⚜ᘤ,eXᐸ(wNULL。•plnclude«^^^(^^1ôᢣ┐,KᵨÑᜐᳮK1ô,8@ÒAḄᓄᕸ(^$w023,ÒAḄ7^ᓃ᝞$w8g◤⌕,ᡠ8eXK¸ᦪᢣ}w>^0^。•pFunctionNameḼ⁐ᘤḄᐭôᦪ。•pProfileᢣ}⌕XìûḼ⁐ᘤᡂ=᱐。•Flags⌱⚗,XK¸ᦪ(w0,⊤9Sᵨ÷<⌱⚗。3ᵨḄ⌱⚗᝞:•D3DXSHADER_DEBUGᢣ9ᘤᑏᐭ&t1ê。•D3DXSHADERJSKIPVALIDATIONᢣ9ᘤSn$÷<"ṹò,¦ᨵììᙠᵨo=AeᵨḄḼ⁐ᘤî,`ÚᵨK⌱⚗。•D3DXSHADERJSKIPOPTIMIZATIONᢣ9ᘤSI"ṹn$÷<Úᓄ。◀◤⌕n$&t,ᔲᑣS₞ᵨK⌱⚗。•ppShader&?ᨬÐnᡂḄḼ⁐ᘤ"ṹḄ>?。•ppErrorMsgs&?ᙠvÑÒᡠÈRḄ>Ùᡈ┯Ḅ>?。•ppConstantTable103090^ᖾ31^×&¦1ôᢣ┐,eᵨKᢣ┐EḼ⁐ᘤ3。Û:0&8309¿ᢝḄᨬḼ⁐ᘤ᱐w3.0,PQJ,SUᕡḼ,ᙠSJ3.0᱐Ḅûe8dUᢣ}Ḽ⁐ᘤ᱐,Q¦Øᢣ}|=ᐹ#Ḅ᱐。ᔠḄ⚔AḼ⁐ᘤ᱐ᨵ:vs_l_0,vs_l__l、vs_2_0、vs_3_0;ᔠḄ²Ḽ⁐ᘤ᱐ᨵ:psj_0、ps_l_l、ps_l_2、ps_l_3、ps_l_4、ps_2_0、ps—3_0oxḄḼ⁐ᘤ"ṹe8Äwᐸ¦ᦪḄ¸ᦪ,ᵨJ_`⚔AḼ⁐ᘤᡈ²Ḽ⁐ᘤ。Û:Ḽ⁐ᘤ"ṹḄᑏ᪵SeäᙢBÈRoE⚪,Jî◤⌕n$&t。pû8"8950XḄᨬHḄḼ⁐ᘤ&tÃᐹQ?0^ᨵᐵKÃᐹḄᐹ#vÄᵨ,èÅÚᦻ᫏。12.6Þ$»✌ᐜCDḼ⁐ ¡(HLSL)Ḅ ,ᒹ^^^ᓃÒḄᦪ£5`、⊤®b、 ¥、ᦪ¶ᑁ4。1«^1Ḅ 0 ¡35D,e8ᙠz{vÑÒX111^1 ¡÷ᓚ ¡n$I,8¹Uᳮ。ᨬxCD᝞<ᵨ^1181ᑏḼ⁐ᘤÑ,⌕ᒹHLSL"ṹḄᑏ。o»ᡃÐXz{᝞<ᵨ111^1ᐹ#ᑏ⚔AḼ⁐ᘤ²Ḽ⁐ᘤ,8O᝞<ᙠKᵨÑ"ṹÒᵨ⚔AḼ⁐ᘤ²Ḽ⁐ᘤÌ"³}ØOà+ÒḄ%ᑖØ。a!1.Ù$ᑖ᪆HLSLC ¡åÿ?ᙠª。2.Ḽ⁐ᘤÒḄLe8ᙠḼ⁐ᘤ"ṹå᜜(ᙠ0++"ṹÒ)n$E?3.ÅÚ50Xᦻ᫏,៉j^ᓃḄᑁᦪ。 Î13UḼ⁐ᘤ<ᦔ®2vo»Ḅz{,ᡃÐHLSLḄ ,,eÑOà+8O⚔AḼ⁐ᘤ²Ḽ⁐ᘤḄᭆù。»Xz{ᐹ#᝞<ᵨeÑOà+"/³}ØOà+F,8O᝞<ᵨᦔWko¶ᳮ⚔AḼ⁐ᘤ²Ḽ⁐ᘤ,᝞<ᵨᦔW¶ᳮᔜ*G᝱。13.1⚔@Ḽ⁐ᘤ⁚[ᐜCD⚔AḼ⁐ᘤḄØ、⚔A¯Ḅᭆù,ᯠx$ᔠ9ÑCDᵨ⚔AḼ⁐ᘤḄp。ᨬxᵨ⚔AḼ⁐ᘤU8"“30³}ØOà+Ḅ}*ᐝ᯿TU`,8O¹UI⚔AḼ⁐ᘤᐝ᯿TU`Ḅᳮ。13.1.1⚔ Ḽ⁐ᘤ⚔AḼ⁐ᘤᙠØe8Ì"³}ØOà+Òᙶ᪗Lᣚ÷ᐝ᯿▤f,8ßJ╨Ò(tessellation)▤fåx,ᒆ◀÷ûú▤fåû。╨Ò▤f$kx,¯Xo=⚔Aᦪ£⌴⚔AḼ⁐ᘤ,⚔AeØᒹõß、[ᳮᙶ᪗、⚔A7⁐、+¶ᦪ£。⚔AḼ⁐ᘤSØ_`ᡈᑤ◀⚔A,8ᙠᜐᳮ$kx,t´ÒÈ#SûúÿÒḄ⚔Aß。◀ûå᜜,Re8ÒÈ[ᳮᙶ᪗、⚔A7⁐、oᓄjᦪ¶。᝞WÖᵨ⚔AḼ⁐ᘤ,³}ØOà+ÒḄᙶ᪗Lᣚᐝ᯿ᜐᳮX)ÎÌἭᵨ,᝞13.1ᡠ9。ìᵨ⚔AḼ⁐ᘤî,³}ØOà+Bµᶍ÷LᣚóᐝrᐵḄG᝱1ê。ìἭᵨ⚔AḼ⁐ᘤî,Böyᵨ³}ØOà+,,KᵨᡠᨵìûG᝱(。13.107830⚔AᜐᳮvÑ Ḽ⁐ᘤ<ᦔ®ooo189⚔AḼ⁐ᘤᙠWQᵫ:#ᕒᑏḄojᑡ┐I⚔AḄḼ⁐ᢣ$,ì0^^(^30ᜐᳮᐗ⚔Aî,)ÎᵨJḼ⁐ᢣ$IZ=⚔A⌲on$ᜐᳮ,[ᡂ⚔Aᦪ£ḄᜐᳮÃÄ。ᵨ⚔AḼ⁐ᘤ,e8SÙ▲J³}ØOà+,ᐹᨵᜧḄᮣRឋ,e8Ro³}ØOà+ᡠSᐹᜓḄ⚔AᜐᳮØ,᝞Rf¹cᩖḄᐝ᯿。13.1.2⚔ -#ᙠ³}ØOà+Ò,ᡃÐᵨFVFóF⚔Aᦪ£ᒹõᑖ。ᙠeÑOà+Ò,Óᯠ·e8ᵨ?9?óF⚔Aᦪ£,PQᙠeÑOà+Ò⚔Aᦪ£ᨵîeØBᒹõoÈ?9ᓹóFØÔḄᦪ£,IJJ*êæ,e8ᵨóFØÔf£Ḅ⚔A¯I^óF⚔Aᦪ£。e82vroi^ect3DDevice9::CreateVertexDeclaration()>_`⚔A¯I^,K>Ḅ¯᝞。HRESULTCreateVertexDeclaration(CONSTD3DVERTEXELEMENT9*pVertexElements,IDirect3DVertexDeclaration9**ppDecl);ᐸÒ:•pVertexElements^tl^-^D3DVERTEXELEMENT9^S^^^^a,ᦪÒḄZ•=ᐗ²ᑖóF⚔Aᦪ£ÒḄo=ᑖ,•ppDeclᵨJ]%_`Ḅ⚔A¯I^。⚔A¯I^QI⚔Aᐗ²ᔠḄo=Ê,⚔Aᐗ²}©᝞。typedefstructD3DVERTEXELEMENT9{WORDStream;WORDOffset;BYTEType;BYTEMethod;BYTEUsage;BYTEUsageIndex;>D3DVERTEXELEMENT9,*LPD3DVERTEXELEMENT9;ᐸÒ:•Stream÷⚔AᑖrᐵὶḄᦪ£OḄ。•Offset^⚔Aᦪ£:+ßᑮᱯ}÷ᦪ£ᑖrᐵὶḄᦪ£ḄÜ⁚â。•Typeᦪ£5`,KᡂᕒeÌ0300£0^v?£Pp5`Ḅ÷Uò,3ᵨḄ5`q⊤13.1,[᦮5`ᑡ⊤èÅÚᦻ᫏。•Methodᢣ}╨Òᜐᳮ(tessellatorprocessing)>,╨ÒᜐᳮÈḄ,ᡠ8ᙠÒᵨÒAòD3DDECLMETH0D_DEFAULT。•Usageᢣ}⚔AᑖḄᵨ⌶,᝞QᵨÄßᔣ、ᔣRQ[ᳮᔣ¶,eÌPp5`0300£0^5^^Ḅ÷UPpò93ᵨḄ0300£0^^0£Pp3q⊤13.2,[᦮ᑡ⊤èÅÚᦻ᫏。•Usagelndex⊤9I⚔Aᐗ²Ḅ@A,ᵨJ᪗ᐹᨵrᵨḄi=ᑖ。 190oooÎ13U*13.13ᵨḄ0300£0>×vᓹ£Pp3D3DDECLTYPE______________________^#D3DDECLTYPE_FLOATlᐹᨵ1!ᐗóḄ/ ᦪ,᡽$(^020,0,1>D3DDECLTYPE_FLOAT2ᐹᨵ2!ᐗóḄ/ ᦪ,᡽$(ᡭ040050,1>D3DDECLTYPE_FLOAT3ᐹᨵ3!ᐗóḄ/ ᦪ,᡽$(¹<^,0(^,0031,1)D3DDECLTYPE_FLOAT4ᐹᨵ4!ᐗóḄ/ ᦪ,᡽$<11(^,<1(^,0031,float)D3DDECLTYPE_D3DCOLOR⚔ᐗóᙠᦪ¡¢ 0300^0]ôõ67_________________________⊤13.23ᵨḄ0300£0^86£Pp3’_____________________᪗89ᐹ:*___________________D3DDECLUSAGE_POSmON⚔ ᙶ᪗D3DDHCLUSAGE_BLENDWEIGHT⚔ ᔠᩗ=D3DDECLUSAGE_BLENDINDICES⚔ ᔠùúD3DDECLUSAGE_NORMAL⚔ $%ᔣᨬD3DDECLUSAGE_PSIZE⚔Ḅᜧ D3DDECLUSAGE_TEXCOORD⚔ >ᳮᙶ᪗D3DDECLUSAGE_POSITIONTHᙶ᪗?ᣚḄ⚔ ᙶ᪗D3DDECLUSAGE_COLOR⚔ A{BᡈD☢{BE⁐D3DDECLUSAGE_FOGFᓄᦪ¡GD3DDECLUSAGE,DEPTHHIᦪ¡G☢Q_`⚔A¯I^Ḅ9"ṹ。D3DVERTEXELEMENT9decl[]={{0,0,D3DDECLTYPE_FLOAT3,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_POSITION,0>,{0,12,D3DDECLTYPE_FLOAT3,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_NORMAL,0>,{0,24,D3DDECLTYPE_FLOAT2,D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_TEXCOORD,0},D3DDECL_END()>?V_RETURN{g_pd3dDevice->CreateVertexDeclaration(decl,&g_pVertexDeclaration));F"ṹ_`Ḅ⚔A¯I^,⊤9⚔Aᦪ£ᒹõß、+、[ᳮᙶ᪗}=ᑖ。9:⚔A¯ᦪḄᨬxo=ᐗ²QD3DDECL_END()。13.1.3ᵨ^^3[⚔AḼ⁐ᘤḄpᙠo»ÒCDᑏḼ⁐ᘤḄvÑ,☢$ᔠ9Ñ1«^11^ᓽ700^CDᵨ⚔AḼ⁐ᘤḄp,,^9᝞<ᵨ⚔AḼ⁐ᘤRᙶ᪗Lᣚ。K9Ñ2v⚔AḼ⁐ᘤRo=¹våèÃḄ}。1.ᑏ⚔AḼ⁐ᘤ"ṹ9Ñ1«^11^^^00^ᙠᓫäḄᦻᦻHLSLTransform•vshÒᑏ⚔AḼ⁐ᘤ"ṹ,ᐹ#"ṹQᙠo»125.2Þ⁚ÒÈḄ"ṹ。Ḽ⁐ᘤ"ṹᦻḄ8¹vÑ,8OḼ⁐ᘤ"ṹÒᔜ$"ṹḄᐹ#õ©,ᙠ12.5.2Þ⁚Ò Ḽ⁐ᘤ<ᦔ®OOO191n$*dCD,ᙠûSÙF。2.bÅìûh¿ᢝḄ⚔AḼ⁐ᘤ᱐ᙠᵨ⚔AḼ⁐ᘤåû,Kᐜbxìû(ᜓ¿ᢝḄ⚔AḼ⁐ᘤ᱐。9ÑHLSLTransformbÅ⚔Aᘤ᱐Ḅ"ṹ᝞。D3DDEVTYPEdeviceType?if(caps.VertexShaderVersion?//_`⚔A¯I^V_RETURN(g_pd3dDevice->CreateVertexDeclaration(decl,&g_pVertexDeclaration));F"ṹ_`Ḅ⚔A¯I^,⊤9⚔Aᦪ£ᒹõ⚔Aßᙶ᪗7⁐5=ᑖ。4.⚔AḼ⁐"ṹᙠ_`⚔AḼ⁐ᘤåû,◤⌕ᐜ⚔AḼ⁐"ṹ。ᙠ9ÑHLSLTansformÒ⚔AḼ⁐ᘤḄ"ṹ᝞:LPD3DXBUFFERpVSCode;DWORDdwShaderFlags=D3DXSHADER_SKIPOPTIMIZATION|D3DXSHADER_DEBUG;V_RETURN(D3DXCorapileShaderFromFile(L"HLSLTransform.vsh",NULL,NULL,"VS","vs_2_0",dwShaderFlags,&pVSCode,NULL,&g_pConstantTable));5._`⚔AḼ⁐ᘤ⚔AḼ⁐ᘤ"ṹx,e8&ᵨ107830069ᓃ6::063〖696Û951^1670>_`⚔AḼ⁐ᘤ,K>Ḅ¯᝞。HRESULTCreateVertexShader(CONSTDWORD*pFunction,IDirect3DVertexShader9**ppShader)7ᐸÒ:*pFunctionᢣᔣᡂḄḼ⁐ᘤ"ṹf。•ppShaderᢣᔣᨬÐnᡂḄ⚔AḼ⁐ᘤ。VwḄ⚔AḼ⁐ᘤ"ṹ&?ᙠID3DXBUFFER5`Ḅ>?Ò, ☢ 192oooÎ13U0"31696P51^(1670>Ḅóo=¸ᦪQᢣᔣ0>^0R05`Ḅᢣ┐。ᡠ8✌ᐜ◤⌕&ᵨ103098G[£1:06186#07¹64)>,´ᑮᢣᔣ>?ᦪ£Ḅᢣ┐,ᯠxXᐸÃᣚwᢣᔣ0〜0^05`Ḅᢣ┐。ᙠ9ÑÇ1^^^1^0011Ò_`⚔A⁐ᘤḄ"ṹ᝞。if(FAILED(g_pd3dDevice->CreateVertexShader((DWORD*)pCode_VS->GetBufferPointer(),&g_pVertexShader))){pVSCode->Release();returnE_FAIL;_>6(⚔AḼ⁐ᘤ3ᙠḼ⁐ᘤ"ṹÒḄᐰ☢L,8Oᙠ¯îᵨ¿77(^^ᐵÏÜn$ÛḄL,BÌ8¹ᑮḼ⁐ᘤḄ3⊤Ò。ᙠ0+"ṹÒ,e82v0309Ḅ1030᱄€01^᝞1×&&^1ôEḼ⁐ᘤḄ3ᨬ⊤。ᙠḼ⁐ᘤ"ṹÒᵨḄ¡i3,ᐸÌò◤⌕ᵫᓚ++"ṹ。᝞ᙠûᵨḄᐰþLmatWorldViewProj,KL⊤9I⚔An$LᣚḄᔠLᣚ▣,µᯠz1ᙠḼ⁐ᘤ"ṹÒ᪀⌼J᪵o=Lᣚ▣QÞãḄ。ᡠ823ᐜᙠ<:++"ṹÒ᪀⌼rKḄ▣,ᯠx&ᵨID3DXConstantTable:•SetMat^lx()¨=matWorldVie^vP^oj[÷nᙠC++9ṹÊ᪀⌼Ḅ▣。☢8《^1>^0116976〜?10>)ᐰþLw,Û᝞wḼ⁐ᘤ3(ᦪò。óo*>Q&ᵨ10309<^^1^l1^BGetConstantByName()>,᪷£LḄÈ7;Ìo᪗LḄ¥P,ᯠx2vK¥PwḼ⁐ᘤ3(ᦪò,᝞ᡠ9。D3DXHANDLEhMatrix;D3DXMATRIXmat;//᪀⌼**^^,"ṹᶍpContantTable->GetConstantByName(hMatrxx,"matWorldV1ewPro3");pContantTable->SetMatnx(pd3dDevice,hMatrix,&mat)óB*>Qz1X¸ᦪ1^0ᑿ8P(wLḄÈ7,᝞ᡠ9。pContantTable->SetMatnx(pd3dDevice,"matWorldViewProj",&mat)ᙠÑÒ,᝞W¦◤⌕wḼ⁐ᘤ3(oSᦪò,ᑣᵨóB*>f>¯o。Q᝞W◤⌕3(mḼ⁐ᘤ3Ḅò,᝞eØ◤⌕᪷£Ñ$îÿ,SeᦋLLᣚ▣,Jîᵨóo*>f>¯,ᦔ᳛·f。9Ñ8150>n#00«¬ᵨḄQóB*>。 Ḽ⁐ᘤ<ᦔ®OOO193◀SetMatrix()>å᜜,703090^᝞¹×&¦1ôR¡iᵨJ(ᐸ¦5`3Ḅ>,⊤13.3ᑡÈo3ᵨḄ>,[᦮Ḅ>ᑡ⊤èxÚᦻ᫏^⊤13.33ᵨḄ1030᱄〇0□13^×313781ô>__________________1ô>_________________ÛSetBool(o=äòSetBoolArray(o=äᦪSetFloat(o=ôAᦪSetFloatArray(o=ôAᦪᦪSetInt(o=᦮ᦪSetIntArray(No=᦮ᦪᦪSetMatrix(o=▣SetMatrixArray(No=▣ᦪSctVcctor(o=ᔣᨬSctVectorArray(o=ᔣ&ᦪ×:⊤13.3ÊᑡÀḄ¨,vwíᓫ=>nÎ:ᦪᐭᦪḄ,vwFᩖḄ=>(^᝞ᔣ、▣、᪀g)nÎ:ᦪᐭḄᢣᔣᦪḄᢣ┐。vwᦪñ=[÷Àᦪ,ÁᨵÎᦪ,ᵨwᢣäᦪñᐗ4Ḅᦪ。7.ᵨ⚔AḼ⁐ᘤRᙠ.wᵨ⚔AḼ⁐ᘤ÷oᑗZᜓ,1ᩭe8ᵨ⚔AḼ⁐ᘤ"/³}ØOà+ÒḄ×&ᓃḄØ。ᵨ⚔AḼ⁐ᘤ3ᓫ,¦◤⌕&ᵨ10^“300〜1(^::5v96ᡭ65&3(^0>(⚔AḼ⁐ᘤᓽe,᝞ᡠ9。g_pd3dDevice->SetVertexShader(g_pVertexShader);(⚔AḼ⁐ᘤåx,07^^30X)ÎἭᵨ³}ØOà+ÒḄ×&1▤f,,)Îᵨ⚔AḼ⁐ᘤn$⚔ALᣚᐝ᯿ÃÄ。9Ñ1^151^1^-1^711ÒFḄ[᦮"ṹ᝞。g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX))?g_pd3dDevice->SetVertexDeclaration(g_pVertexDeclaration);g_pd3dDevice->SetVertexShader(g_pVertexShader);g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,1);☢Ḅ"ṹ✌ᐜ(ᦪ£O,ᯠx(⚔A¯I^⚔AḼ⁐ᘤ,ᨬxF。ᙠû·e8Sᵨ⚔A¯I^,-ᯠᵨᮣR⚔Azb。8.³Ã⚔AḼ⁐ᘤrᐵI^ᙠÑ⌨Èåû,S⌕uµ³Ã÷⚔AḼ⁐ᘤrᐵḄI^,ᒹ⚔AḼ⁐ᘤI^、⚔A¯I^、3ᨬ⊤1ôI^。×:ᙠR#$,ᙠç⚔@Z[D,ᡃ(Vn10^3006469::€A&1668“[61()¨ḄÎ:ᦪ??[÷ ᨵᦔḄᮣ⚔@56。DçḄ⚔@Z[,û#n“FVF⚔@Z[”。᝞®='ᦪ[÷n0,ᑣçḄ⚔@Z[û#n“iFVF⚔@Z[”。ᙠ]^♦HLSLTransform*,ᡃ(çḄÒiᓹ?⚔@Z[。9ÑHLSLTranSf0^nḄᐸ¦Rd⁚,ᡃÐ៉,ᙠûÞ'ÙF。ᐸ$ᦔW᝞13.2ᡠ9。 194................................................................................................................................oooÎ13U13.29Ñq^×JXᢕ$ᦔW☢2v9Ñ111^11^Dᓄ0^CDᵨ⚔AḼ⁐ᘤḄᐹ#p,î·e8³}ØOà+Ò⚔Aᙶ᪗LᣚḄᢈGᑁf。2v☢⚔AḼ⁐ᘤḄᐹ#ᵨe8ÚÈ,ᵨeÑOà+,SQcᩖ, åx,B#RᨵîᵨeÑOà+ᵨ³}ØOà+f¹>¯。13.1.4ᵨ⚔AḼ⁐ᘤRᐝ᯿U`ᙠo⁚Ḅ9Ñ1«^0>31^ᓄ0«Ò,2v⚔AḼ⁐ᘤR⚔ALᣚ。⚔AḼ⁐ᘤḄ⌕÷zᒹ5=>☢:o=Q⚔ALᣚ,=o=Qᐝ᯿T。☢CD᝞<ᵨ⚔AḼ⁐ᘤR8^30³}ØOà+Ḅ}*ᐝ᯿TU`。o>☢e8nop៉⚔AḼ⁐ᘤ"ṹḄᑏ⚔AḼ⁐ᘤḄᵨ,=o>☢·e8³}ØOà+Òᐝ᯿TḄᢈGᑁf,¹UI³}ØOà+Òᐝ᯿TḄᳮ。1.ú᛻ᐝᐝ᯿U`ᙠú᛻ᐝᐝ᯿TU`Ò,ᡠᨵᐝ+ᙳᒴᙢ^ᔜ=>ᔣ᯿]ᑮᱥ#,J*ᐝ᯿U`ᙠÿÒQÔᨵßḄ。eᵨ☢Ḅ;bóFú᛻ᐝᐝ᯿TU`^Cjunbient—^intensit>'X^colorX^matcrialᐸÒ,4__⊤9ú᛻ᐝḄ£,4。^⊤9ú᛻ᐝḄ7⁐,⑽㈣⑴⊤9ᱥ#Iú᛻ᐝᔜ7⁐ᡂᑖḄI]jᦪ。Rú᛻ᐝᐝ᯿TU`Ḅ⚔AḼ⁐ᘤ"ṹ᝞。//ᐰþLn,ᙠ0++"ṹÒ(qᐸᐹ#ᦪòfloat4x4matWorldViewProj;float4materialAmbient;//•⚔Ar⁐ᘤÒÈ$᪀structVS_OUTPUT{float4Pos:POSITION;float4Color:COLOR; ⁐ᘤ<ᦔ®ooo195//⚔Aὅ⁐ᘤᐭôᦪVS_OUTPUTVS(float4Pos:POSITION){VS_OUTPUTOut=(VS_OUTPUT)0;Out.Pos=mul(Pos,matWorldViewProj);float4AmbientColor={1.0f,1.0f,1.0f,1.0f>;floatAmbientIntensity=0.5;Out.Color=AmbientIntensity*AmbientColor*materialAmbient;returnOut?>ᙠ☢Ḅ"ṹÒ,ᐰþL0^16^3101^»⊤9ᱥ#Ḅú᛻ᐝI]jᦪ,8Qo=ᒹõ4=ᐗ²Ḅᔣ,ᵨ8ᩭᢣ}ìû⚔AØI]7⁐Ḅú᛻ᐝ,8OØI]i´。KLḄᐹ#ÌòQᙠ0++"ṹÒ(Ḅ。»9Ѧ1510^76ᡷ^9ᵨ☢Ḅ⚔AḼ⁐ᘤRú᛻ᐝᐝ᯿TU`。9Ѧ[51^^ᡷFo=ᵫ03090^^1^08()ᦪ_`ḄₐU`,ᐸÒF%ᑖḄ"ṹ᝞:g_pd3dDevice->SetVertexShader(g_pVertexShader);g__pTeapotMesh->DrawSubset(0);.◀☢ÈḄ⚔AḼ⁐ᘤ"ṹå᜜,9ÑḄᐸ¦ᑁ4ᙠû☢-CDv,ᐹ#Rd⁚èÅÚÑV"ṹ。W]:ᵨ·5>zMND,◤⌕·a·5i>ÊḄ⚔@WX ⚔@Ḽ⁐ᘤᡠ◤⌕Ḅ⚔@ᦪ¸。ᙠÎ9Uᡃ(Wᑮ,ᵨ030᱄0^^6*ᑡÀᦪçḄ·5i>Ḅ⚔@ᒹL÷ᙶ᪗<¨O¹ᑖᦪ¸。R᜜4n10308356^5:0^〜5ᓄ6〖0¨ᙠᑁ¹µ=ᢣä⚔@56,ᡠᙠMÊÒ5◤⌕ç[÷⚔@ô×v。2.mᐝ᯿i>ᙠI]ᐝ᯿U`Ò,◤⌕ὃ⇋ᐝVḄß,·QÛ,ᐝᙠÿÒQᨵß>ᔣḄ,JQᡠçḄßᐝ᯿U`(positionallightingmodel)0JQI]ᐝ᯿U`÷ú᛻ᐝᐝ᯿U`åÿḄᨬᜧ。I]ᐝ᯿U`Ḅ=᜜o=ᱯQI]ᐝ+÷e8ὅḄßNᐵ。Vû,ᙠI]ᐝ᯿U`Ò,}Cᱥ#ᨬÐḄḼ⁐,SBVwe8AḄLᓄᦋL。J·QwI]ᐝ᯿U`ÌýᵨᩭUSᐝ¸⊤☢ḄlV。I]ᐝ᯿U`⍳+^3^“"}ᳮ,K}ᳮᵨ5=ᔣkóFI]ᐝ᯿U`:o=QóFᐝVßḄᔣ1Kᔣ^ᱥ#⊤☢⚔AᢣᔣᐝVß,=o=QóF⚔AᔣḄᔣN,᝞6.1ᡠ9。I]ᐝ᯿1ᓝU`eᵨbóF。^diffusc=^imcnsiiyX^colorXCOS0XDmatcria]ᐸÒ,h^_ᓄ^ᑖ⊤9I]ᐝḄ£7⁐,;_^⊤9ᩞWḄI]jᦪ,0w1"åÿᜳ。᝞W1"-wᓫßᔣ,ᑣ0^0s¶J17^ḄAÿ,JîeᵨbóFI]ᐝ᯿U`。^diffuse—^intensity^^cooiN.L,XZ^roaterjaj23XI]ᐝ᯿ᡂᑖ÷ú᛻ᐝᐝ᯿ᡂᑖr¹ᩭJᔠᐝ᯿ᦔW,Jî⚔AḄ7⁐òT;b᝞。 96oooÎ13UColor—^intcnsity᱄^color᱄^material+^intensityX^colorN•LX^matcrialRenopXF;bᓄw8b。Color=AmbientColorxAmatcrial+DiffuseColorxN•LxDmaterialᐸÒ©ᡠ/ᕸ^/(^=AimcnsityxAco)or,DiffuseColor=DintcnsityxD—。Û:ᓃᔣḄ4£JᐝcḄL÷ᔣ,ᓽᐭᐝᔣḄmᔣ,|ᙠ¾e¦§,n Õb"、íᓄᙢBᔜᐝ᯿i>,=äûnᐝᔣᡈᐝ᯿ᔣᔣ,vRxyὅᨵ*⏨ḄZ,。»9Ѧ151871^^^9ᵨ⚔AḼ⁐ᘤRI]ᐝ᯿TU`,K9Ñᙠ111^10^ᓄ1^9ÑḄẠ8¹I]ᐝ᯿ᦔW,ᐸÒ⚔AḼ⁐ᘤḄ[᦮"ṹ᝞。//ᐰþL3float4x4matWorldViewProj;//cᔠLᣚ▣float4x4matWorld;//&▣float4vecLightDir;//óᐝ>ᔣfloat4materialAmbient;//ᩞWI]ú᛻ᐝjᦪfloat4materialDiffuse;//ᩞWI]jᦪ//⚔AḼ⁐ᘤÒÈ$᪀structVS_OUTPUT{float4Pos:POSITION;float4Color:COLOR;>;//⚔Ah⁐ᘤᐭôᦪVS_OUTPUTVS(float4Pos:POSITION,float3Normal:NORMAL){//T⚔AßVS_OUTPUTOut=(VS_OUTPUT)0?Out.Pos=mul(Pos,matWorldViewProj)?//T⚔A7⁐float4Light=normalize(vecLightDir);float4Norm=normalize(mul(Normal,matWorld));float4diffuseColor={1.0f,1.0f,1.0f,1.0f>?float4ambientColor={0.5f,0.5f,0.5f,1.0f};Out.Color=ambientColor*materialAmbient+diffuseColor*saturate(dot(Light,Norm))*materialDiffuse;returnOut;}VwᙠTI]7⁐òî◤⌕ᵨᑮ⚔Aᔣ,ᡠ8ᙠḼ⁐ᘤᐭ14ᦪ95()ḄÒᐭ¸ᦪÒ,8¹⚔Aᔣ1^00«&1,×î2v ©NORMALᢣ9ᘤXKᦪ£u}ᑮrKḄd?ᘤÒ。wn$I]ᐝ᯿T,✌ᐜ◤⌕&ᵨi^ᓃᑁᦪḄᕸᓄ…eᓄᐝ᯿>ᔣᔣ⚔AḄᔣ。ᐸÒöᓄᐝ᯿>ᔣᔣḄ"ṹ᝞。float4Light=normalize(vecLightDir);I×⚔Aᔣᨬ,Vwᨬ*⚔AᔣßJᙢᙶ᪗j,ᡠ8ᙠöᓄ⚔Aᔣåû, Ḽ⁐ᘤ<ᦔ®ooo197✌ᐜK2v&Lᣚ▣①⇧〜17(!,XᔣLᣚᑮ&ᙶ᪗j,"ṹ᝞。float4Norm=normalize(mul(Normal,matWorld));ᨬx,᪷£û☢ÈḄᐝ᯿T;b,T⚔AḄ7⁐ò,"ṹ᝞。Out.Color=ambientColor*materialAmbient+diffuseColor*saturate(dot(Light/Norm))*materialDiffuae?ᐸÒ,^[5[ᑁᦪ(180ᵨJT5=ᔣḄAÿ,ᦪvᡷ()ḄÄᵨQXAÿxḄ$W9Ìᑮ[0,1]ÿᑁ。ûî⚔A7⁐òQᵫìûú᛻ᐝI]ᐝ7⁐ᑖý8IKḄᩞWI]jᦪ,ᨬxÙ`¹ᙠo® ´ᑮḄ。VwI]ᐝ᯿◤⌕ᵨ⚔A+,ᡠ8⚔Aᦪ£◤⌕+1ê。Vw03090^3^1^Í01()ᦪ_`ḄₐU`Ḅ⚔A)Îᒹõ+1ê,ᡠ8ᙠ9ÑG5ᓃ0〖7^6ÒS◤⌕n$w᜜Ḅᜐᳮ。9Ñ⇧510〖7ᓄ6Ḅᐸ¦ᑁ4ᡃÐÛ៉,ᐹ#d⁚è¸ὃᐸV"ṹ。3.☢I]ᐝ᯿U`ú᛻ᐝS◤⌕ὃ⇋ᐝḄ>ᔣ,·S◤⌕ὃ⇋e8AḄ>ᔣ,I]ᐝ᯿U`¦◤ὃ⇋ᐝḄ>ᔣ,ᙠ☢I]ᐝ᯿U`Ò,î⌕ὃ⇋ᐝḄ>ᔣ,·⌕ὃ⇋e8AḄ>ᔣ。VwIJUᐝ¸、ᨵᐝxᡈyᐝḄ⊤☢,Xe8Aᐭὃ⇋Qᨵ⌕Ḅ。ᙠ☢I]ᐝ᯿U`Ò,ᵨ5=ᔣℏᩭT☢I]ᡂᑖ.*e8Aᔣ9I]ᔣX。ûὅóFe8AḄrIß,xὅóFᐝᔣḄI]>ᔣ,᝞6.2ᡠ9。9XḄᜳwcp,vg÷X☠z,I]ᐝgL。Vû008Ò÷☢I]ᐝ᯿ᡂì。=᜜,R◤⌕ᨵo=ᢣᦪ《ᩭ⊤9ᐝx}ឋ,0Ḅògᜧ,☢I]ᐝg£。eᵨbóF☢I]ᐝ᯿TU`。^specular=^intensityX^colorX(COSᔣᔣḄIᔣ。Pwf¹z1、ᓄᙢóF☢I]ᐝ᯿U`,4{iêæ,X97we8>ᔣᔣ,Iû/ὅᨵo=Ü⏨ḄA。JoA÷I]ᐝ᯿U`ÒḄ“L”ᔣ5D。᪷£☢ḄT;b,e8ᑏÈ8¹☢I]ᐝ᯿ᦔWḄ⚔AḼ⁐ᘤ"ṹ,[᦮ 198oooÎ13U"ṹ᝞。//ᐰþL}float4x4matWorldViewProj;//cᔠLᣚ▣float4x4matWorld;//&▣float4vecLightDir;//óᐝ>ᔣfloat4vecEye;//R8Aßfloat4materialAmbient;//ᩞWú᛻ᐝI]jᦪfloat4materialDiffuse;//ᩞWI]jᦪfloat4materialSpecular;//ᩞW☢I]jᦪ//⚔AḼ⁐ᘤÒÈ$᪀structVS_OUTPUTᔣe8>ᔣ•float3lightDir=normalize(vecLightDir);float3po8World=normalize(mul(pos,raatWorld));float3viewDir=normalize(vecEye_posWorld);//Tᔣ3>ᔣ~I]£float3normalWorld=normalize(mul(normal,matWorld));float4diff=saturate(dot(normalWorld,lightDir));//TI]ᐝ>ᔣ(R=2*(N.L)*N-1)☢I]£float3Reflect=normalize(2*diff*normalWorld-lightDir);floatn=0.5;float4specu=pow(saturate(dot(Reflect,viewDir)),n);//⚔A7⁐float4diffuseColor={1.0f,1.0£r1.0£,1.0f}?float4ambientColor={0.5f,0.5f,0.5f,1.0f};float4specularColor={0.0£f0.0f,1.0f,1.0f};Out.Color=ambientColor*materialAmbient+diffuseColor*diff*materialDiffuse+specularColor*specu*materialSpecular;returnOut;>᪷£☢I☢I]ᐝ᯿TU`ḄóF8O"ṹÒḄü³,SãᳮF⚔AḼ⁐ᘤ"ṹ,ᡠ8ᙠûSÙ*dCD/»9Ñ1«^15?6(^1&^^9ᵨF⚔AḼ⁐ᘤ"ṹw8¹☢I]ᐝ᯿ᦔW。◀☢Ḅ⚔AḼ⁐ᘤ"ṹå᜜,K9ÑḄᐸ¦%ᑖi^ᓃ87᝞86r,ᐹ#Rd⁚è¸ὃV"ṹ。 Ḽ⁐ᘤ<ᦔ®OOO19913.234Ḽ⁐ᘤo⁚CD⚔AḼ⁐ᘤḄrᐵᑁ4,Þ⁚XCD078309eÑOà+ᢈGḄ=o=@⌕Ḅᑖ¿:²Ḽ⁐ᘤ。13.2.1²Ḽ⁐ᘤCD²Ḽ⁐ᘤ⌲=I²n$ᜐᳮ。²Ḽ⁐ᘤ⚔AḼ⁐ᘤᔠᵨ,⚔AḼ⁐ᘤḄÒÈQ²Ḽ⁐ᘤḄÒᐭ。ᐸ¦²vÄ(oᓄgᔠ、UrvÄ8OFp᪗gᔠ)-Qᙠ²Ḽ⁐ᘤåx᡻$Ḅ。²Ḽ⁐ḄOÑ᝞13.3ᡠ9。】3.38830²ᜐᳮOѲḼ⁐ᘤḄ⌕÷zQ[ᡂ[ᳮ¬᪵8Oi@[ᳮgᔠ¶rᐵvÄ,ᙠØeÌ"³}ØOà+Ḅ[ᳮ᧜]▤f。²Ḽ⁐ᘤᜐᳮßJᐝ᪕ᓄ▤fåx,8^ᐝ᪕ᘤ、⚔AḼ⁐ᘤ、KᵨÑ、[ᳮcᜐ;Ìᦪ£。²Ḽ⁐ᘤᓄcᩖḄ[ᳮgᔠ▤fḄvÄ,´:#ᕒØT>¯ᙢ[ᡂ¡icᩖḄ[ᳮvÄ。9:ᙠ:~Ê,ᳮk15ü:[X⁐ᦪ¸,Á:[ᡠᨵv34Ḽ⁐B¨ᨵᵨḄᦪ¸。ᓫᙢÛ,²Ḽ⁐ᘤQojᑡ┐I²ᜐᳮḄᢣ$ᔠ。8^830Iᐗn$ᐝ᪕ᓄᜐᳮî,Xᵨ²Ḽ⁐ᢣ$IZo=²n$ᜐᳮ,ᜐᳮḄ$WÙn$oᓄᜐᳮ、Ust、Urst7⁐gᔠ¶vÄ。23²Ḽ⁐ᘤ¦ÒȲḄ7⁐,,ÒÈḄ7⁐Qfloat45`。13.2.2ᵨ²Ḽ⁐ᘤḄp☢$ᔠ9Ñ^^^^8È,CDᵨ¦151^²Ḽ⁐ᘤḄp。K9ÑᙠoÞ⁚HLSLDiffUse9ÑḄẠ,2v²Ḽ⁐ᘤw8¹[ᳮᦔW^1.ᑏ²Ḽ⁐ᘤ"ṹᙠ9Ñ^^^ô^-È"Ò,²Ḽ⁐ᘤ"ṹ&?ᙠᦻ14151×8ᡷ".?Ò。[᦮Ḅ"ṹ᝞。//[ᳮ¬᪵ᘤ 200oooÎ13Usampler2Ds_2D=sampler_state{minfilter=LINEAR;maxfilter]LINEAR;>;//²Ḽ⁐ᘤᐭôᦪfloat4PS(float2tex:TEXCOORD,float4color:COLOR):COLOR{float4outColor=0;outColor-tex2D(s_2D,tex)*color;returnoutColor;>ᙠ☢Ḅ"ṹÒ,✌ᐜ}©o=BC[ᳮ¬᪵ᘤᓃ20,ᙠK¬᪵ᘤÒ,Ôᨵᢣ}[ᳮ,J*êæ,[ᳮ¬᪵ᘤXᵨᙠ0+"ṹÒ(Ḅìû[ᳮ。ᵫJ²Ḽ⁐ᘤ23¦ÒÈ7⁐ᦪ£,ᡠ8Ôᨵwᐸ}©ÒÈ$᪀, z1ᵨ$0ò4Äw²Ḽ⁐ᘤᐭôᦪ?5()Ḅ]%5`,,ᙠᦪ¯åxᵨ ©001^0Xᢣ9]%Ḅᦪ£Q²7⁐。ᙠ²Ḽ⁐ᘤᐭôᦪÒ,ᵨ¦151ᑁᦪ1^20()IìûBC[ᳮI^n$¬᪵,ᯠxX¬᪵´ᑮḄ[ᳮ7⁐ÒᐭḄᐝ᯿7⁐rý,ÄwᨬÐÒÈḄ²7⁐。2v☢ḄR"ṹe8ÚÈ,ᵨ²Ḽ⁐ᘤn$[ᳮ▤fgᔠvÄ3ᓫ。2. ¡ýï2ᜓ¢ᢝḄ<¤Ḽ⁐ᘤ᱐¦÷⚔AḼ⁐ᘤ5D,ᙠᵨ²Ḽ⁐ᘤåû,KᐜbÅìû(ᜓ¿ᢝḄ²Ḽ⁐ᘤ᱐。ᙠ9Ñ^^^ᓃ×6᝞1^Ò,bÅ"ṹ᝞。if(caps.VertexShaderVersion_`²Ḽ⁐ᘤ,K>_`⚔AḼ⁐ᘤḄ€À%"651^^()>5D。ᙠ9Ѧᓃ51^^Ò,_`²Ḽ⁐ᘤḄ"ṹ᝞。if(FAILED(g_pd3dDevice->CreatePixelShader((DWORD*)pPSCode->GetBufferPointer()•&g_pPixelShader))){•pPSCode->Release(); Ḽ⁐ᘤ<ᦔ®OOO201returnE_FAIL;>5.Ḽ⁐ᘤ ᙠ²Ḽ⁐ᘤ_`[åx,ᵨ²Ḽ⁐ᘤFåû,ᨵî◤⌕w²Ḽ⁐ᘤ"ṹÒḄ)3(ᐹ#ḄÌò。w²Ḽ⁐ᘤ(3Ḅᐹ#>w⚔AḼ⁐ᘤ(3Ḅ>5D。Vwᙠ¦15^^0«^9ÑᵨḄ²Ḽ⁐ᘤḄ"ṹÒÔᨵ3,ᡠ8S◤⌕w²Ḽ⁐ᘤ(3,ᙠoÞ⁚XBÚᑮw²Ḽ⁐ᘤ(3Ḅêæ。6. ᵨḼ⁐ᘤîᯠwᵨ²Ḽ⁐ᘤ÷ᔆoᑗZᜓ,1ᩭe8ᵨ¨Ḽ⁐ᘤ。ᙠ9ÑHLSLTextUreÒ,îᵨ⚔AḼ⁐ᘤ²Ḽ⁐ᘤ,F%ᑖḄ"ṹ᝞。g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_pd3dDevice->SetVertexDeclaration(g_pVertexDeclaration);//(⚔A¯I^g_pd3dDevice->SetVertexShader(g_pVertexShader);//(⚔Aὅ⁐ᘤg_pd3dDevice->SetPixelShader(g_pPixelShader);//(²⁐ᘤ•g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTHIP,0,2*50-2);7.Ḽ⁐ᘤᐵᨬxᙠÑ⌨Èû,³Ã²Ḽ⁐ᘤI^8O÷årᐵḄ3⊤I^。Vw◤⌕n$[ᳮ᧜],ᡠ8ᙠ9Ñ1«^^80^Ò,◤⌕wḄ⚔Aᦪ£8¹[ᳮᙶ᪗,îw⚔A¯I^8¹rKḄ⚔A¯ᐗ²。 ◤⌕I⚔AḼ⁐ᘤ"ṹn$rKḄÚᦋ,wᐭôᦪ8¹o=ᵨJÒᐭ[ᳮᙶ᪗Ḅ¸ᦪ,,w⚔AḼ⁐ᘤÒÈ$᪀8¹o=&?[ᳮᙶ᪗Ḅᡂᕒ。⚔AḼ⁐ᘤz1ÒÈ2v¸ᦪÒᐭḄ[ᳮᙶ᪗,ÔᨵIᐸn$÷?float4tempi=outColor*lightf;floattemp2=tempi.x+templ.y+templ.z;templ.xyzw=temp2;outColor=templ*luminance;,returnoutColor;>☢Ḅ"ṹX᪷£[ᳮᐝ᯿´ᑮḄl+7⁐Ãᣚw³Lò,,2vᐰþL1È^ᓃ3¹6ᑴ᦮=ḄL。9Ñ11181^»^0&0^^9F²Ḽ⁐ᘤRḄᦔW。✌ᐜ2v3⊤*+ᓄ1D^1^^6ᐰþL,"ṹ᝞。g__pPSConstantTable->SetFloat(g_pd3dDevice,"luminance",0.8£);◀²Ḽ⁐ᘤ"ṹ☢*+ᓄ²Ḽ⁐ᘤᐰþLḄ"ṹå᜜,9Ñi^11^¸^^^û☢Ḅ111^0^^1^[ᐰ。ᐸ$ᦔW᝞13.5ᡠ9。13.5ᵨ²Ḽ⁐ᘤRḄ³Lµ99:9÷ø0=Ü×[]n13,:íᓫiØãḄᦔ®。R᜜,ᨵᑮḄ⁐13,vw¦§,:HÀ34X⁐Ḅ⁐ᑖ,=ᐸóᑖ[÷n0。 Ḽ⁐ᘤ<ᦔ®OOO20313.3ᦔ®û5⁚ᑖCDeÑOà+ÒᨬḄᑁ4o⚔AḼ⁐ᘤ²Ḽ⁐ᘤ。ᐸÒ⚔AḼ⁐ᘤ²Ḽ⁐ᘤQᑖ¶ᳮḄ,ᐸ"ṹßJSḄᦻÒ。᝞WØTX⚔AḼ⁐ᘤ²Ḽ⁐ᘤko¶ᳮḄ),f¹>¯,JQ⁚X⌕CDḄᦔWḄÄᵨ。13.3.1ᦔWCDᦔWQJᔠ¶ᳮ⚔AḼ⁐ᘤ²Ḽ⁐ᘤḄ᪾¾。2vᦔW,e8X⚔AḼ⁐ᘤ²Ḽ⁐ᘤk®ᩭ,xᙠ^+"ṹÒ¦◤¹ᦔWᦻ(.fx),,᪷£ᦔW"ṹ_`ᦔW1ô,ᯠxe82vᦔW1ôᢣ┐>¯ᙢᵨ⚔AḼ⁐ᘤ²Ḽ⁐ᘤ。e8ᦔWÚÄQë1⚔AḼ⁐ᘤ²Ḽ⁐ᘤnᡂFᩩḄo=Ïp。o[ᙠᦔWÒᒹõo*ᡈi*(technique),Z*23-ᒹõoᩩᡈiᩩFôÇ(renderingpass),᝞ᡠ9。techniqueT0//0{passP0//ôÇ0{…}passP1//ôÇ1{…}passPn//ôÇ11{…}>techniqueT1//1techniqueTn//ú¨ᡭ{…>QFḄᱯ}>,ᦔWe8w¿ᑴo=o*ᡈi*,^e8>¯ᙢ┐ISḄhSḄF>b。VwSḄµᓱᐹᨵSḄØ,ᵨᦔWe8wojᑡhSḄ。᝞WKᵨÑ$ᙠᨬH、ᨬḄh(ᜓ,e8ᵨᨬḄn$F。rI,IJឋتoḄh(ᜓ,e⌱àÛiḄF。FôÇÊ(ᜓG᝱、¬᪵ᘤ8O(ᡈ)ᵨJKFôÇḄḼ⁐ᘤ。ᵨiᩩôÇḄlVQ,wR)ᱯPᦔW,ZᩩôÇ◤⌕ᵨSḄFG᝱Ḽ⁐ᘤIo=|<#n$F,᝞ᙠ?0ôÇÒ¾R0^gᔠ,ᙠ?1ôÇÒἭᵨ01^gᔠ。13.3.2_`ᦔWᙠᵨᦔWåû,✌ᐜ◤⌕ᑏᦔW"ṹ,,᪷£ᦔW"ṹnᡂᦔWI^。Ḽ⁐ᘤ"ṹo᪵,e8XᦔW"ṹ&?ᙠᦻᦻÒ,·e8&?ᙠÑ"ṹḄܤTÒ,Sv,23ᵨxqw.&ḄᦔWᦻ&?ᦔW"ṹ。☢Qo=ᦔW"ṹ9。 204oooÎ13U//ᐰþLfloat4x4matWorldViewProj;//ᔠLᣚ▣Texture2DtexObj;//[ᳮI^//[ᳮ¬᪵ᘤsampler2DSampler2D*sampler_state{Texture=;MinFilter=LINEAR;MagFilter:LINEAR;MipFilter=LINEAR;AddressU=WRAP;AddressV=WRAP://⚔AḼ⁐ᘤÒÈ$᪀structVS_OUTPUT{float4Position:POSITION;float2TextureUV••TEXCOORDO?//⚔AḼ⁐ᘤᐭôᦪVS_OUTPUTVS(float4PossPOSITION,float2vTexCoord0:TEXCOORDO){//⚔AßVS_OUTPUTOut=(VS_OUTPUT)OOut.Position=mul(Pos,matWorldViewProj);//ᙶ᪗Lᣚ//z1ÒÈ[ᳮᙶ᪗Out.TextureUV=vTexCoord0;returnOut?//²Ḽ⁐ᘤᐭôᦪfloat4PS(VS_OUTPUTIn);COLORO{float4OutColor=0;,OutColor=*tex2D(Sampler2D,In.TextureUV);returnOutColor;>//techniqueTShader{passP0{VertexShader=coropilevs_2_0VS();PixelShader=compileps_2_0PS()j>>ᙠ☢Ḅ"ṹÒ,÷⚔AḼ⁐ᘤ²Ḽ⁐ᘤrᐵḄᜧ%ᑖᑁ4ᡃÐÛ៉,(9ᨵḄQ,}©o=⊤9[ᳮI^ḄᐰþL,,ᙠ[ᳮ¬᪵ᘤÒᵨK[ᳮ,ᐸÒJ=[ᳮI^◤⌕ᙠ0+"ṹÒ2vᦔWn$(。☢ÈḄᦔW"ṹ3ᓫ,¦ᨵ Ḽ⁐ᘤ<ᦔ®OOO205o*,K·¦ᨵoᩩôÇ,,wôÇ(rKḄ⚔AḼ⁐ᘤ²Ḽ⁐ᘤ。0&83010309£€[681ô⊤9ᦔW,K1ôöD)103098356£[€681ô。D3DXrKḄ03090^〖6[€6“?[00^116()ᦪ,ᵨJ^ᦔWᦻ_`ᦔWI^,KᦪḄ¯᝞。HRESULTD3DXCreateEffectFromFile(LPDIRECT3DDEVICE9pDevice,LPCTSTRpSrcFile,CONSTD3DXMACR0*pDefines,LPD3DXINCLUDEpInclude,DWORDFlags,LPD3DXEFFECTPOOLpPool,LPD3DXEFFECT*ppEffect,LPD3DXBUFFER*ppCompilationErrors);ᐸÒ:•pDeviceᢣᔣ÷_`ḄᦔWrᐵὶḄF(ᜓ。•pSrcFileᦔWᦻḄᦻÈ。•pDefinese⌱¸ᦪ,ᢣᔣo830^$ḄQ}©,ᦔWI^ᵨJQᢣ}⚜ᜐᳮvÄ,ᵨJḼ⁐ᘤḄ⚜ᜐᳮ。᝞WS◤⌕IḼ⁐ᘤn$⚜ᜐᳮ,e8XK¸ᦪ(w^^。•pIncludee⌱Ḅ1ôᢣ┐,ᢣᔣ-978^^1ô,ᵨᩭᜐᳮ#—1“6X$,᝞WS◤⌕,e8XK¸ᦪ(w>^ᓃ1•Flags᪗,qó12»Ò030᱄〔0£>᝞5ᓃ3461»0¦^()ᦪḄÛ。•pPoolᢣᔣo=10309££1^^?001I^,ᵨᩭ?ÃᐳÌḄ¸ᦪ。᝞WXK¸ᦪ(NULL,ᑣ⊤9Ôᨵ¸ᦪᐳÌ。•ppEffectᵨJ]%_`ḄᦔWI^1ô。•ppCompilationErrorsᢣᔣᒹõ┯Ḅ>?。13.3.3ÀᵨᦔÔ☢$ᔠ9Ñ571^1ᡂ£&(^,CDᵨᦔWḄp,K9ÑᵨᙠoÞ⁚ÈḄᦔW"ṹ。1.ÒHᦔÔµ@ᙠ9Ñ5ü?1ᔤ『ᓄk,ᵨ03090^ᦊ£[€60^^01#ᓄ()ᦪ᪷£ᦔWᦻ_`ᦔWI^,ᐹ#"ṹ᝞。V_RETURN(D3DXCreateEffectFromFile(g_pd3dDevice,L"SimpleEffect..fx",NULL,NULL,D3DXSHADER_DEBUG,NULL,&g_pEffect,NULL));2.2.ᦔÔQᦪᦔW¸ᦪᓽᦔW"ṹÒḄL。÷⚔AḼ⁐ᘤ²Ḽ⁐ᘤ5D,ᙠ_`ᦔWåx,·◤⌕ᙠ0+"ṹÒIᦔW¸ᦪn$*+ᓄ。2vᦔW1ô1030᱄£〖&^(ᦔW¸ᦪrIÛᓫ,K1ôojᑡ>,eᵨJ(ᒹ[ᳮᙠᑁḄᔜ*5`ḄL,ᐸÒ¡i>⊤13.3ÒᑡÈḄ>5D。9Ñ570^16££76(^(ᦔW¸ᦪḄ"ṹ᝞:g_pEffect->SetMatrix("matWorldViewProj",&mWorldV1ewPro3); 206oooÎ13Ug_pEffect->SetTexture("TextureMapping",g_pTexture);Û:ID3DXEffect^a(▭Q103098386Ä£€681ô)Ḅᐸ¦ᦔW¸ᦪ(>Ḅ*d1ê,èÅ▅ᦻ᫏。┐IZ=ᵨJ(¸ᦪḄ560>,ID3DXBasedEffec^iôRIKḄ061*>,ᵨJ;ÌwᦔW¸ᦪ(Ḅᦪò。3.;Ì,(ZᜓᵨḄᵨ)*n$Fåû,◤⌕ᵨ10309838ᡂ776“1ôḄ060^^_û()>ᡈ0€''½£687'()>,;Ìo᪗KḄD3DXHANDLE¥P。ᯠxe8&ᵨ1030᱄£€{6E460^^^û()>(ZᜓᵨḄ。ᙠ9Ñ5?16££€6^Ò,;Ì(Ḅ"ṹ᝞。D3DXHANDLEhTechmque=g__pEffect->GetTechniqueByName("TShader");g_pEffect->SetTechnique(hTechnique);4.ᵨᦔWn$Fᙠ9Ñ511^1&〖^k,ᵨᦔWFḄ"ṹ᝞。UINTnPasses;g_j>Effect->BegjLn(&nPasses,0);for(UINTiPass*0?iPassBeginPass(iPass);g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_jpd3dDevice->SetVertexDeclaration(g_pVertexDeclaration);g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2*50-2);g_pEffect->EndPass();>g_pEffect->End();☢Ḅ"ṹ✌ᐜ&ᵨ103097&EÈ0()>ÖᵨᦔW,K>Ḅ¯᝞。HRESULTBegxn(UINT*pPasses,DWORDFlags);ᐸÒ:•pPassesᵨJ]%ìûᒹõḄôÇḄᦪ•Flagsᢣ}Qᔲ&?ឮcᵫᦔWÚᦋḄG᝱(ᒹ(ᜓG᝱、¬᪵ᘤG᝱8OḼ⁐ᘤG᝱),ᐸÒÒAò0ᢣ9&?ìûG᝱,,ᙠᦔW[ᡂxMfflID3DXEffect::End()>x)ឮcJG᝱。ᐸ¦᪗OᐸÛèÅÚᦻ᫏。ÖᵨᦔWåx,e8⌲ᩩôÇn$F,ᐸÒᡠᨵF"ṹßJ1030£7ᓄ(^:8%?&§801030᱄£{ᓄ:£^(1?&88()>IåÒ,᝞☢Ḅ"ṹᡠ9。ᨬx&ᵨ10309£€[6E7'()$kᦔW。5.³ÃᦔWI^ᙠÑ⌨Èû,³Ã_`ḄᦔWI^。9Ñ510^©£7&8Ḅᐸ¦%ᑖS ᱯ◤⌕Û,ᐹ#Rd⁚è¸ὃV"ṹ。13.3.4iᦔWᙠû☢ᑮv,o=ᦔWe8ᒹõi*,☢2v9ÑMultiTeChniqueEffect^9iᦔWḄᵨ。9ÑMuUiTechniqueEffectᵨḄᦔW"ṹ᝞。 ḹ⁐ᘤ<ᦔ®ooo207float4x4matWorldViewProj;//ᔠLᣚ▣Texture2DtexObj;//[ᳮfloatgluminance;//L//[ᳮ¬᪵ᘤsampler2DSampler2Dsampler_state{TextureMinFilterLINEAR?MagFilterLINEAR;MipFilterLINEAR;AddresaUWRAP;AddressVWRAP;//⚔AḼ⁐ᘤÒÈ$᪀structVS_OUTPUT{float4Position:POSITION;float2TextureUV:TEXCOORD;/✓⚔AḼ⁐ᘤôᦪVS_OUTPUTVS(float4Pos:POSITION,float2vTexCoord:TEXCOORD){//⚔AßVS_OUTPUTOut=(VS_OUTPUT)0?Out.Position=mul(Pos,matWorldViewProj);"ᙶ᪗Lᣚ//z1ÒÈ[ᳮOut.TextureUV=vTexCoordO;returnOut;>//²Ḽ⁐ᘤᐭôᦪfloat4PS(VS_OUTPUTIn,uniformboolbBlackWhite,uniformboolbGreen):COLORO{float4OutColor-0;OutColor-tex2D(Sampler2D,In.TextureUV);if{bBlackWhite){float4lightf={0.33f,0.33f,0.33f,1.0f>;float4tempi=OutColor*lightf;floattemp2=templ.x+templ.y+templ.z;templ.xyzw=temp2;Out-Color=teroplj>elseif(bGreen){OutColor.x»0.0f;OutColor.z«0.0f;returnOutColor*g_luminance; 208oooÎ13U//techniqueNormal//µ9ì3{passP0{VertexShadercompilevs_2_0VS();PixelShadercompileps_2_0PS(false,false)techniqueBlackWhite//µ9|l{passP0{VertexShadercompilevs_2_0VS()?PixelShadercompileps20PS(true,falsetechniqueGreen//µ.9«⁐{passP0{VertexShadercompilevs_2_0VS{)?PixelShadercompileps20PS(false,true);>>☢ḄᦔWᒹõ}*:óo*8ì3>bF,óB*F³L(|l),ó}*2v¦ÒÈ7⁐Ḅ«⁐ᑖµ9w«⁐。ᔜ*Ḅᐹ#Rᙠû☢CDv,ᙠûSÙF。ᙠ9ÑMultiTechniqueEffectÒ,FḄ"ṹ᝞。//(ᦔW33D3DXMATRIXAl6mWorldViewProj=g_matWorld*g_matView*g_matProj;g_pEffect->SetMatrix("matWorldViewProj",&mWorldViewProj);g_pEffect->SetTexture("TextureMappingM,g_pTexture);g_pEffect->SetFloat("g_luminance",g_fLuminancee);//⌱àD3DXHANDLEhTechnique;if(flag==1)//ì3µ9{hTechnique=g_pEffect->GetTechniqueByName(“Normal");g_pEffect->SetTechnique(hTechnique);>elseif(flag==2)//|l{hTechnique=g_pEffect->GetTechniqueByName("BlackWhite");g_pEffect->SetTechnique(hTechnique);>elseif(flag=3)//«⁐ Ḽ⁐ᘤ<ᦔ®OOO209hTechnique=g_pEffect->GetTechniqueByName("Green");g_pEffect->SetTechnique(hTechnique);>//ᵨᦔWFUINTnPas8es;g_pBffect->Begin(&nPasses,0);for(UINTiPass=0;iPassBeginPass(iPass);g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeof(CUSTOMVERTEX));g_pd3dDevice->SetVertexDeclaration(g_pVertexDeclaration);g^pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2*50-2);g_pEffect->EndPass();>g_pEffect->End();☢Ḅ"ṹ2v᪗L^&8}ᵨ*n$F。ìᢥÏÐḄᦪÜÏ1、2、3î,ᑖµ9ì3、|l、«⁐,,2vVᜮÏᦋLḄ᦮#L。ᙠᦋLLî,ᨬᜧLᐕ¡v1.0,^e8´ᑮᱯLḄ。”3.3.5ᵨᦔW¶ᳮG᝱ᦔWᙠ0^(^30FOà+ÒḄß,ᜧ᝞13.6ᡠ9。0^830FOà+XÒᐭḄᦪ£ÃᣚwÒÈḄ²ᦪ£。Òᐭᦪ£ᩭVJU`ÿ⚔A᪀ᡂḄI^,ᡈὅᩭVJ2#N-patches、ô3〖011^}310^68_`Ḅ▤⊤☢(high-ordersurfaces)。oJÒᐭᦪ£[ᡂ╨Ò(tessdlate)(╨ÒvĦ┐I▤ᐗ),01830FOà+Xn$⚔Aᜐᳮ、ᐗᜐᳮ²ᜐᳮ,ᨬxnᡂᨬÐḄ²7⁐。Òᐭᦪ£ᦔWÒÈᦪ£113.6ᦔ®.0^^^3012MN~⚔Aᜐᳮ²ᜐᳮîe82v³}ØOà+R,·e82veÑOà+R。Òᐭᦪ£Ḅ╨Ò、ᐗᜐᳮᦪ£ḄÒÈ,ᵫOà+G᝱ᑴ。ᡠᨵJG᝱e8Ì᦮ᔠᑮo=ᦔWÒ,2vᦔW¶ᳮG᝱,ᑴOà+ḄÃÄ。ᙠû“G᝱”o%Ḅõ©3â+,⊤9ᵨJᢣ}FᩩḄᡠᨵrᐵ1ê,ᒹ8^830(ᜓG᝱、[ᳮ¬᪵ᘤG᝱8OḼ⁐ᘤG᝱¶。⌕ÅÚe8ᙠᦔWÒ(ḄG᝱Ḅ[᦮ᑡ⊤,èᢥ᯿᝞ôÇᙠ0^8950〖ᦻ᫏ÒÅÆ:DirectXGraphicsDirect3D9^JleferenceEffectReference^ffectFormatEffectState。ᙠᦻ᫏ḄK%ᑖ,È[᦮ḄᦔWG᝱ᑡ⊤,8OZ=G᝱Ḅ5`Ìò。◤⌕ᱯÛḄQ,ᙠû☢³}ØOà+Ò(ᔜ*G᝱î,3ᵨᑮoPp3,JPp3$ᨵᱯ}Ḅûq。2vᦔW(IKḄG᝱î,23ᵨrḄPp3,¦Q◤⌕yᣵûq。᝞òFG᝱030X5_?111“00£,ᙠᦔWÒIKḄG᝱Q111^(16,ᙠ³ 210oooÎ13U}ØOà+Ò(030&5310^00£FG᝱î,◤⌕ᵨ030?11^00£5`ḄPp3:D3DFILL—POINT、030ᓹ1_^»^?X14ᡈ03017[_50110。ᙠᦔWÒ(FG᝱11^<^î,ᵨḄPp3w:POINT、WIREFRAMESSOLID。ᙠ⁚û☢CD_`ᦔWI^Ḅ0309ᓚᦊ£[1^1?Í0^L0ᦪî,ᑮvKᦪḄᓄȸᦪᵨJᑴ&?ឮcG᝱Ḅ>b。᝞Wᢣ}&?ឮcG᝱,ì&ᵨÈ30£〖1^1::8^4()>î,ᦔWjkX_`o=G᝱ᙽ(stateblock),&?rᐵG᝱。&ᵨ10309£{£6E^0>$kᦔWFî,ᦔWjkX)Îឮc?ÃᙠG᝱ᙽÒḄFG᝱。W]:ᦔ®ḄJmᵨÒ#ᳮᔜf᝱。ᙠ⁚$☢Ḅ]^MᵨḄᦔ®9ṹ,ᙠTᩩÊᡃ([÷ /bḄ⚔@Ḽ⁐ᘤ<34Ḽ⁐ᘤ,¯▭àVe^texShaderᔣTexture2DtexObj;//[ᳮI^//[ᳮ¬᪵ᘤsampler2DS_2D==sampler_state{Texture=;MinFilter=LINEAR;MagFilter=LINEAR;MipFilter=LINEAR;AddressU=WRAP;AddressV=WRAP://techniqueTShader{passP0{//(⚔A⁐ᘤ²Ḽ⁐ᘤVertexShader=null;PixelShader*null;//(&Lᣚ▣WorldTransform[0]=(matWorld)//($ᐝ᯿TrᐵEFG᝱Lighting«true;NormalizeNormals=true;SpecularEnable=false;//(》óᐝ}ឋLightType[0]=Directional; Ḽ⁐ᘤ<ᦔ®ooo211LightAmbient[0]={0.5f,0.5f,0.5f.0f}LightDiffuse[0]={1.Of,1.0f,1.0f.0f>LightDirection[0]-(lightDir)LightEnable[0]=true;//(》ᩞW}ឋMaterialAmbient={1.0f,1.0f,1.0f,1.0f>MaterialDiffuse={1.0f,1.0f,l,Of,1.0f>//([ᳮ¬ᘤ8O[ᳮ▤fgᔠG᝱Sampler[0)=(S_2D);ColorArgl{0]=TEXTURE;ColorArg2[0]=DIFFUSE;ColorOpfO]=MODULATE;Alpha0p[0]=DISABLE;//(ᐸ¦rᐵG᝱fvf=XYZ|Normal|Texl;CullMode=NONE;>☢ḄᦔW"ṹ✌ᐜX⚔AḼ⁐ᘤ²Ḽ⁐ᘤ(wNULL,^-ᯠᵨ³}ØOà+F。ᯠx(ᐸ¦rᐵḄG᝱,2vG᝱ḄÈ7Oü³Sãᳮᔜ*G᝱Ḅõ©。ᵫJᜧ%ᑖ2ᳲÃÄ(᝞ᐝ᯿、ᩞW[ᳮḄ()-QᙠᦔWᦻÒ[ᡂḄ,ᡠ8ᙠKᵨÑ"ṹÒ,Rᙠ¦◤⌕_`,ÖᵨᦔW。9Ñ£%〖5〖^6ÒᵨᑮḄ÷ᦔWrᐵḄᐰþL,ᒹᦔW1ô8Oᔜ3¥P,᝞ᡠ9。LPD3DXEFFECTg_pEffect=NULL;D3DXHANDLEg_matWorldHandle«NULL:D3DXHANDLEg_texHandle=»NULLD3DXHANDLEglightDirHandle=NULL;_`ᦔWI^8O;Ì3¥PḄ"ṹ᝞,ᐸÒ3¥PᵨJᙠᓚ++"ṹÒwᦔW3(ᦪò,ᙠ8û,ᡃÐQ2v3È7ᙠ0++"ṹÒEᦔW3Ḅ。//_`ᦔWV_RETURN{D3DXCreateEffectFromFile(g_pd3dDevice,L"EffectState.fx",NULL,NULL,D3DXSHADER_DEBUG,NULL,&g_pEffect,NULL));//;ÌᦔW¸ᦪ¥Pg_matWorldHandle=*g_pEffect->GetParameterByName(0,"matWorld"};g_texHandle=g_pEffect->GetParameterByName(0,"texObj");g_lightDirHandle=g_pEffect->GetParameterByName(0,"lightDir”>?ᙠ9ÑÊ&ᢕ1Ò,ᵨᦔWFḄ"ṹ᝞,J"ṹ,Ôᨵᱯåᜐ,S◤⌕n$fiḄ³。//;Ì,(dZᜓᵨḄD3DXHANDLEhTechnique=g_pEffect->GetTechniqueByName("TShader");g_pEffect->SetTechnique(hTechnique);//(ᦔW3ᨬD3DXMATRIXA16matWorld;D3DXMatrixIdentity(&matWorld);g_pEffect->SetMatrix(g_matWorldHandle,&matWorld);//&▣ 212oooÎ13UD3DXVECTOR4lightDir;lightDir=D3DXVECTOR4(cosf(timeGetTime()/350.0f),1.0f,sinf(timeGetTime()/350.0f)•1.Of);g_pEffect->SetVector(g_lightDirHandle,&lightDir);//(óᐝ>ᔣg_pEffect->SetTexture(g_texHandle,g_pTexture);//([ᳮ//ᵨᦔWn$FUINTnPasses;g_pEffect->Begin(&nPasses,0);for(UINTiPass=0;iPassBeginPass(iPass);g_pd3dDevice->SetStreamSource(0,g_pVB,0,sizeo£(CUSTOMVERTEX));g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2*50-2);g_pEffect->EndPass();>g_pEffect->End();2v9Ñ£〖&^513&e8ÚÈ,ᵨᦔWᦻ¶ᳮᔜ*G᝱3>¯。ᵨᦔW¶ᳮG᝱Rᐹᨵ=᜜5=ÚA。o=ÚAQ,e82v^ᡭ651^4&7?1615&&(161J5=G᝱>¯ᙢᑴQᔲᵨeÑOà+,᝞e8ᙠᦔWÒ8¹5*,o*ᵨeÑOà+,=o*ᵨ³}ØOà+。=᜜o=ÚAQ,e8dîᙠᦔWᦻÒᦋLrᐵG᝱(,S⌕◤⌕@HKᵨÑ。J᪵e8┐ISḄµᓱᑏSḄᦔWᦻ,ᐙᑖᑭᵨµ9hḄØ,ᱯìÈRHḄµᓱî,e8¦ÚᦋᦔWᦻ,ᐸØTᐙᑖᑭᵨHhḄØ,Sᵨ@Hᑏ、V"ṹ。Û:8û᱐Ḅᓹ7"^950I`vo=ᵨJÏÅÚᦔWᦻḄÃᐹEffectEdit,)^0ᓄ(^950〖0(^2005᱐åx,KÃᐹSÙd50〖o®#,SvH᱐ḄDirectX$0〖WX w᪵ᜧḄ¿ᐹ------DirectXViewer。ᨵ*DirectX^61Ḅᐹgᵨ¨,:p▅ÅÆᦻ᫏。13.4Þ$»Ûᐰ☢ᙢCD÷^^6830eÑOà+rᐵḄᑁ4,ᒹ⚔AḼ⁐ᘤ、⚔A¯、²Ḽ⁐ᘤᦔW᪾¾。û᜜,»Rᑖ2vᐹ#Ḅ9Ñ^9⚔AḼ⁐ᘤ、²Ḽ⁐ᘤᦔW᪾¾Ḅᐹ#ᵨp。ᵨ⚔AḼ⁐ᘤUR07"830³}ØOà+Ḅ}*ᐝ᯿TU`,2v²Ḽ⁐ᘤRḄ³Lµ9,8^98^30Oà+ᡠSᐹᜓḄØ,ᨬxCD᝞<ᵨᦔW᪾¾¶ᳮᔜ*÷FrᐵḄG᝱,8¹UIᦔW᪾¾WḄᳮ。a!1.Úᦋ9Ñ(151^&1^&™,2v3¥P(Lᣚ▣。2.Úᦋ9Ñ1«^11«071^᝞6ᵨḄ²Ḽ⁐ᘤ,ᑖ¦ÒȲḄª、«、¬ᑖ,,e8Ñ$ᦔW。3.Úᦋ9Ñ370^&££&(^ᵨḄᦔWᦻ,8¹=᜜o*,H8¹ḄSᵨᐝ᯿ᦔW,XᨬвḄ7⁐(w¦ᩭ)[ᳮᐗ²,,ᑖᵨ5*F,e8Ñ Ḽ⁐ᘤ<ᦔ®OOO213$ᦔW。•4.ÅÚᦻ᫏,៉e8ᙠᦔW᪾¾Ò(G᝱。•5.ᵨᦻÏÃᐹÚᦋ9Ñ£7ä85^ᵨḄᦔWᦻ,½¹÷☢ᐝ᯿U`rᐵḄG᝱,z1$Ñ8e8$ᦔW。ᯠxÚᦋ[ᳮ▤fgᔠG᝱,¬ᵨSḄ7⁐gᔠ>,e8Ñ$ᦔW。 Î14UDirectXC1^80E⚣ᙠó1»ᡃÐCDv,889⌕ᒹõ}%ᑖ,ᑖQ_`ᜐᳮḄ07"890^?[^«、_`¹⚣ᜐᳮḄ0ᓄ(^ᙢ08O_`ÒᐭᜐᳮḄ0^(^1Í·。^ó2»ᑮó13,ᡃÐozᙠCD_ïᜐᳮḄ8(^^?1^5,ᙠ»o»,ᡃÐXz{ᓹ^(^ÒḄ=᜜5%ᑖ。ᐸÒ»XCD0^^^ᓄḄᑁ4,ᨵᐵ0^8᱄1Í8Ḅᑁ4Xᙠo»z{。14.1DirectX1^0DirectXᓄ70Q0^<^ÒrIÛHḄo%ᑖ, ᒹõciᢈG。wû,⁚✌ᐜ^᦮#I0789“70Ḅrᐵᑁ4n$⌕CD,8¯/ὅØTü¤I07(^(“70ᨵo=᦮#,wxyz{ᝈ}Ạ。14.1.1DirectX“70ᢈG¾᪀^0^0ᡭ¹⚣ᢈGᵫᵨJ9^360^81(^5á'¹⚣:#Ḅ?1,8OrKḄᵨJᑴÄṹ¹⚣ᑁ4ḄÃᐹ᪀ᡂ。J¹ᢈGÎwẠ,14.1µ9JᢈGåÿḄjSᐵj。:ᵫw1^360<>^440〜8O;#1[ᙠ<,,ᡠᙠᵨ089(^᱄Cᓄ80┐vO;zE⚣?@D,ᙠã☢%ᯠᨵᡠ5w。u@ᐵTḄ┐v〜4(10*8;z?@,5n p5aᢝᑁḄv᦮ឋ,ᙠ`☢ᨵD¡ᯠµWᑮ.᱄ᓃ0360/ᐵḄᑁ。᝞14.1ᡠ9,9(^᱄00^02Q0&8'70Òᨬ⌕Ḅ5%ᑖ,ᐸÒ᱄×-ᑖw᱄×01^(^Í—。9(^001QoVᵨJᑴĹ⚣ᑁ4ḄÃᐹ,XACTEngine(ᡈ*SXACTAPI)Q:#ᕒᵨḄÑ1ô,ÂÃᵨ90×001ᑴÄḄ¹⚣ᑁ4。9:ᙠ`☢Wᑮ᱄C¢LD,zᨵe5ᑖC€L001<᱄C0L£G81^,5᪷¸àᦻ59·äᐸᐹgJ。6¹⚣:#ᕒe8ᵨ9(^1ᡈ9“702(ᡈîᵨJ5*ᢈG),ÂÃᵫ¹⚣(Tᕒ_ÄḄ¹⚣。ᐹ#⌱àᵨ*ᢈG,Ì.JZᜓᙠjSE¹⚣h。90×ᑁ4ÉÎḄ1,ᐕ¡ᙠ(T»ÿᑴ¹⚣Ḅᜧ%ᑖ>☢,8ᙠjᵨ9“702n$ÃÄ。᱄7028ûḄ0ᓄ(^0¿45D,QoᝅiḄ?1,:#ᕒe8ᵨ9^1702᪀`)ÅḄ¹⚣Aw。»@ACD᝞<ᵨ901ᓄ702n$:#。 08□。0bḄ”pṹ。%^^ᙠo=½:ḄᒹᘤÒᵨWMAßOzb,,”4Ḅ/þ。IJI)8O¹,”^^3ᨵᵨ, 216oooÎ14UᙠJ*êæw´ᑮfḄ/þ,Ѧ◤DÞḄ0^^õD。2vW(ᐕ¡ᵨᡝᦋL/þ¯¹Ḅß᳛。e8ᵨ901^^~^^᝞0᝞X$$Ãᐹ,X¹⚣ᦪ£ṹw$^zb。ì᪀`?î,XACTGUIØT)ÎX¹⚣ᦻṹwxWMAzb。ᵨ/þ⚜ᐜ(,XxWMA/þKᵨᑮo=ᡈ?。14.2XACT⁚✌ᐜCD9(^Ḅᡂ8O÷årᐵḄ@⌕ᭆù,ᯠxCD᝞<ᵨ90?0。1ᑴĹ⚣ᦪ£,8O᝞<ᵨ901?1Âù⚣ᦪ£。14.2.1XACT^Hg9ᓚ×Q]wab¹⚣(Tᕒ:#ᕒḄÃᐹ,8w(¶ᳮ]Ḅ¹⚣tVo=᪾¾,ᓄ¹⚣(Tᕒ:#ᕒåÿḄᔠÄ。1.^0ÖḄᡂ9(^îSQo=ᓫ³ḄÃᐹ,·SQo*ᓫ³ḄÑᢈG,Qᵫ8rÎᔠḄ}%ᑖ᪀ᡂḄ。•XACTAPIØTX901¹⚣tVᡂnab,,rKḄ>ᵨJ¹、ÂÃᑴ¹⚣tV。:#ᕒ⌕ᵨ9(^ḄJo%ᑖn$ÃÄ。•XACTGUIwᡭᒹᵫ901?1ᵨḄ¹⚣tVo=ᓄÃᐹ。¹⚣(TᕒX⌕9ᓚḄJ%ᑖn$ÊÎ。•9(^X$$ÃᐹKÃᐹw901¹⚣ᡭᒹØX$$1ô。J=X$$Ãᐹᐕ¡(^ÌᡂnabnᡂvÑ。2.^(^ᐵᭆᵨ901◤⌕o2ᵨᢈGᭆù,ᙠû✌ᐜI9(^:#ᵨᑮḄ|=ᭆùn$CD,ᐸÒᨬ@⌕Ḅ5=ᭆùQ?¯¹?。(1)??(WaveBank)Q¹⚣(TᕒXᐸÏᑖᑮᓫ=ᦻÒḄᔠ,Q¹⚣ᦪ£ᦻ,901¿ᢝ>^¥《^5*¹⚣ᦻ。ᙠ9ᓚ×⚗pÒ,Z=?ᵫo=.〜6ᦻ⊤9。?åÿḄᐵj᝞14.2ᡠ9。9ᓚ׿ᢝ5*5`Ḅ?,ᑁ??O?。ᑁ??ßJRÎḄᑁ?Ò,J*5`Ḅ?23ᵨJÛÞḄ¹⚣tV,᝞¯¹ᦔWᡈI)¯¹。O?2vᑁ? 0¥00?^?;CW⌴ᑮ¹⚣ÒÈ,J*5`Ḅ?23ᵨJÛᜧḄ¹⚣tV,᝞ú¹。IJÛᜧḄ¹⚣tV,᝞WSᵨO? ᵨᑁ??,ᑣ◤⌕ᜧḄjkᑁ?。(2)¯¹?¯¹?(SmmdBank)Qᵫ(TᕒÏᑖḄ¯¹(Sound)9(Cue)Ḅᔠ。ᙠ9ᓚ×⚗pÒ,Z=¯¹?ᵫ᡽/Èw.-8ᓃḄᦻ⊤9。¯¹?ᦻSᒹõᦪ£;ᦪ£ßJ?Ò。¯¹?¦QAᵨ?ÒḄ,,&?᝞<ÂÃJḄ1ê。14.3Q¯¹?Ḅo=9。-J1KJ1GumCue1*HandGunFired**Handgtn*Gun2wavCue2**S*ShotGuunFired"Oun3wavCue3*GferadeLawKtieor"!"FootetepWood*14.3¯¹?1)¯¹(Sound)¯¹ßJ¯¹?Ò,ᢣ}Kì᝞<ÂÃo=ᡈi=。¯¹Rᨵᱯ}Ḅ}ឋ,᝞¹¹&。¯¹(Tᕒe8&᦮J}ឋ。¯¹ᵫo=ᡈi=îpᡂ。•îpQo_。Z=îpØTᒹõo=?1·”&^_,8O÷UᦪḄᐸ¦_。ᙠᱯ}Ḅîÿ,¯¹ḄZ=îp¦ÂÃo=。IJ◤⌕îÂÃi=Ḅ¯¹,e8_`i=îp,Z=îpᐹᨵᔜ)ḄÂÃ_。•_QᙠîpÒ᡻$ḄÎÄ。o=îpt´ᐹᨵo=_。ᨬᓫḄ_5`Q1&v^^%_,K_ØTᢥ<ᡈd!ÂÃ。ᐸ¦_ᑴᡈkÂÃḄ>b。2)9(Cue):#ᕒᵨ9Âï¹,ᨵîÂÃ9Ì7åwT#9。23ìᱯ}Ḅab_#nîÂÃ9,᝞mpÎᡈ¿]D。9ᵫo=ᡈi=¯¹᪀ᡂ,ìT#9î,e8Åᑮ÷åᐵὶḄ¯¹ᔠ。(3)ᐰþ(.ᨵ(ÌAwQᐰþḄ,JUᕡḼ8ÐSo=?ᡈ¯¹?u}ᑮo®。J(ᙠᐰþ(ᦻ(xqÈw^»)Ò}©,ᐰþ(ᦻQᙠ᪀`9×⚗pînᡂḄ。ÔᨵNO÷ᐰþ(rᐵḄᑁ4,᝞WIûÆᐶLḄ),e8ÅÚᦻ᫏。(4)%&%&QᵨJ2(ᡝ"ṹ#n)_Ḅo*!ᑴ。ìᙠ᱄ᓚ×AwÒ#no=¹⚣_ᡈÒᐭ/ÒÈ_î,9ᓚ×ᵨ%&#È1,8¯Ñn$rKḄᜐᳮ。9ᓚ×}*%&,ᐸÒᨬ3ᵨḄQ2%&(XACT_NOTIFICATlON_CALLBACK)。ìo=¹_#nî,9ᓚ×Aw&ᵨ2%&#È2。ᵨ2%&Ḅᐺ`êæQ,ìÂÃ[o=9ᡈO?ᜐᳮ[î#È2。 218oooÎ14U14.2.2ᵨC0L01ᑴmôE¹⚣(Tᕒ23ᵨ᱄<71_`90^⚗pᦻ(.xab),9”⚗pᦻᵨJ᪀`ᦪ£ᦻ。:#ᕒX¹⚣tVᡂnabÒåx,-ᯠØTᵨᑴÄÃᐹÎ᝱Úᦋ¯¹tV,Sᵨ@HabÑ。1.gaXACTGUIe8^“:+”ìᓫÖÎ90×0。1,ᐹ#ôÇQ【:+7ᡠᨵÑ11]^080"0^(^SDK(August2009)IDirectXUtilitieslMicrosoftCross-PlatformAudioCreationTool(XACT)】。^aXACTGUI51^,ᐸ☢᝞14.4ᡠ9。^W^«forks%fSetnd8ark*ᑈC^tegooei⚗0᪛%D^uftÃÄRPCPrewU0SP0»^3Pa^Ptweti14.4XACTGUI^t®2.çC(^⚗µᓫD【FilelNewPmject】ìᓫ⚗,8_`o=HḄ901⚗p。JîBCÈo=I)᪾wJ⌱à⚗pᦻḄ&?ôÇ,Òᐭ⚗pÈ7。⌱àᔠ〉ḄôÇ,ÒᐭᔠḄᦻÈ,᝞“FirstXACTProj”,ᓫD“&?”ᢥ。Jîᙠ⚗p᪛ÒBµ9H_`Ḅ⚗pÈ7。3._`?¯¹?ᓫD【Wa’veBankslNewWaveBank】ìᓫ⚗,Jîᙠ⚗p᪛Ḅ“WaveBank”⁚ABÈRH`Ḅ?,ᐸÈ7ÒAw“WaveBank”。ᯠx,ᓫD【SoundBanksINewSoundBank]ìᓫ⚗_`¯¹?。ᙠ⚗p?Ḅ“SoundBanks”⁚ABÈRH_`Ḅ¯¹?,ÒAXÈw“SoundBank”。_`?¯¹?åx,ᙠÃÄBÈRᑖᵨJÏ?¯¹?Ḅïô。ᓫD【WindowlTileHorizontally】ìᓫ⚗,Bàá᣸ᑡïô8>¯Ï,᝞14.5ᡠ9。ìᙠ⚗p᪛Ò⌱àSḄ⁚Aî,ᙠ⚗p᪛☢Bµ9rKḄ}ឋ☢r,e82v}ឋ☢rÚᦋrKḄ}ឋ。᝞14.5Òµ9ḄQᙠ⚗p᪛Ò⌱ÒH_`Ḅ?Ḅêæ,Jîe82v}ឋ☢rÚᦋ?Ḅ}ឋ。 08□᱄C1^80E⚣ooo219-L^i^UMM?jgD•'P^stX^tPfoj•-M.cro*ohCroit-PUrtormAodoCreat*ooToo^*(XACT)v3.0^Vd^9nk%<3bb^SMin9tAudibonWindowI^y<-3t^mmmmi-■■114.5H`?¯¹?9:?5`ÒAwᑁ??,wX5`ÚᦋwO?,⌱Ò}ឋ☢rÒḄ×>^6ᑖ᪾ÒḄ“Streaming”ᢥ。4.8¹ᙠ?ïôÒ,BᑡÈìûßJ?ÒḄᡠᨵ。wᔣ?Ò8¹,✌ᐜᓫD?ïô,&Kïô̾R,ᯠxᓫD[WavelInsertWaveFile(s)…】ìᓫ⚗,ᔣ?Òᐭo=ᡈi=ᦻ。·e8ᓫDᓚ…+…Ï,ᡈ~Dïô,,ᙠCÈḄìᓫÒ⌱à【InsertWaveFile(s)…】ìᓫ⚗。ᙠû,ᡃÐᔣ?Òᐭo=ᦻ“zap.wavw05.ᑴį¹9Rᙠ?Òᨵo=ᦻ。XKᦻ^?ïô»Îᑮ¯¹?ïôḄ“CueName”☢rÒ,KvÄB)Î_`o=HḄ98Oo=HḄ¯¹,,9B@1ᑮᵨJÂÃᦻḄ¯¹。tû[ᡂo=3ᓫḄ1⚗p。6.Lᡂ⚗NᓫD【FileIBuilding]ìᓫ⚗,JîBᑖnᡂᵨJ&??、¯¹?8Oᐰþ(Ḅᦻ。ᙠx☢Ḅ9ÑÒ,RBᵨᙠûnᡂḄ?¯¹?ᦻ。14.2.3᱄〇×*+ᓄᵨ^Awåû,✌ᐜ◤⌕_`o=9ᓚ×Aw,ᯠxwᐸ⌴¸ᦪᢣ}8Ḅ$w,ᐸ>᝞。1)ᵨ900<^᝞ᕷH()ᦪ_`901Aw,KᦪḄ¯᝞。HRESULTXACT3CreateEngine(DWORDdwCreationFlags, 220oooÎ14UIXACT3Engine**ppEngine)ᐸÒ:•dwCreationFlagsᢣ}_`901AwḄ᪗,e8XK¸ᦪ(w0ᡈ⊤14.1ÈḄ᪗。•ppEngineᵨJ]%_`Ḅ9ᓚ×Aw。______________________________⊤14.1^(^Aw_`᪗________________________________________________᪗___________________________________________Û____________XACT_FLAG_API_AUDmON_MODEᢣ9ÖᵨtÅXACT_FLAG_API_DEBUG_MODEᢣ9Öᵨ&tUb☢Q_`901|wḄ9"ṹ。IXACT3Engine*pXACT3Engine;V_RETURN(XACT3CreateEngine(0,&pXACT3Engine));IJ^^(10%8á',ᙠ&ᵨ9×30^16£Í7û()ᦪåû,&ᵨ0^7^1726£()ᦪ。û᜜,COMöᑣ⌕Õᙠ÷<&ᵨXACTḄ+ÑÒ&ᵨCoInitialize()ᡈCoInitializeEx()ᦪ。᝞ᡠ9。CoInitializeEx(NULL,COINIT_MULTITHREADED)?2)}©90^^^^1p£_?&^^&5$᪀5`ḄLℏ,,wᔜᡂᕒ(*+ò。<^^0^1^^_?X^^&5$᪀ᵨJᢣ}9€×AwḄ$w,ᐸ}©᝞。typedefstructXACT_RUNTIME_PARAHETERS{DWORDlookAheadTime;void*pGlobalSettingaBuffer;DWORDglobalSettingsBufferSize;DWORDglobalSettingsFlags;DWORDglobalSettingsAllocAttributes;XACT_FILEIO_CALLBACKSfileIOCallbacks;XACT_NOTIFXCATION_CALLBACKfnNotificationCallback?PWSTRpRendererID;IXAudio2*pXAudio2;lXAudio2MasteringVoice*pMasteringVoice;>XACT_RUNTIME_PARAMETERS,*LPXACT_RUNTIME_PARAMETERS;ᐸÒ:•lookAheadTimeᢣ}ì}ᔣ=᜜o=¯¹vî9ᓚ×Awᔣû/i«îÿ,ᓫßw。23ᵨÒAòXACTJENGINE_LOOKAHEAD_DEFAULT。•pGlobalSettingsBufferᢣᔣᐰþᦻᦪ£,KᦻQnᡂ᱄0^⚗pînᡂḄ^88ᦻ,Kᦻ&?ᐰþ(1ê。᝞WSᵨᐰþ(,e8XK¸ᦪ(wNULL。•globalSettingsBufferSizeᢣ}ᓹ0106&186«1ᔴ88^{6[ᢣᔣḄᦪ£>?ḄᜧÞ。•globalSettingsAllocAttributesᢣ}90^᝞<ᜐᳮᐰþ(ᦪ£Ḅ᪗。e8XK¸ᦪ(wOᡈXACT_FLAG_ENGINEoCREATE_MANAGEDATA(K᪗ᢣ9ì[ᡂ*+ᓄîKì³Ã001¦3'《7ᔴ88óᢣᔣḄ>?)。•fileIOCallbacksᦻ1/0%&0 0ᓄ800(C“10E⚣ooo221•fnNotificationCallback2%&。•pRendererIDᢣᔣ9×Kìë1ᑮḄ¹⚣F(ᜓḄ⑴。*pXAudio2ᢣᔣ9×AwᵨḄ190(17021ô,᝞WXK¸ᦪ(wNULL,ᑣ9ᐭᓚ×AwX)Î_`o=90(1102I^。•pMasteringVoiceᢣᔣIXAudio2MasteringVoice1ôḄᢣ┐,⊤99×AwᵨḄ¯¹。᝞WXpXAudi02ᡂᕒ(wNULL,ᑣKᡂᕒw>0;1^。¯¹ḄᭆùXᙠo⁚ÒCD。᝞WS◤⌕I9ᓚ×AwḄ$wn$fiḄᑴ,e8XK$᪀Ḅᔜᡂᕒ-(w0,8ᵨÒA(,᝞ᡠ9。XACT__RUNTIME_PARAMETERSEngineParameters*{0}?3)&ᵨ190×3£%7¹::1&^1()>,,ᵨ901_X1^1^h_?X^×£¦5$᪀5`ḄLÄw¸ᦪ,ᢣ}90^AwḄ$w。V_RETURN(pXACT3Engine->Initialize(&EngineParameters));14.2.4ᵨ^〇×Âï¹☢$ᔠ9Ñ901838ᓃCDᵨ90×Âï¹Ḅp。1.*+ᓄ^(^*+ᓄ90^Ḅᐹ#>,ᙠ☢n$*dCD。ᙠ90×838ᓄ9ÑÒ*+ᓄ901Ḅ"ṹ᝞。//*+ᓄ0(^?V_RETURN{CoInitializeEx(NULL,COINIT_MULTITHREADED));//_`8(^AwV_RETURN(XACT3CreateEngine(XACT_FLAG_API_DEBUG_MODE,&g__pXACT3Engine));»//*+ᓄ9¿01XACT_RUNTIME_PARAMETERSxrParams={0>;xrParams.lookAheadTime*XACT_ENGINE__LOOKAHEAD_DEFAULT?V_RETURN(g_pXACT3Engme->Initialize(&xrParams));2._`?I^1ᩭ◤⌕_`?¯¹?,9Ñ9(^^Hᓄ¦_`o=?o=¯¹?。ᙠ▭ḄabÑÒ,23◤⌕_`i=?i=¯¹?,^e8f¹4᧕ᙢISḄ¯¹n$ᜐᳮ。☢✌ᐜøà?Ḅ_`,Vw9Ñ90×8&8ᓄᵨḄQᑁ??,ᡠ8&ᵨIXACT3Engine::0^16^^07^768í)>_`?,K>Ḅ¯᝞。HRESULTCreateInMemoryWaveBank(constvoid*pvBuffer,DWORDdwSize,DWORDdwFlags,DWORDdwAllocAtt.ribut.es,IXACT3WaveBank**ppWaveBankᐸÒ: 222oooÎ14U•pvBufferᢣᔣᵨwç§2Ḅᦪ¸。•dwSizeᵨwç§2Ḅᦪ¸Ḅᜧ。•dwFlagsᢣ9᝞<_`?Ḅ᪗,e8XK¸ᦪ(w0ᡈ^_?10_ENGINE_CREATE_MANAGEDATA(K᪗ᢣ9ì³Ã?ᦪ£î³ÃpvBufferᢣᔣḄ>?)。•dwAllocAttributes?v86[¸ᦪᢣᔣḄ>?Ḅ}ឋ。\^^0^8á'µᶍK¸ᦪ。•ppWaveBankᵨ±çḄ§2ᢣ┐。9à☢Ḅ ᡃ(+⍝,ç§2D◤⌕WX/bḄᦪ¸5ᦪ¸ᜧ(Â⁚ᦪ),ᙠ`☢çôED◤⌕WX/bḄᦪ¸.ᦪ¸ᜧ。9jᦪ¸9C01ᦻhËᑮḄ,⌕ᨵO¨᱄C¢LᦻhÊᦪ¸。ᨬjᵨḄ¨ᵨ6&01Á16()Àᦪ=ᦻhᑁᑮZ[Ê,©᜜¨ÿᵨᑁ[᧜ᦻh,ᵨMapView0fFile()Àᦪ=ᦻh1᧜ᑮÿᵨzḄᙢᙬÆ1。ᙠᜧeᦪᎥ§,᝞®ÛØᙢᙬÆ1¬¶ᜧ,ᵨᑁ[᧜ᦻhd0µÕ。◤⌕TáḄ,ᨵᙠÿᵨ ®€L3£ᔴ1^ᑩy00ᑗᔯ¨('¨µᐵ=᱄ᓚL±,ÿ.#/ᐵὶḄ²c),ᡈὅ§2/ôE"ᦈᑮC0^>^01^^^710^^?£SOUNDBANKDESTROYEDᡈXACTNOTIFICATIONTYPE•WAVEBANKDJBSTROYED9+#`,»ðõᐰᙢÿnç§2<ôEWXḄᦪ¸,4nþÿôED◤⌕ᵨᦪ¸。R᜜,᝞®[÷ XACT_FLAGJENGINE_CREATE_MANAGEDATA᪗´6zᨵᵨᑁ[ᦻh᧜¨,?A├µ§2/ôEDCᓚLµ=ÿᦻhZ[。9Ñ908&87(:ᵨᙠ14.2.2Þ⁚nᡂḄ?ᦻ^^Bank•Xwb_`?,"ṹ᝞。//;Ì?ᦻᜧÞhFile=CreateFile(L"WaveBank.xwb",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);if(hFxle==INVALID_HANDLE_VALUE)returnE_FAIL;dwF1leS12e=GetFileSize(hFile,NULL);1f(dwF1leS1ze==-1){CloseHandle(hFile);returnE_FAIL;}//;ÌᵨJ_`?Ḅᦪ£hMapFile*CreateFileMapping(hFile,NULL,PAGE_READONLY,0,dwFileSize,NULL);if(hMapFile==NULL)returnE_FAIL;g_pbWaveBank=MapViewOfFile(hMapFile,FILE_MAP_READ,0,0,0);if(g_pbWaveBank==NULL){CloseHandle(hMapFile);CloseHandle(hFile);returnE_FAIL;>//_`?I^ 08□00(C1](^0E⚣ooo223if(FAILED(g_pXACT3Engine->CreateInMemoryWaveBank(g_pbWaveBank,dwFileSize,0,0,&g_pWaveBank))){CloseHandle(hMapFile);CloseHandle(hFile);returnE_FAIL;>☢Ḅ"ṹ✌ᐜ;Ì?ᦻḄᜧÞ,ᯠxᵨᑁ?᧜]ᦻḄ>;ÌᵨJ_`?Ḅᦪ£,ᨬx_`?。3._`¯¹?I^&ᵨ8013£H::€^ᦊ50ï18&¦()>_`¯¹?,K>ᵨJ_`?Ḅ>5D,ᡠ8SÙ*dCD。9Ñᵨᙠ14.2.2Þ⁚nᡂḄ¯¹?ᦻ5<^“Bank.xsba`¯¹?,"ṹ᝞。//;̯¹?ᦻᜧÞ,"ṹᶍ///̯¹?ᦻᑁ4g_pbSoundBank=newBYTE[dwFileSize];if(g_pbSoundBank==NULL){CloseHandle(hFile);returnE_FAIL;>if(ReadFile(hFile,g_pbSoundBank,dwFileSize,&dwBytesRead,NULL)==false){CloseHandle(hFile);«returnE_FAIL;>//_`¯¹?I^if(FAILED(g_pXACT3Engine->CreateSoundBank(g_pbSoundBank•dwFileSize,0,0,&g_pSoundBank)));{CloseHandle(hFile);returnE—FAIL;>4.b@,&?9(Cue)@A¯¹?ÒḄ9(Cue)Q2v@AAᵨḄ。ᵨ8(^35008183û:0610^11^()>,e8ᵨf¹ḄÈ7ÅÆ9Ḅ@A。9ḄÈ7Qo=ᦻܤT,ìᵨ90^0。1᪀`9î,(Tᕒe8w9ᢣ}o=È7。.9Ñ<^^38&b@,&?9Ḅ"ṹ᝞。g_iCue=g_pSoundBank->GetCueIndex("zapM);J᪵,ᙠx☢e8z1ᵨ§_ᑍ1^Ò&?Ḅ9@IÂÃ9。9Ñ90^3&8ᓄX8ZpvÄᒹᑮo=)}©Ḅ1&1901()ᦪÒ。5.üL2᪷£◤⌕,e8üL÷UᦪḄ2。9Ñ9(^8᝘ᓄÔᨵᵨ2。ᙠx☢CDÂÃO?î,ÙCDüL2Ḅᐹ#>。 224oooÎ14U6.Âï¹ᙠ◤⌕î&ᵨ80350¿(18ᢕ^o0>ÂÃ9,K>Ḅ¯᝞。HRESULTPlay(XACTINDEXnCueIndex,DWORDdwFlags,XACTTIMEtimeOffset,IXACT3Cue**ppCue)ᐸÒ:•nCueIndex9Ḅ@A。•dwFlagsÂÃ᪗,K¸ᦪÔᨵᵨ,◤Xᐸ(w0。•timeOffsetÂÃß.ã:+AḄîÿâò,ᓫßw。•PPCueᵨJ]o=9ᢣ┐,ᙠ8xe8ᵨKᢣ┐f9ḄG᝱。9Ñ18&8^ᙠᢥzÏîÂï¹,"ṹ᝞。g_pSoundBank->Play(g_iCue,0,0,NULL);7.ᜐᳮ2ᙠ2%&Òᜐᳮ1ᦈᑮḄ2。9Ñ9(^^HᓄÔᨵüL2,·Ôᨵ(2%&。ᙠo=9ÑÒBCD᝞<ᜐᳮ2。8.᡻$᱄(^Awᡠ◤⌕Ḅᕜ»ឋÃÄᙠab+úÒ,ᕜ»ឋᙢ&ᵨ8(^3£ᔴ11^0(^00>,9ᓚ×᡻$@HÈRḄᑁ%÷z。&ᵨ^^^()>Ḅ⚣᳛⌕T⚣,ᔲᑣSØOîᙢ¶ᳮrᐵtV,PQ'v⚣·B/0ÑḄឋØ。ᙠabÑÒ,F[Zx&ᵨoSK>,23e8Ì´ÛḄá⊝。990183᝞ᙠÑḄÔîÿ&ᵨ00%0(),"ṹ᝞。if(g_pXACT3Engine)g_pXACT3Engane->DoWork();Sleep(10);9.ᐵy9(^Aw、³Ã?¯¹?ᦪ£ìSÙ◤⌕Âù⚣ᦪ£î,ᐵy᱄01Aw,ᯠx³Ã?¯¹?ᦪ£。9ÑXJÃÄÊᑮ)}©Ḅᓚ⑷¿ô9ᓚÍᦪÒ,᝞ᡠ9。voidCleanupXACT(){if(g_pXACT3Engine){g_pXACT3Engine->ShutDown();g_pXACT3Engme->Release();>SAFE_DELETE_ARRAY(g_pbSoundBank);xf(g_pbWaveBank){UnxnapVxewOfFile(g_pbWaveBank);g_pbWaveBank-NULL;> 0᝞00(Cᓄ80E⚣ooo225CoUninitialize();>14.2.5ᵨ᱄0aO©¢-23,X?ᢣ}wßJᑁ?Òfo,VwÂÃᩭ)ᑁ?ÒḄ¯¹äSBVw¶Êw。PQᙠᨵêæJQSeØḄ,ᱯQìᦻᜧ,ᑁ?tVᨵ▲î。ᙠJêæ,¹⚣(Tᕒe8X?ᢣ}wO?,᝞IJú¹,23(wO?。1.®¯§°OQᙠᓽXᵨᦪ£î^?;Ý#(᝞£^0、qÐ)z1/Ìᦪ£ḄvÑ。VwS◤⌕oSឋᙢ/Ì᦮=ᦻ,ᡠ8ᵨOe8⁚ḕᑁ?。PQ᪷£?;Ý#Ḅ/̤,ᙠ⌕Õ/Ìᦪ£▭/Ìᦪ£åÿeØBᨵÛ«îÿḄw,Kw7åwÅÆîÿ。ÅÆîÿ(latency)Q⌕Õ/Ìᦪ£óoSÅᑮ¯¹åÿḄîÿÿ◞。ì^?;CW/̹⚣ᦪ£î,Vw(ᜓ◤⌕áâîÿ}ß//ᑏ:+ßᡠᜐḄᡧ,ᡠ8ÅÆîÿeØBÛ«。ÅÆîÿeØBÂÃO¯¹îÈRw,ᙠ/ÌÛ᠒ḄqÐî,᝞WSØTTüᙢwxy¯¹iᐙ¹⚣ÒÈᦪ£,stB⌼ᡂÂÃÒe。w.ÅÆîÿ⌼ᡂḄE⚪,e8ᵨÄÅÆîÿO(Zero-LatencyStreaming),ᨵî7åwiO(primedstreaming)。2vᵨÄÅÆîÿO,abÑe8ᵨÛᜧḄ、WḄ?。ᵨÄÅÆîÿOî,IJZ=O?,᱄(^ᑖojᑡᑁ?>?,J>?ᦻÞi。901✌ᐜXᦻ:ᜮḄoÞ%ᑖ¹ᑮᑁ?Ò,ᒕ¤%ᑖ-ᯠßJ?;CW。oÂÃ:+,ìÔî901XöyᦻÒḄxy%ᑖ¹ᑮᑁ?>?Ò。᝞W>?ᜧÞÛᔠ〉,?;Ý#ḄwîÿSBÒeÂÃ。2.±è°ªḄM¦²³wᵨO?,✌ᐜᙠ901001ÃᐹÒX?Ḅ“Streaming”}ឋ(wÈ^。o¹⚣(Tᕒ_`O?,:#ᕒe8_`O?I^。☢$ᔠ9Ñ9ᐭ0^5ḄÇ_CDÂÃO¯¹Ḅp01)*+ᓄ9^VwÂÃO¯¹◤⌕ᜐᳮ9(^2_,ᡠ8ᙠ*+ᓄ99×î◤⌕(2%&ᦪ,᝞ᡠ9。XACT_RUNTIME_PARAMETERSxrParams={0};xrParams.lookAheadTime=XACTMMENGINE••LOOKAHEAD»~DEFAULT;9xrParams.fnNotificationCallback=XACTNotificationCallback;//(2%&V_RETURN(g_pXACT3Engine->Initialize(&xrParams));ᙠ☢Ḅ"ṹÒ9(^^0¦70ᑍ&1»^1Qo=ᵨJᜐᳮ9012_Ḅ)}©ᦪ。◀◤⌕(2%&ᦪ8᜜,9Ñ90^31^1^ÍÒḄ᱄(^*+ᓄ%ᑖ901335µr。2)_`O?I^。✌ᐜᡭ:O?ᦻ,ᯠx*+ᓄo=XACTJSTREAMWG-?PQ£a£5᪀?¥,ᨬRSᵨIXACT3Engine:••0^3165-301〜3d683()>$UC¢?I^,"ṹ᝞。g_hStreamingWaveBankFile=CreateFile(L"WaveBank.xwbM,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED|FILE_FLAG_NO_BUFFERING,NULL); 226oooÎ14Uif(g_hStreamingWaveBankFile==INVALID_HANDLE_VALUE)returnE_FAIL;XACT_WAVEBANK_STREAMING_PARAMETERSwsPararos;ZeroMemory(&wsParams,Sizeof(XACT_WAVEBANK_STREAMING_PARAMETERS));wsParams.file=g_hStreamingWaveBankFile;wsParams.offset=0;•wsParams.packetSize=64;V_RETURN(g_pXACT3Engine->CreateStreamingWaveBank(&wsParams,&g_pStreamingWaveBank));3)_`¯¹?I^。ᐹ#>p÷9Ñ90^^&8ᓄr。4);Ì,&?9@A。99018H&r。5)üL2。✌ᐜ◤⌕}©o=XACT_NOTIFICATION_DESCRIPTION5`Ḅ$᪀L,K$᪀ᵨJ}©2Ḅᔜ*d⁚,⌕Q}©2Ḅ5`(17?6ᡂᕒ)。9(^20*2 5`,ᵫrKḄ᪗¤⊤9。2 5`᪗¤OᐸÛḄ*dᑡ⊤,èxÚᦻ᫏。9ÑXACTStreamingüL5=2,᝞ᡠ9。//üL?Zᜓ[2XACT_NOTIFICATION_DESCRIPTIONdesc={0>;desc.flags=XACT_FLAG_NOTIFICATION_PERSIST;desc.type=XACTNOTIFICATXONTYPE_WAVEBANKPREPARED;g_pXACT3Engine->RegisterNotification(&desc);//üL9ÂÃ[2.desc.flags=XACT_FLAG_NOTIFICATION_PERSIST;desc.type=XACTNOTIFICATIONTYPE_CUESTOP;desc.cueIndex=XACTINDEX_INVALID;g_pXACT3Engine->RegisterNotification(&desc);2v2 5`᪗¤SãÈ2ḄÄᵨ,᝞☢üLḄóo=2,⊤9?Zᜓ[。ì9ᓚ×AwZᜓ?îB#ÈK2,KᵨÑᙠ1ᦈᑮK2xe8n$rKḄvÄ,᝞ÂÃ9。óB=2,⊤99ÂÃ[,ì᱄ᓚ×ÂÃ[9îB#ÈK2。6)ᜐᳮ2。2Qᙠ2%&ᦪÒn$ᜐᳮḄ。9ÑXACTStreamingᜐᳮ2Ḅ"ṹ᝞。voidWINAPIXACTNotificationCallback(constXACT_NOTIFICATION*pNotification){if(pNotification->type~=XACTNOTIFICATIONTYPE_WAVEBANKPREPARED&&pNotification->waveBank.pWaveBank==g_pStreamingWaveBank)if(pNotification->type==XACTNOTIFICATIONTYPE_CUESTOP&&pNotification->cue.cueIndex==g_iCue) DirectXC1^80E⚣ooo227EnterCriticalSection(&g_cs);g_bHandleSongStopped=true;LeaveCriticalSection(&g_cs);☢Ḅ"ṹᙠ1ᦈᑮSḄ2x,2vrKḄ᪗L᪗1ᦈᑮ2。Vw2%&ᦪQᙠSḄ+ÑÒ᡻$Ḅ,ᡠ8ᙠI᪗LØòîᵨßI^(CRITICAL_SECTION)8&ᢝ+Ñp。7)Âï¹。᝞WSᐵÅÆîÿ,Öe8z1&ᵨ80^50D^83¸:?^()>gÃ9,ÂÃᑁ?ÒḄ¯¹Ôᨵ。9Ñ^1^01Íᙠ1ᦈᑮO?Zᜓ[2åx,ᓽ:+ÂÃ9。ìÂÃ$kx,2vᜐᳮÂÃ$k2_@H^ᜮ:+ÂÃ9,^+úSeᙢÂï¹。"ṹ᝞。EnterCriticalSection(&g_cs);boolbHandleStreamingWaveBankPrepared=g_bHandleStreamingWaveBankPrepared;boolbHandleSongStopped=g_bHandleSongStopped;LeaveCriticalSection(&g_cs)?//ZᜓO?åx,✌SÂï¹if(bHandleStreamingWaveBankPrepared){EnterCriticalSection(&g_cs);g_bHandleStreamingWaveBankPrepared=false;LeaveCriticalSection(&g_cs);g_pSoundBank->Play(g_iCue,0,0,NULL);>//ÂÃ$kî,@HÂÃif(bHandleSongStopped){EnterCriticalSection(&g_cs>;g_bHandleSongStopped=false;LeaveCriticalSection(&g_cs);g_pSoundBank->Play(g_iCue,0,0rNULL);>9:F"ṹ2ᜐᳮ"ṹrÎᔠ,ᐳ[ᡂ2ḄᜐᳮÃÄ。üUᑖ᪆ᐸ᡻$vÑ。8)᡻$901Awᡠ◤⌕Ḅᕜ»ឋÃÄ。9Ñ᱄018&8ᓄ5D,ᙠû·◤⌕ᕜ»ឋᙢ&ᵨ8013£Í^::0(^0ᕤ)>,901᡻$@HÈRḄᑁ%÷z。]^MC07^Ḅ3æ8G=àþÿôEḄ9ṹ<ÿᵨ1᱄C(^3£G]^::0(^0ᕎ0¨Ḅ"ṹÊᑮ)}©Ḅᖹ33&10()ᦪÒ,,ᙠ_ê+úḄÔîÿ&ᵨKᦪ。9)ᐵy9ᓚ×Aw、³ÃrᐵI^。voidCleanupXACT(){if(g_pXACT3Engine){g_pXACT3Engine->ShutDown(); 228oooÎ14Ug_pXACT3Engine->Release();>if(g_hStreamingWaveBankFilei-INVALID_HANDLE_VALUE&&g_hStreamingWaveBankFile1=NULL)CloseHandle(g_hStreamingWaveBankFile);SAFE_DELETE_ARRAY(g_pbSoundBank);DeleteCriticalSection(&g_cs);CoUninitialize();>9Ñ90150^3^^ÍḄᐸ¦Rd⁚,èxÚV"ṹ。3.·¸¹D1~ᙠû☢ᡃÐᑮv,w.^?;CW/̹⚣ᦪ£⌼ᡂḄwE⚪,e8¬ᵨÄÅÆîÿOᢈG。☢@ACDᵨÄÅÆîÿO◤⌕Ḅw᜜vÄ。1)Zᜓ9。ᙠZᜓ?åx,SQᓽÂÃ9,Q✌ᐜ&ᵨ190^350¿(18&1^£30>⚜>?¯¹,wn$ÂÃ÷Zᜓ,K>Ḅ¯᝞。HRESULTPrepare(XACTINDEXnCueIndex,DWORDdwFlags,XACTTIMEtimeOffset,IXACT3Cue**ppCue)ᐸÒ:•nCueIndex⌕n$ZᜓḄ9Ḅ@A。•dwFlagsK¸ᦪÔᨵᵨ,◤Xᐸ(w0。•timeOffset⚜>?ß.ã9:+AḄîÿâò,ᓫßw。•PPCueᵨJ]%o=ᢣᔣ190130^I^Ḅᢣ┐,ᙠx☢◤⌕ᵨKᢣ┐ÂÃ9。2)¶Ê。&ᵨ8(^350¿(^3^:LÍ3"0>n$⚜>?◤⌕ofîÿ,ᙠJfîÿÒe8n$ᐸ¦ÃÄ。᝞WKᵨÑ◤⌕⍝<îZᜓ[,o*>Q&ᵨ19(^30û::0615【316()>bÅQᔲZᜓ,fḄ>QüL,ᜐᳮ᱄(^^0×11^Ð0>^v?£o01£?X£?&£02。o9¸Zᜓ,8äSBLwèZᜓG᝱。ZᜓḄ>'•?XozßJᑁ?Ò,zᑮ³Ã9。3)ÂÃ9。9Zᜓåx,&ᵨ80730^¦7()>ÂÃ9。W]:ᨵW]ᜐw£ᙠãᜓᡈREãᜓḄf᝱,»ðÿᵨ1C0130^^::?1&70¨;᝞®£ᙠþÿᡈὅREþÿvº,ᑿÿᵨÁ37()¨µᜫᦝ。9Ñ90^26『013168^30^&0^%^9᝞<ᵨÄÅÆîÿOÂï¹。K9Ñᙠ1ᦈᑮ?ZᜓḄ2x,Zᜓ9。9Zᜓåx,e8ᢥzÏn$ÂÃ。ÂÃ$kx,B@HZᜓ9。w¯J^9,ᙠZᜓ9åûᐜ¶Ê},,2vᙠïôµ9ᦻÛìûᡠᜐḄG᝱。ᐸ¦Rd⁚è¸ὃV"ṹ。 0^0C“80E⚣OOO22914.2.6"ṹÉÎḄ9〇×ᓹ7CD901⌕Qo=ᑁ4ÉÎḄjk。JUᕡḼᑁ4_ÄὅᵨÃᐹ_`Bnᑴᑁ4,ᯠx:#ᕒᵨ9ᓚ×1ᑁ4ÉÎᦪX_`Ḅᑁ4ᡂnab。XACT?1ᑁ4ÉÎᦪ,ᵨJÙ901¹ÂÃᵨ90101;1_`Ḅᑁ4。ᙠ14.2.314.2.45Þ⁚ÒCDḄQ᝞<ᵨᑁ4ÉÎḄ?1ᦪX90^ᡂnabÑ。◀ᑁ4ÉÎḄ901?1ᦪå᜜,9(71?1Roᝅ"ṹÉÎᦪ,ᵨñᡂÂÃᵨ9ᓚ×_`Ḅᑁ4。"ṹÉÎḄᦪwab:#ᕒf£ᜧḄØ,e8ᙠabÑÒvÄᑴ¹⚣ᑁ4,^e8wqÐO8Oᦪ£u}¶÷zᵨ9ᓚ×。"ṹÉÎḄ?1ᦪ·e8^cᩖḄ¹⚣zb。᱄0×?1"ṹÉÎḄᦪ,wÂù⚣ᦪ£Û4᧕ᵨḄ>。¹⚣ᦻe8ßJ?Ò,·e8ᓫᙢᵨ.〜3〃ᦻ。DirectX50〖9Ñ᱄01(^^01^^^9"ṹÉÎḄ᱄01?1Ḅᵨ,K9ÑÛ4᧕ᳮ,ᙠûSviᙢ³,ÆᐶLḄ/ὅe8ᑖ᪆ᐸV"ṹ。ᙠ»9ÑᒹÒ,·9010^^04¥᝞9Ñ,,Iᐸn$᦮ᳮᓄ。◤⌕ᢣÈḄQ,¶9ᓚ×᪀`JiḄ¹⚣:Awå,PQ8SØ"/iḄ:¹⚣Aw。᝞W◤⌕ᙠfiḄ¶ᳮ¹⚣ᦪ£,Kìᵨ9“702z1E¹⚣AwḄØ。14.3XAudio2⁚✌ᐜCD÷“〗02rᐵḄ@⌕ᭆù,8OtVÊᣚᦻzb(WFF)。ᯠxCD᝞<*+ᓄ9¦02,᝞<ᵨ'702¹Âù⚣ᦪ£。14.3.1᱄702CD9'702QoᝅiḄ、ᵨJ^8^^8᱄&0360Ḅá'¹⚣?1。88Ḅû¡(DirectSound*XAudio)5D,wabo=1ᜐᳮgᔠẠ。Iñ〜ᓄ᝞o8ab:#ᕒ,9ᓄ702Q07"(^0^^Ḅ/"ᱥ。IJ᱄^360:#ᕒ,8Q8û9^70?1Ḅ¹£᱐。1.᱄1^702ᐵÏᭆùᵨ9“702:#åû,◤⌕|=÷årᐵḄᭆù,Jᭆùᒹõᵨ9“102n$:#ᡠḄẠ 。(1)᱄702AwN^7021ôQ᱄ᙢ02AwḄ᪶。2vAᙢ021ô,e8PpØTᵨḄ¹⚣(ᜓ、ᐰþ?1}ឋ、_`├¯¹8OfឋØ。(2)¯¹(Voices)¯¹Q9ᓄ702ᵨJᜐᳮ、vÄ8OÂù⚣ᦪ£ḄI^。ᙠ9^^02Ò,ᨵ}*¯¹。•V¯¹(SourceVoices)V¯¹⊤9o=¹⚣O。V¯¹X8ÐḄᦪ£#〈ᑮᐸ¦5`Ḅ¯¹。•gᔠ¯¹(SubmixVoices)gᔠ¯¹I8Ð1ᦈᑮḄ¹⚣ᦪ£n$ovÄ,᝞¬᪵⚣᳛Ãᣚ。ᙠgᔠ¯¹Iᦪ 230oooÎ14U£n$ᜐᳮåx,Xᦪ£⌴ᑮ=o=gᔠ¯¹ᡈ¯¹。•¯¹(MasteringVoices)¯¹1ᦈᩭ)V¯¹ᡈgᔠ¯¹Ḅᦪ£,,X1ᦈᑮḄᦪ£#〈ᑮ¹⚣h。(3)¹⚣Oà+(AudioGraph)¹⚣Oà+Q9ᓄ102¯¹ᔠ。¹⚣ᵫßJ¹⚣Oà+oḄV¯¹:+,e⌱àᙢ2vÄ=ᡈi=gᔠ¯¹,,ᨬÐ#〈ᑮo=¯¹,᝞14.6ᡠ9。¹⚣Oà+;Ìojᑡ¹⚣OÄwÒᐭ,I8Ðn$ᜐᳮ,,XᨬÐ$W⌴ᑮ¹⚣h。ᡠᨵ¹⚣ᜐᳮ#nᙠäḄ+ÑÒ。ᨬᓫḄ¹⚣Oà+z1XV¯¹ÒÈᑮ¯¹。14.6¹⚣ᜐᳮOà+ìÑ$î,e8Î᝱ᙢᑴ¹⚣ᜐᳮOà+ḄG᝱,ᒹ8¹、ᑤ◀ÒᐭÒÈ,ᦋLᑁ%ᦔW@1,wᦔW(¸ᦪ,ÖÎOà+ÒḄ%ᑖᜐᳮ▤f,¶¶。(4)%&᱄0È02Aw·%&!ᑴ,ᵨJ2ᙠ¹⚣ᜐᳮ+ÑÒ#nḄᱯ}_。Vwᙠ᱄00^02AwÒ¹⚣ÂÃQ´pḄ,ᡠ8%&ᵨJ}<ÂÃ[Ḅo>。ìo=%&ᦪ$î,9&702SØnᡂ÷<¹⚣,ᡠ8ᙠ%&ᦪÒS⌕ᒹõÖὑîḄvÄ,8ä⌼ᡂ¹⚣ÂÃÒe。*2.tVÊᣚᦻzbtVÊᣚzb(RIFF)Q^3¥ᦻᵨḄ¹⚣zb,8Q9ᓄ102ᵨḄᐺ`¹⚣zb。‘RIFF’,ᦻᜧÞ,ᦻ5`,ᦪ£(1)?01[X€^᪗¤X》^ᦻᵫi=ãᦣḄ,7åwᙽḄᦪ£%ᑖ᪀ᡂ,ᙽÒᦪ£Ḅ5`ᵨFOURCC(four-charactercode,Zܤṹ)᪗¤n$Û。þ0。X(^᪗¤QᵫZ=ë1ᙠo®Ḅ5011ܤ_`Ḅ32ßN¤᦮ᦪ。᝞,FOURCC^U^m‘abcd’ᙠ11¦-ᓺ@0jkÒQ0x64636261。¹⚣ᦻᵨ?01&0(:᪗¤᪗¹⚣zbᙽ、¹⚣ᦪ£ᙽ8Oᐸ¦ᱯ}J¹⚣zbḄᙽ。⊤14.2ᑡÈᙠ9ᓄ102¿ᢝḄ¹⚣zbÒᵨḄ?0^X0:᪗¤。⊤14.2ᔜ*¹⚣zbᵨḄ「0ô¹00᪗¤___________¹zb_______________?00&0(:᪗¤PCM*RIFF‘fmt’、‘data’XMA2*REFF4fmt*,‘data,、‘seek,ADPCM*RIFF‘fmt,、‘data’、‘smpl’、‘wsmpl’xWMA*RIFF*fmt,、*data’、*dpds*ᐸÒ‘RIFF’、‘fmt’、‘data’Qᔜ*¹⚣zbᐳᵨḄ?(^^(^᪗¤,⊤14.3ÈJ?01^0^᪗¤Ḅ⌕Û。(2)ᙽX^^ᦻᒹõo=??ᙽ,&»^ᙽᒹõÄ=ᡈi=ᐸ¦ᙽ。 08「600(C^10E⚣ooo231X《^ᙽᵫZ%ᑖ᪀ᡂ,ᐸzb᝞:________________________⊤14.3ᐳᵨḄFOURCC᪗¤⌕Û__________________________᪗89____________________________________"#____________________________________________᪗ãᑿᓽᙽḄ$4Â⁚ᒹᦻh=>,¦ẖᙽḄᒕ¾¹ᑖᒹᦻhÊḄᐸóᙽfmtᒹE⚣ᦻhḄ56ᜮ。ᙽÊḄᦪ¸.᪀/vb:WAVEFORMATEX、WAVEFORMATEXTENSIBLE、ADPCMWAVEFORMAT、XMA2WAVEFORMATEXdataᒹE⚣ᦻhḄE⚣ᦪ¸。ᙠC0^02Ê,ᦪ¸ᙽḄᑁ=ᐭZ[Ê,mnC0102_81;¿ ᪀=>ḄᓹC0À(^^3ᦪ⌴#ôEᐸÒ,óo%ᑖQ^^^…᪗¤‘R1FF’,óB%ᑖQ4Ü⁚ᦪò,ᢣ}ᦻÒᦪ£ḄᜧÞ,ó}%ᑖQᢣ}ᦻ5`Ḅô(^0;€(:᪗¤,óZ%ᑖᒹõᐸ¦ᙽ。ᐸÒᦻᜧÞQᢣó}%ᑖóZ%ᑖᡠᓰᵨḄÿ,Sᒹõóo%ᑖóB%ᑖHᓰᵨḄÿ。ᐸ¦ᙽᵫ}%ᑖ᪀ᡂ,ᐸzb᝞:ᙽ10,ᙽᜧÞ,ᦪ£ᐸÒ,óo%ᑖQo=᪗ᙽÒᒹõᦪ£Ḅ"^^0:᪗¤;óB%ᑖQo=4Ü⁚ᦪò,ÈᙽÒᦪ£%ᑖḄᜧÞ,ó}%ᑖQÄ=ᡈi=Ü⁚Ḅᦪ£。ᦪ£ÙQÌigᑮᨬḄW0RD&5。óB%ᑖÈḄQᙽÒᨵᦔᦪ£ḄᜧÞ,SᒹõwI#〜0X0¼ iᐙḄ%ᑖ,·SᒹõᙽÒû5%ᑖHᓰᵨḄÿ。14.3.2“702*+ᓄᵨ9ᓄ102Âï¹åû,✌ᐜ◤⌕n$o*+ᓄvÄ,ᒹ_`XAUdi02Aw、_`o=¯¹。1._`9“702Awe8ᵨ᱄^020ᢓ6()ᦪ_`9—02AwḄo=,KᦪḄ¯᝞。HRESULTXAudio2Create(IXAudio2**ppXAudio2,UINT32Flags*0,XAUDI02-PR0CESS0RXAudio2Processor=«XAUDI02_DEFAULT_PR0CESS0R)ᐸÒ:•ppXAudio2ᵨJ]%_`Ḅ9^702I^。•Flagsᢣ}9“702I^$wḄ᪗,e8XK¸ᦪ(w0ᡈ910102_0£8。0_ENGINE(K᪗⊤9ᵨ&t᱐Ḅ90(1702?)。•XAudio2Processorᢣ9ᵨ=0^,23Käᢣ}ᜐᳮᘤ,ᵨÒAò。ᙠ>¥7^0¥8á',(^1ᦪ€01¦7377260ᡈ(^0᝞᝞1126£ᙠ9o7020^^〖60åû&ᵨ。COMöᑣSᐕ¡XKᦪ&ᵨXAudio2C^eate()ᔠ,ᙠo®。û᜜,001öᑣ⌕Õᙠ&ᵨ9702Ḅ÷<+Ñ&ᵨ00107᝞1726()ᡈ(^¹᝞1726£()。e8ᙠo=nÑÒiS_`XAUdi02。Z=9“702I^rÎäᙢn$vÄ,,ᨵᐸ)ÅḄ¹⚣ᜐᳮ+Ñ:¦ᨵ&t(QᐳÌḄ。¶ᙠo=ÑÒe8_`i=9“702AwI^,PQSKᙠ8Ðᔜ)Ḅ¹⚣ᜐᳮOà+åÿ⌴1ê。☢Q_`᱄ᓄ102AwḄo=9。 232oooÎ14UCoInitializeEx(NULL,COINIT_MULTITHREADED)?IXAudio2*pXAudio2=NULL;V_RETURN(XAudio2Create(&g_pXAudio2,XAUDI02_DEBUG_ENGINE));2._`¯¹I^¯¹Ê¹⚣(ᜓ,,Q2v¹⚣Oà+Ḅᡠᨵ¹⚣ᦪ£ḄᨬÐpḄᙢ。e8ᵨ8^1702:[ᖾ^î0^0^0>_`,o=¯¹,K>Ḅ¯᝞。HRESULTCreateMasteringVoo.ee(IXAudio2Ma8teringVoice**ppMasteringVoice,UINT32InputChannels=XAUDI02_DEFAULT_CHANNELSfUINT32InputSampleRate=XAUDI02_DEFAULT_SAHPLERATE,UINT32Flags=0,UINT32DeviceIndex-0,constXAUDI02_EFFECT_CHAIN*pEffectChain*NULL)ᐸÒ:•IXAudio2MasteringVoiceᵨJ]%_`Ḅ¯¹。•InputChannels¯¹»ḄÒᐭ¹⚣ᡠᐹᨵḄ2⍝ᦪ,K¸ᦪÌòÞJ¶JXAUDI02_MAX_AUDI0_CHANNELS。e8XK¸ᦪ(w9Í102_DEFAULT_CHANNELS,ᵨᵫìûá'}ḄÒAò。•InputSampleRate¯¹Òᐭᦪ£Ḅ¬᪵⚣᳛。¬᪵⚣᳛Q900102_QUANTUM_DENOMINATOR^^^fg,,CJ᱄00102_^^—5«^£_X×£XAUDI02_MAX_SAMPLE_RATEåÿ。e8XK¸ᦪ(w9110102_0?ô[×_SAMPLERATE,ᵨᵫìûá'}ḄÒAò。•Flagsᢣ}¯¹$wḄ᪗,(w0。•DevicelndexÒÈ(ᜓ@A,᝞W(w0,ᑣᵨᐰþÒA¹⚣(ᜓ。•pEffectChainᢣᔣᦔW@Ḅᢣ┐,᝞WSᵨᦔW,e8Xᐸ(w>01[ᓃ。☢Q_`¯¹I^Ḅo=9。IXAudio2MastermgVoice*pMasterVoice=NULL;V_RETURN(hr=pXAudio2->CreateMastermgVoice(&pMasterVoice,XAUDI02—•DEFAULTM—CHANNELS,,XAUDI02__DEFAULT_SAMPLERATE,0,0,NULL))?ᙠ☢Ḅ"ṹÒ,X0〜7^181^¸ᦪ(wÒAò0,^9ᓄ702X¯¹ᐵὶᑮÒA¹⚣(ᜓ。·e82vPpeᵨḄ¹⚣(ᜓ}(ᜓ@Aò,,᪷£KᵨÑḄᱯ}öᑣ⌱ào=(ᜓ。ᐵJPp¹⚣(ᜓḄᑁ4ÈḄ,ÆᐶLḄ/ὅe8Å▅ᦻ᫏。"14.3.3Àᵨ^(^02>Yª⚣ᦪEÞ⁚CDᵨ90È02¹¹⚣ᦪ£Ḅp。8p¹¹⚣ᦻÒḄ“fmt”“data”ᙽ,,ᵨ8Ð*+ᓄ“WAVEFORMATEXTENSIBLE”“XAUDI02_BUFFER”$᪀。(1.᪆¹⚣ᦻ᱄&102¿ᢝḄ¹⚣ᦻᵨtVÊᣚzb(RIFF)。✌ᐜÅÆᑿ??ᙽ,ᯠxᔊᙽ,8ÅÆᙠX《^ᙽÒᒹõḄᓫäᙽ、¹Xì?ᦻÒḄ¹⚣ᦪ£。 0^。0^á'_`Ḅ¹⚣ᦻᵨJ᱄^360á'î,ᙠ$î◤⌕Êᣚᐰ%ᡈ%ᑖᦪ£ḄÜ⁚<,ᡈὅᙠ$åûIÜ⁚<n$ᜐᳮ。☢QÅÆç^ᦻÒᙽḄ9ᦪ。#ifdef_XBOX//Big-Endian#definefourccRIFF'RIFF'#definefourccDATA'data'#definefourccFMT'fmt•#definefourccWAVE,WAVE•#definefourccXWMA'XWMA'#definefourccDPDS,dpds•#endif#ifndef_XBOX//Little-Endian#definefourccRIFF'FFIR'#definefourccDATA•atad'#definefourccFMT,tmf*#definefourccWAVE*EVAW'#definefourccXWMA'AMWX*#definefourccDPDS•sdpd.#endifHRESULTFindChunk(HANDLEhFile,DWORDfourcc,DWORD&dwChunkSize,DWORD&dwChunkDataPosition)HRESULThr*S_OK;if(INVALID_SET_FILE_POINTER=SetFilePointer(hFile,0,NULL(FILE—BEGIN))returnHRESULT_FROM_WIN32(GetLastError())?DWORDdwChunkType;DWORDdwChunkDataSize;DWORDdwRIFFDataSize=DWORDdwFileType;DWORDbytesRead=0;DWORDdwOffset*0;while(hr*=S_OK)DWORDdwRead;if(0==ReadFile(hFile,&dwChunkType,sizeof(DWORD)f&dwRead,NULL))hr=HRESULT_FROM_WIN32(GetLastError())?if(0==ReadFile(hFile,&dwChunkDataSizesizeof(DWORD),&dwRead,NULL))hr=HRESULT_FROM_WIN32(GetLastError());©[D10¸È᝞8ᵯ-£᝞0ᩭ)ᵫᐕ£᝞05^1ᑏḄÞÛ《zᑭ¤aµ》,1726È᱐。ᙠJÞÛÒ,ᜫ_Ḅ§Oὅ,zᑭ¤,o=Þ¨Ḅ¨©ªᑮo®,KÞ¨ᑖw5«:o«Q8$᳝1^81^,¦Ð^ᜧḄoᡭ:¦ÐḄ¬®(mḄ®),=o«Q^¿-^&,¦Ð^ÞḄoᡭ:¦ÐḄ¬®。ᙠû⊤9ᙠhá'Ò?;ᦪ£î¬ᵨḄÜ⁚<。 234oooÎ14Uswitch(dwChunkType)dwOffset+=sizeof(DWORD)*2;if(dwChunkType==fourcc){dwChunkSize=dwChunkDataSize;dwChunkDataPosition=dwOffset;returnS_OK;>dwOffset+=dwChunkDataSize;if(bytesRead>=dWRIFFDataSize)returnS_FALSE;>returnS_OK;>2)}ßᙽåx/ÌᙽÒḄᦪ£。oÆᑮ»Ḅᙽ,e8Xᦻᢣ┐&᦮ᑮᙽḄᦪ£%ᑖ:+ᜐ,/ÌᙽÒḄᦪ£。☢Q^ᙽÒ/Ìᦪ£Ḅo=9ᦪ。HRESULTReadChunkData(HANDLEhFile,void*buffer,DWORDbuffersize,DWORDbufferoffset}{HRESULThr=Smm»OK?9if(INVALID_SET_FILE_POINTER==SetFiXePointer(hFile,bufferoffset,NULL,FILE_BEGIN))returnHRESULT_FROM_WIN32(GetLastError());DWORDdwRead;if<0==ReadFile(hFile,buffer,buffersizer&dwRead,NULL))hr=HRESULT_FROM_WIN32(GetLastError());returnhr;>2.ᵨ□「「ᙽḄᑁ4iᐙ~^02$᪀9ᓄ7⑵wÂÃV¯¹ÒḄ¹⚣,◤⌕o=〜¥£?€^^^0^9$᪀(ᡈὅQfᜧḄ$᪀,᝞WAVEFORMATEXTENSIBLE,K$᪀ᒹõ’¥£?0X1×Ä9$᪀)o=XAUDI02_BUFFER^^。 08「8。1᱄C1^80E⚣ooo235ᙠ☢Ḅ9Ò,ᵨḄQ%9£?(^^^0^0^᝘181^$᪀,^e8¹iJ5=2⍝Ḅ?0"¹⚣ᦻ。☢Ḅp^9ᵨû☢óFḄØiᐙo=WAVEFORMATEXTENSIBLE$᪀o=900102_8^^?£X$᪀。ᙠJ*êæ,¹Ḅ¹⚣ᦻᒹõḄ?01ᦪ£,¦ᒹõo=“RIFF”、“fmt”“data”ᙽ。ᐸ¦zbeØᒹõᐸ¦5`Ḅᙽ。1)¯WAVEF0RMATEXTENSIBLE$᪀XAUDI02_BUFFER$᪀ḄLWAVEFORMATEXTENSIBLEwfx={0>;XAUDI02_BUFFERbuffer={0>;2)ᵨ&63&116()ᦪᡭ:¹⚣ᦻ。HANDLEhFile-CreateFile(BtrFileName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL)?lf(INVALID_HANDLE_VALUE==hFlle)returnHRESULT_FROM_WIN32(GetLastError());lf(INVALID_SET_FILE_POINTER==SetFllePointer(hFlle,0,NULL,FILE_BEGIN))returnHRESULT_FROM_WIN32(GetLastError());3)¹¹⚣ᦻÒḄ“RIFF”ᙽ,,bxᦻ5`。DWORDdwChunkSize;DWORDdwChunkPosition;DWORDfiletype;FindChunk(hFile,fourccRIFF,dwChunkSize,dwChunkPosition);ReadChunkData(hFile,&filetype,sizeof(DWORD),dwChunkPosition);if(filetype1=fourccWAVE)returnSMWFALSE;W4)}ß“fmt”ᙽ,Xᐸᑁ4cᑴᑮ¥9Ä?0X^^0^^518[£$᪀Ò。FindChunk(hFile,fourccFMT,dwChunkSize,dwChunkPosition);ReadChunkData(hFile,&wfx,dwChunkSize,dwChunkPosition);5)}ß“data”ᙽ,Xᐸᑁ4/Ìᑮ>?Ò。FindChunk(hFile,fourccDATA,dwChunkSize,dwChunkPosition);BYTE*pDataBuffer=newBYTE[dwChunkSize];ReadChunkData(hFile,pDataBuffer,dwChunkSize,dwChunkPosition);6)iᐙXAUDI02—BUFFERᙽ。buffer.AudioBytes=dwChunkSize;buffer.pAudioData=pDataBuffer;buffer.Flags=XAUDI02_END_0F_STREAM?14.3.4Àᵨ^1^102±èª*+ᓄXAud102,¹¹⚣ᦪ£åx,e82v_`o=V¯¹,wᐸ⌴¹⚣ᦪ£ᩭÂï¹。☢$ᔠ9ÑXAUdi02BaSiCCDᵨXAudi02Âï¹Ḅp。1)*+ᓄ9^02Aw。9Ñ9^02638ᓄX*+ᓄvÄÊᑮ)}©Ḅ1¦^02()ᦪÒ,"ṹ᝞。CoInitializeEx(NULL,COINIT_MULTITHREADED);V_RETURN(XAudlo2Create(&g_pXAudio2,XAUDI02_DEBUG_ENGINE));V_RETURN(g_pXAudio2->CreateMa8tenngVoice(&g_pMaateringVoice)); 236oooÎ14U2)iᐙ^9£?0X^×£99。0102_3。£X$᪀。wiᐙJ5=$᪀,✌ᐜ◤⌕ᵨ9&102^¹⚣ᦻ¹ᦪ£,ᐹ#>ᙠoÞ⁚n$CD。9Ñ9^^^^ᙬᵨ090×Ḅ€〜&?L5(K5Ḅ}©Rᑖßñ50〖^?ü1^50&〜&711(^ᦻÒ)[ᡂᦪ£¹ÃÄ。//ᡭ?§2ᦻhCWaveFilewav;V_RETURN(wav.Open(s2F1lename,NULL,WAVEFILE_READ));WAVEFORMATEX*pwfx=wav.GetFormat();"§2ᦻh56DWORDcbWaveSize=wav.GetSize();//§2ᦪ¸ᜧ//=§2ᦪ¸ᑮᑁ[BYTE*pbWaveData=newBYTE[cbWaveSize];if(FAILED(hr=wav.Read(pbWaveData,cbWaveSize,&cbWaveSize))){SAFE_DELETE_ARRAY(pbWaveData);returnhr;>//i^^XAUDI02_BUFFER^^XAUDI02_BUFFERbuffer={0};buffer.pAudioData=pbWaveData;buffer.Aud10Bytes=cbWaveSize;900102_811^X$᪀ḄᡂᕒÛi,Svᙠ☢Ḅ"ṹÒ¦(K$᪀Ḅ?^00⊈ᡂᕒ,Kᡂᕒ&?¹⚣ᦪ£。ᐸ¦ᡂᕒḄÄᵨÌòêæèÅÚᦻ᫏。W]:ᙠᵨC¸?0^^£᪀Ḅᙢ,᪷¸E⚣ᦪᣮḄ56,:ð◤⌕ÕᜧḄᒹ〜C£Â0^^L£᪀Ḅ᪀。3)_`V¯¹。&ᵨ190È02::(^^1650⇧。690&()>_`V¯¹,9ÑÈ02888ᓄ_`V¯¹Ḅ"ṹ᝞。IXAudio2SourceVoice*pS0urceV01ce;if(FAILED(hr=pXaudio2->CreateSourceVoice(&pSourceVoice,pwfx))){SAFE_DELETE_ARRAY(pbWaveData);returnhr;>8^02::0&0G^0^()>oᐳᨵ7=¸ᦪ,ᙠûwû5=¸ᦪᦪò,ᐸ¦¸ᦪ¬ᵨÒAò。⌕K>Ḅ¯8Oᐸ¦¸ᦪḄÒAò,eÅÚᦻ᫏。4)ᔣV¯¹Êo=XAUDI02_BUFFER$᪀。ᵨ19ᓄ70250806¥0706::5Ô0^5001^8ᓄ【6『()>ᔣV¯¹Êo=1^102_BUFFER^^,"ṹ᝞。if(FAILED(hr=pS0urceV0ice->Subm1tS0urceBuffer(&buffer))){pS0urceV01ce->Destr0yV01ce();SAFE_DELETE_ARRAY(pbWaveData);returnhr;> 06£Cᓄ80E⚣OOO2375)Âï¹。&ᵨ1ᓄ70250^^%&:Ô&"()>:+Âï¹。ᙠ9Ñ᱄702338ᓄÒ,ᙠ&ᵨ88"()>åx,2v&ᵨ81E!>0ᦪ¯+Ñ,^¯¹ØTöyÂÃ,zᑮ¯¹ÂÃ[。¯¹ÂÃ[x,³ÃV¯¹I^¹⚣ᦪ£,"ṹ᝞。//:+ÂÃhr=pSourceVoice->Start(0);//w¯¹öyÂÃ,zᑮÂÃ[BOOLi8Running=TRUE;while(SUCCEEDED(hr)&&isRunning){XAUDI02^^VOICEMBSTATEState;pSourceVoice->GetState(&state);isRunning=(state.BuffersQueued>0)1=0;Sleep(10);>pSourceVoice->DestroyVoice();SAFE_DELETE_ARRAY(pbWaveData);ÒAêæ,9^1102X8ÐḄÒÈ#〈ᑮ¯¹,ᩭ)V¯¹Ḅ¹⚣B)ÎÌ#〈ᑮ*+ᓄî⌱àḄ¹⚣h。ᙠf¹cᩖḄ¹⚣Oà+Ò,V¯¹eØ◤⌕ᢣ}ᐸÒÈXÌ⌴ᑮ=¯¹。6)├¯¹I^、³Ã9^02Aw。if(g_pMasteringVoice1=NULL)g_pMasteringVoice->DestroyVoice();SAFE_RELEASE(g_pXAudxo2);CoUninitialize();ᨵᐵ9Ñ^'028384Ḅ[᦮Rd⁚,èÅÚᐸV"ṹ。û᜜,9Ñ9ᓄ102838&—SឋᙢX¹⚣ᦪ£¹ᑮᑁ?Ò。᪵,IJÛᜧḄ¹⚣J*>◤⌕ᜧḄᑁ?。w⁚ḕᑁ?,9'!02·e82vOÂÃÛᜧḄ¹⚣ᦻ。ᵨ9'702ÂÃO¹⚣Ûᓫ,ᜧ%ᑖcᩖḄÃÄᵫᦻjk9ᓄ102_`[ᡂ。ᦻjkᙠx'¹ᦪ£,90(1102¶ᳮ¹⚣h,&1ᦈáLḄᦪ£O。▲J©,ᙠûIJ%ᑖᑁ4Sn$fiḄCD,ÆᐶLḄ/ὅe8ᑖ᪆8X8950NḄ9Ñ9^0838&51ᕸ0^14.4pûᙠab:#Ò,¯¹ᦔWgᩭgᑮ@f。»CD0©Ḅ1᱄¹⚣:#ᢈGÒ5=ᨬḄᑁ4:XACT^0XAudio2。IJý2ḄKᵨ,ᵨ90^[ᐰe8g◤⌕。᝞W᪀`)ÅḄ¹⚣Aw,ᑣ◤⌕ᵨ90È02。»CDḄᑁ4RÛẠ,¡iḄ¹⚣ÑᢈGRèNO,᝞30^09ᓹ0。a!l•ᵨXACTGUIᑴÄo=ᑁ??¯¹?,üU?、¯¹?8O9ḄÈ7。Úᦋ9Ñ90^3&,8ÂÃ)ÅᑴÄḄ¹⚣ᦪ£。2.ᵨ᱄(^0。1,Ï☢_`Ḅ?¹⚣?,&?、¯¹?9ḄÈ7S 238oooÎ14UL,PQᦋL?Ḅᑁ4。ᯠxᵨHnᡂḄ?¯¹?ᦻ/ᣚ{1ÒḄᦻ,z1$Ñ,ᑖ᪆ᦔW。3.ᵨ901ᑴÄo=O?¯¹?,Úᦋ9Ñ90^Ḅ&08ÂÃ)ÅᑴÄḄ¹⚣ᦪ£。4.ᑖ᪆0᱄1×Ḅ0o&961ᓄ5ḄV"ṹ。 Î15U□ᓄ⑶G⑴.Ü×7uᙠó2»ÒCD^032?1ÑẠî`ᑮv,”4(1(^8Q_êÉÎḄvÄjk。ìᵨᡝᵨÏÐÑ᪗n$vÄî,ÑB1ᦈᑮᔜ*ÏÐÑ᪗_ê。PQÏÐÑ᪗_êSQz1⌴KᵨÑ,QÃ#%\^^0>^jk,ᨬx”ᓄ(10~5jk%&KᵨÑḄïôvÑIᔜ*_ên$ᜐᳮ。IJý2ḄKᵨÑ,¬ᵨJ*>be8ÃÄ´,PQIJឋØ⌕ÕḄabÑ,J*>bã8;´ᳮUḄ᡻$ᦔ᳛,wû9:]0181ÍDᵨJᜐᳮᔜ*(ᜓḄÒᐭ。0^81Í8Qoᝅ]ᵨJᜐᳮ(ᜓÒḄ?1,JÒᐭ(ᜓᒹÏÐ、Ñ᪗、abᩚ、ᐸ¦abᑴ(ᜓ8OÔI✄(ᜓ¶。£^^11Í8z1÷hÉÎÑ21,^e8ÛüᙢᜐᳮᵨᡝḄÒᐭ。ᵫJ07"8^^8z1hÉÎÑn$21,ᡠ8ᙠᑴ☢rIÏÐÑ᪗n$Ḅ÷<(,-SBI881Í8on÷&g_pDI,NULL));15.1.2PpÒᐭ(ᜓ᝞WZᜓᵨjkÏÐÑ᪗,ᑣe8µᶍKp。w}jkÒᨵÒᐭ(ᜓeᵨ,e8ᵨ10181ÍD8::£《1^6ᓄ680>PpÒᐭ(ᜓ,K>Ḅ¯᝞。HRESULTEnumDevices(DWORDdwDevType,LPDIENUMDEVICESCALLBACKlpCallback,LPVOIDpvRef,DWORDdwFlags)ᐸÒ:•dwDevType(ᜓ5᪗,ᢣ}Pp5`ḄÒᐭ(ᜓ,e(w8᪗:■DI8DEVCLASS_ALLᡠᨵ(ᜓ■DI8DEVCLASS_DEVICES}Jᐸ¦5Ḅᡠᨵ(ᜓ■DI8DEVCLASS_GAMECTRLᡠᨵabᑴᘤ■DI8DEVCLASS_KEYBOARDᡠᨵÏÐ(ᜓ■DI8DEVCLASS_POINTERᡠᨵÑ᪗efᢣ┐(ᜓ•lpCallback%&ᦪ。•pvRef⌴%&ᦪḄ¸ᦪ•dwFlagsᢣ}PpḄ᪗,23(w0ì0?1^^^0^00>0[^,⊤9¦Ppëᑮjk,ïḄ(ᜓ。Pp(ᜓḄᐵÏQ%&ᦪ,jkBwZ=PpᑮḄ(ᜓ&ᵨ%&ᦪoS,^e8û!BIPpᑮḄZ=(ᜓn$rKḄᜐᳮ。K%&ᦪḄl`᝞。BOOLDIEnumDevicesCallback(LPCDIDEVICEINSTANCElpddl,LPVOIDpvRef 8□A⑴.Ü×7uooo241ᐸÒ:•lpddióF(ᜓḄ0«^910£1᝘×?^£$᪀,K$᪀Ḅ8。411^^᝞6ᡂᕒ(ᜓḄᐰþo᪗¤(GUID),ᐸ¦ᡂᕒèÅÚᦻ᫏。•pvRefKᵨÑ2vEnumDevlces()>ḄpvRef¸ᦪ⌴Ḅò。ᙠ»15.3⁚CDabᩚÒᐭᜐᳮî,BnopCD᝞wᔜ*Òᐭ(ᜓ_`0781Íñ(ᜓI^,K>Ḅ¯᝞。HRESULTCreateDevice(REFGUIDrguid,LPDIRECTINPUTDEVICE*lplpDirectlnputDevice,LPUNKNOWNpUnkOuter)ᐸÒ:•rguidᡠ⌕_`ḄÒᐭ(ᜓḄ0。10,KGmDQ2vIDirectInput81ôḄ£!^^1(^0>b@ᑮḄ。IñÒAḄjkÏÐÑ᪗,e8XK¸ᦪᑖ(wGUID_SysKeyboardSGUID_SysMouse。•lplpDirectInputDeviceᵨJ]%_`Ḅ⑶᝞Í8(ᜓI^。•pUnkOuter23(wNULL,⊤9_`Ḅ1ôI^QZᔠ1ô。☢QwÒAḄjkÏÐ_`8^^^^ñ(ᜓI^Ḅ9"ṹ。LPDIRECTINPUTDEVICE8pDIDeviceV_RETURN(g_pDI->CreateDevice(GUID_SysKeyboard,&pDIDevice,NULL));15.1.42.2ᜓµ@_`0181Í8(ᜓI^åx,ᙠᵨ(ᜓI^;ÌÒᐭᦪ£åû,R((ᜓI^Ḅ)&ᦪ£zb,ᙠᨵêæ,R◤⌕((ᜓI^Ḅ}ឋ。1.2.□Ø·^2ᜓḄº»6¼)&ᵨJᢣ9ìûKᵨÑ᝞<ᐸ¦KᵨÑ8O~44(^8jkᐳÌ0«^11ÍD(ᜓI^。e82v18D11Íñ1^^81ôḄ5v(^^¹^1^£)>()&,K>Ḅ¯᝞。HRESULTSetCooperativeLevel(HWNDhwnd,DWORDdwFlags)ᐸÒ:•hwnd÷(ᜓI^rᐵὶḄïôḄ¥P,KïôQᨵᦔḄ⚔ïô。•dwFlagsᢣ})&Ḅ᪗,q⊤15.1。)&ᒹ5=>☢:oQïôᜐJRÎG᝱ᡈRÎG᝱îQᔲe8ᵨ(ᜓ,BQ8äᓰ>bRQäᓰ>bᵨ(ᜓ。ᙠ()&ᑩî,î◤⌕J5=>☢。ᡠ8e8X)&=y(wDISCL_EXCLUSIVEIDISCL-FOREGROUND(ÒA()、DISCL_NONEXCLUSIVEIDISCL_FOREGROUNDSlDISCL_EXCLUSIVEIDISCL_FOREGROUND,PQSØ(wDISCL_EXCLUSIVEIDISCL_BACKGROUND。 242oooÎ15U⊤151)&____________VS᪗W____________________"#DISCL_BACKGROUNDᓽXU@Y½XU,Õ Z[SᐭiᜓḄᦪ¡DISCL_EXCLUSIVEᓰSᐭiᜓDISCL__FOREGROUND]ᨵXᜐ5Y½^᝱±,`yZ[SᐭiᜓḄᦪ¡DISCL_NONEXCLUSIVE`ᓰSᐭiᜓDISCL_NOWINKEYἭᵨ^b0%10m,cdᵨᡝ°Ḅe¹᝞W¸ᨵo=(ᜓI^Ḅ)&Ì(w0150^_£€1^519£,ᑣXᐸ¦(ᜓI^(wK)&Bᜫ}。SvÙQe8X(ᜓḄ)&(w“äᓰ”。IJÏÐ(ᜓ,Re8(w0Ù0^^0>¥《^v10150^^^^90^^1¥£,,IJäᓰUbÙQἭᵨ”440¥810@0Ï。☢Q()&Ḅ9"ṹ。g_pDIDevice->SetCooperativeLevel(hwnd,DISCL_NONEXCLUSIVE|DISCL_BACKGROUND)2.(ô^᝞Í…(ᜓḄᦪ£zbᦪ£zbᢣ}ᵨÒᐭ(ᜓḄᦪ£,,ᢣ}ᦪ£Ḅ?;zb。e8ᵨ10181Í806vD8.:5610313?0[0^()>(07<^1Í8(ᜓI^Ḅᦪ£zb,K>Ḅ¯᝞。HRESULTSetDataFormat(LPCDIDATAFORMATlpdf)¸ᦪlpcifᢣᔣóFᦪ£zbḄDIDATAFORMAT$᪀。IJ᪗ZḄÒᐭ(ᜓ,◤⌕()}©Ḅᦪ£zb;IJÏÐ、Ñ᪗abᩚ,e8z1ᵨ07^81ÍñḄ5=ᐰþLc_dfDIKeyboard,c_dfDIMouse,c_dfDIMouse2,。_61101】0>^1。ß<。_(1¡1<10h8Çß2ᢣäᦪ¸zb。᝞☢Ḅ"ṹ(ÏÐ(ᜓḄᦪ£zb。g_pDIDevice->SetDataFormat(&c_dfDIKeyboard);3.(ô7□᝞Í⑴(ᜓḄ}ឋ8^8ᓄ?P(ᜓḄ}ឋᒹᦪ£>?ḄᜧÞ,^o=å]%ᦪ£Ḅ,åᦪ£QrIḄRQWIḄ,8OabᩚåḄÙ。ᱯ}Ḅ(ᜓeØRᨵᐸ¦}ឋ。ᙠ☢ᵨ07"81ÍDḄ5=ᐰþL(ᦪ£zbî,·(0^81Í8(ᜓI^ḄÒA}ឋ。wÚᦋ0ᓄ81Í8(ᜓ}ឋ,e8ᵨ10781Í8069D8::5611(^"70>,K>Ḅ¯᝞。HRESULTSetProperty(REFGUIDrguidProp,LPCDIPROPHEADERpdiph)ᐸÒ:•rguidPropᢣ}Zᜓ(Ḅ}ឋḄ080,⊤15.2ᑡÈ|=3ᵨḄ᪗¤,[᦮ᑡ⊤èÅÚᦻ᫏。•pdiphᢣᔣ?;(ᜓ}ឋḄ$᪀。◤⌕üUḄQ,IJSḄ01^£^1Í8(ᜓ}ឋ,eØ◤⌕ᵨSḄ$᪀?;(ᜓ}ឋò。ᡠᨵJ$᪀Ḅóo=ᡂᕒL᤬-Q01?X0?^1£0£X5`,᝞ᵨJ(DIPROP_BUFFERSIZEDIPROP_AXISMODE¶}ឋḄDIPROPDWORD$᪀,ᐸ}©᝞。 8^⑶Gÿ.Ü×7uooo243⊤15.2jᵨḄᡷ⑶G⑴[ᜓឋ᪗,î᪗¤ÛDIPROP_BUFFERSIZE(ᦪ£>?ḄᜧÞDIPROP_AXISMODE(åᦪ£ḄUb:QrIUbRQWIUbDIPROP_DEADZONE(》abᩚḄÙDIPROP_RANGE(ᦪòḄtypedefstructDIPROPDWORDDIPROPDWORD,*LPDIPROPDWORD;typedefstructDIPROPHEADER{DWORDdwSize;DWORDdwHeaderSize;DWORDdwObj?DWORDdwHow;>DIPROPHEADER,*LPDIPROPHEADER;ᐸÒ:•dwSizeᒹõKᜮ%$᪀Ḅ᦮=$᪀ḄᜧÞ。•dwHeaderSize。²᝘ᓹLᓹX$᪀ḄᜧÞ。•dwObj}ឋI^,KᡂᕒḄÌòᵫ(1o¦0¥ᡂᕒ.}。•dwHowᢣ}᝞<³(1ñ0^ᡂᕒ,Kᡂᕒe8(w0^0£¥10、DIPH—BYOFFSET、DIPH_BYUSAGE*DIPH_BYID。᝞W(w0«^_09ù£,ᑣ<1〜0¥ᡂᕒ(w0。Ä:ìQVw?;07"(^1Í8(ᜓ}ឋḄS$᪀Ḅóo=ᡂ8-QL?1^,DIPROPHEADER^᪀ḄÎᡂᕒ᦮=$᪀Ḅᜧ,ᡠ»:ᵨSetProperty()*¨(ᵫS$᪀?;Ḅô^ᢕÍ8(ᜓ}ឋ。☢Ḅ"ṹ(0781Í·Ñ᪗(ᜓᵨ>?/Ìᦪ£。sizeof(DIPROPDWORD);sizeof(DIPROPHEADER);DIPROP_BUFFERSIZE,&dipdw.diph)Ä:ô7^Í8}ឋḄ(,%&ᙠᦪᣮ56[÷#`、ᙠ[ᜓḄ«ᩗ#$z。15.1.5c`½ᐭ2ᜓḄᩗ(0&±Í8(ᜓåx,ᙠᵨ0ᓄD1Í᝞(ᜓ/ÌÒᐭᦪ£åû,R◤⌕&ᵨ18"(^1Íñ06?^8::09ᓄ60>;Ì(ᜓḄEᩗ,K>Ḅ¯᝞。HRESULTAcquire() 244000Î15U᝞WK>&ᵨᡂ,ᑣ]%òw01_0〖。15.2Hᐭᜐᳮ⁚$ᔠ9Ñ^0^3«11ÍDCDᜐᳮÏÐÒᐭḄp,K9ÑX÷ÏÐÒᐭᜐᳮrᐵḄvÄÊᑮ00h0^&«15Ò,K5Ḅ}©᝞。classCDlKeyboard{private:IDirectInputDevice8*m_pDIDevice;charm_keyBuffer[256];//?;ᢥÏG᝱ḄÜ⁚ᦪpublic:HRESULTInxt(IDxrectInput8*pDirectInput,HWNDhWnd);voidGetInput();boolIsKeyPres8ed(intiKey);voidDestroy(>;public:CDlKeyboard(void);~CDIKeyboard(void);>;1.Zfᓄ0□  *+ᓄ0^81Í8Ḅᐹ#>pᙠû☢n$*dCD,ᙠûSÙF。9Ñ'>^03¿Í8✌ᐜ_`o=01ᕸ11ÍDI^,ᯠx_`001“>^€^65Ḅo=,,&ᵨKḄ11^()ᡂᕒᦪ[ᡂ*+ᓄvÄ,"ṹ᝞。V_RETURN(DirectInput8Create(hInstance,DIRECTINPUT_VERSIONrIID_IDirectInput8,{void**)&g_pDirectInput,NULL));g_pDIKeyboard=newCDIKeyboard{);V_RETURN(g_pDIKeyboard->Init(g_pDirectInput,hWnd));ᐸÒ000<^^^(15Ḅ110ᡂᕒᦪḄR"ṹ᝞。HRESULTCDlKeyboard::Imt(IDirectInput8*pDirectInput,HWNDhWnd){HRESULThr?V_RETURN(pDirectInput->CreateDevice(GUIDSysKeyboard,&m_pDIDevice,NULL));V_RETURN(m_pDIDevice->SetCooperativeLevel(hWnd,DISCL_BACKGROUND|DISCL_NONEXCLUSIVE));V_RETURN(m_pDIDevice->SetDataFormat(&c_dfDIKeyboard));V_RETURN(m_pDIDevice->Acquire(>>;returnS_OK;>2.;ÌÏÐÒᐭ;Ì(ᜓḄEᩗåx,e8^Òᐭ(ᜓb@ᦪ£。0181Í8¿ᢝ5*5`Ḅᦪ£:ᓽUb>?Ub。ᓽUbᦪ£Q(ᜓìûG᝱Ḅü᯿,>?Ubᦪ£Q?;Ḅojᑡ_ᔠ。᝞W¦ᐵ(ᜓḄìûG᝱,᝞abᩚḄìûß、o=ᡈi=ᢥÏḄG᝱,ᑣᵨᓽUb/Ìᦪ£Ûwᔠ〉,᝞Wf¹ᐵü_SQG᝱,᝞Ñ᪗ḄÎ、ᢥḄᓫD,ᑣᵨ>?Ub/Ìᦪ£fᔠ〉。 □8□⑶….Ü×7uooo245w;ÌᓽUbᦪ£,◤⌕&ᵨ10781Í806¥^8::06106、ᓃ651316()>,K>;Ì(ᜓḄìûG᝱,ᐸ¯᝞。HRESULTGetDeviceState(DWORDcbData,LPVOIDlpvData)ᐸÒ:•cbData¸ᦪ1?70&〖3ᢣᔣḄᦪ£>?ḄᜧÞ(Ü⁚ᦪ)。•lpvDataᢣᔣ1ᦈ(ᜓìûG᝱Ḅ$᪀。ᙠ*+ᓄ0^(^1Í8î,ᡃÐ('"᝞Í8(ᜓI^Ḅᦪ£zb。IJSḄᦪ£zb,◤⌕ᵨSḄ$᪀1ᦈìû(ᜓḄG᝱ᦪ£。⊤15.3È÷0^81Í·Ḅ*ᦪ£zbIKḄ$᪀。Z=$᪀ᐹ#ᒹõᡂᕒ,èÅÚᦻ᫏。⊤15.3ᦪ£zbIKḄᦪ£$᪀ᦪ£zb______________________________ᦪ£$᪀__________________________c_dfDIMouseDUV40USESTATEc_dfDIMouse2DIMOUSESTATE2c_dfDIKeyboardᒹõ256=ᐗ²ḄÜ⁚ᦪc_dfDIJoystickDIJOYSTATEc_dfDIJoystick2DUOYSTATE2€0h0^3È5Ḅ0^1Í8()ᡂᕒ_`;ÌÏÐḄÒᐭ,13〖9?᝘8ᔴ)ᡂᕒᦪ_ïᑨeQᔲᢥ)=Ï。J5=ᦪḄR"ṹ᝞。voidCDIKeyboards:GetInput(){if(m_pDIDevice->GetDeviceState(sizeof(m_keyBuffer),(LPVOID)m_keyBuffer)==DIERR_INPUTLOST){m_pDIDevice->Acquxre();m_pDIDevice->GetDeviceState(sizeof(m_keyBuffer),(LPVOID)m_keyBuffer);boolCDIKeyboard:sIsKeyPressed(mtiKey){if(m_keyBuffer[iKey]&0x80)returntrue;elsereturnfalse;>ᙠ☢Ḅ"ṹÒ,&ᵨ10^81ÍÈ06?D81ôḄ06〖06¥D51&10()>/ÌÏÐÒᐭ。᝞WÅᜫIÏÐ(ᜓḄEᩗ,ᑣ@H;ÌEᩗ,ᯠxöy/ÌÏÐÒᐭ。ᡂ/ÌÏÐÒᐭᦪ£åx,ᡠᨵᢥÏḄG᝱&?ᙠ0_&6>8^76[Ü⁚ᦪÒ。w})=ÏQᔲᢥ,◤⌕⍝KÏᙠ“78^7^ᦪÒḄ@A。w>¯ᵨ,Dl^ectIÍutKeyboard_DevlcePp,ᡠᨵPp3-801〖:ᜮ,Z=Pp3*ᓽwIKᢥÏḄ@A。Pp3Ḅ[᦮ᑡ⊤,èÅÚᦻ᫏。᝞01〖^^1^w·VᜮÏḄ@A,ᡠ8e8ᵨ8"ṹ}Qᔲᢥ·VᜮÏ。if(g_pDIKeyboard->IsKeyPressedIsKeyPressed(DIK_LEFT)=*true)swprintf_s(g_strHelp,512,"ᢥ·VᜮÏ7”);elseif(g_pDIKeyboard->IsKeyPressed(DIK_RIGHT)==true)swprintf_s(g_strHelp,512,["ᢥ~VᜮÏ!");elseif(g_pDIKeyboard->IsKeyPressed(DIK_UP)==true)swprintf_s(g_strHelp,512,["ᢥVᜮÏ7”);elseif(g_pDIKeyboard->IsKeyPressed{DIK_DOWN)==true)swprintf_s(g_strHelp,512,["ᢥVᜮÏ7");elseswprintf_s(g_strHelp,512,L"");4.ᐵyô^⑶Í⑴jkᙠÑ⌨Èåû,◤⌕ᐵy0^81Í8jk,9Ñ'71^¿Í8ᐵy0ᓄ(^1ÍñjkḄ"ṹ᝞。g_pDIKeyboard->Destroy();SAFE_DELETE(g_pDIKeyboard);SAFE_RELEASE(g_pDirectInput);ᐸÒ00h0“^5Ḅ0ᦑ0^()ᡂᕒᦪḄR"ṹ᝞。voidCDlKeyboard::Destroy(){if(m_pDIDevice1-NULL)m_pDIDevice->Unacquire()?//³ÃI(ᜓḄEᩗSAFE_RELEASE(m_pDIDevice);>W]:4nh60&G]^Mᵨ 01;10,&&DirectInputAPI^S,ᡠ◤⌕n⚗µÈb(^8ÿÉ1ᓄ<(18G8.1Aᦻh。15.3᪗Hᐭᜐᳮ⁚$ᔠ9Ñ^61Í8CDᜐᳮÑ᪗ÒᐭḄp,K9Ñ☢CDḄ'v“òÍ85D。÷Ñ᪗ÒᜐᳮrᐵḄvÄ-Êᑮ0005Ò,K5Ḅ}©᝞。#defineBUFFER_SIZE16classCDIMouse{private:IDirectInputDevice8*m_pDIDevice;public:DIDEVICEOBJECTDATAn_InputData[BUFFER_SIZE];public:boolm_bLBtnDown;//᪗·ÏQᔲᢥboolm_bRBtnDown;//᪗³~ÏQᔲᢥboolm_bMBtnDown;//᪗ÒÏQᔲᢥlongm_lXMove;//Ñ᪗ᙠàá>ᔣḄÎᨬlongmlYMove;//Ñ᪗ᙠᚖz>ᔣḄÎ᤬ 08「6᝞G1^.Ü×7uOOO247public:HRESULTInit(IDirectInput8*pDirectInput,HWNDhWnd);voidGetInput();voidDestroy();public:•CDIMouse(void);~CDIMouse(void);>1.*+ᓄô7□⑶Í⑴Vw9Ñ^01Í8ᵨ>?Ub/ÌÑ᪗Òᐭ,ᡠ8◤⌕(0181ÍḄÑ᪗(ᜓᵨ>?/Ìᦪ£,ᐹ#(>"ṹᙠû☢CD(0^(^1Íñ(ᜓ}ឋîCDv。◀û8᜜,*+ᓄvÄ9ÑX©¿^7Í᝞r,ᐹ#d⁚èÅÚV"ṹ。2.;ÌÑ᪗ÒᐭIJ>?Ub,◤⌕ᵨ10^81ÍP06v^8::06106、D0313()>/ÌÒᐭᦪ£,K>Ḅ¯᝞。HRESULTGetDeviceData(DWORDcbOb]ectData,LPDIDEVICEOBJECTDATArgdod,LPDWORDpdwInOut,DWORDdwFlags)ᐸÒ:•cbObjectDataDIDEVICEOBJECTDATA^^^^/jN(Ü⁚ᦪ)0•rgdod1ᦈÒᐭᦪ£Ḅ0«^¥1〔08²(^1^×$᪀ᦪ。•pdwInOutᢣ}´᝞(1ᢣᔣḄ$᪀ᦪÒᐗ²Ḅᦪ,>]î,K¸ᦪḄòXÌ(w▭;ÌᑮḄᦪ£ᐗ²Ḅᦪ。•dwFlagsᑴ;Ìᦪ£>bḄ᪗,23(w0,⊤9^>?/Ìᦪ£xᑤ◀ᦪ£。·e8(w0ò00_?££X,⊤9/Ìᦪ£xS^>?Òᑤ◀ᦪ£。23X^¹4¸ᦪ(wᓫ=010£¥À£08²0^×$᪀LḄᙢᙬ,,X?6〜1008¸ᦪ(w1。w>¯ᵨ,23R◤⌕I/Ìᑮ>?ÒḄᦪ£n$rKḄᜐᳮ。CDIMouse5Ḅ0^1Í8()ᡂᕒᦪ_`/Ì,᪆Ñ᪗Òᐭᦪ£,ᐸR"ṹ᝞。voidCDIMouse::GetInput(){HRESULThr;DWORDdwReadNujn=l;//ÐÄÑ᪗Òᐭᦪ£>?ZeroMemory(m_InputData,Sizeof(DIDEVICEOBJECTDATA)*BUFFER_SIZE);//XÑ᪗ᙠàá>ᔣḄÎᨬ@H(w0m_lXMove=0;m_lYMove=0;//+ú/ÌÑ᪗ᦪ£for(xnt1=0;lGetDeviceData(sizeof(DIDEVICEOBJECTDATA),&m_InputData[i],&dwReadNum,0)==DIERR_INPUTLOST){m_pDIDevice->Acquire();m_pDIDevice->GetDeviceData(sizeof(DIDEVICEOBJECTDATA)•&m_InputData[i],&dwReadNum,0);>//TÑ᪗rIÎᦪ£if(m_InputData[i].dwOfs==DIMOFS_X)m_lXMove+=m_InputData[i].dwData;if(m_InputData[i].dwOfs==DIMOFS_Y)m_lYMove+-m_InputData[i].dwData;//;ÌÑ᪗ᢥÏG᝱if((m_InputData[i].dwOfs==DIMOFS_BUTTONO)&&(m_InputData[i].dwData&0x80))m_bLBtnDown=true;elseif((m_InputData【i】.dwOfs==DIMOFS_BUTTONO>&&(1(m_InputData[i].dwData&0x80)))m_bLBtnDown=false;if((m_InputData[i].dwOfs==DIMOFS_BUTTONl)&&(m_InputData[i].dwData&0x80))m_bRBtnDown=true;elseif((m_InputData[i].dwOfs==DIMOFS_BUTTONl)&&(!(m_InputData[i].dwData&0x80)))m_bRBtnDown=false;if((m_InputData[x].dwOfs==DIMOFS_BUTTON2)&&(m_InputData[i].dwData&0x80))mbMBtnDown=true;elseif(>3.ᵨÑ᪗Òᐭᦪ£9Ñ^^0D61Í8᪷£Ñ᪗ḄÒᐭ,ᙠïôÒµ9rKḄÛᦻ,᝞ᡠ9。if(g_pDIMouse->m_bLBtnDown==true)swprintf_s(g_strHelp,512,["ᢥ᪗w!");elseif(g_pDIMouse->m_bRBtnDown==true)swprintf_s(g_strHelp,512,^••ᢥÑ᪗~Ï7");elseif(g_pDIMouse->m_bJ4BtnDown==true)swprmtf_s(g_strHelp,512,1’ᢥÑ᪗ÒÏ!”);elseswprintf_s(g_strHelp,512,"Ñ᪗Îᦪ£4:%d,Y:%d'g_pDIMou8e->m_lXMove,g_pDIMouse->m_lYMove);InvalidateRect(hWnd,NULL,TRUEUpdateWmdow(hWnd);4.ᐵ=8□“A⑴<]^M1^>^0&᝞G)/w,ᐹ#d⁚èÅÚV"ṹ。 '8G.Ü×7uooo24915.4{|ᩚHᐭᜐᳮ)oyttkkabᩚ·Qo*3ᵨḄÒᐭ(ᜓ,8232v0581ôë1ᑮT!, 23B)ÎïÉÎ9Ñ。ïabᩚåx,e8ÅÚabᩚ(ᜓឋ,Iᐸn$st(,᝞15.1ᡠ9。abᩚQÏÐḄUh,SvabᩚÑrIÏÐ⌕cᩖo。⁚$ᔠ9Ñ】0>^^^1Í8,CD᝞<ᜐᳮabᩚÒᐭ。ᐸÒ÷ÒᐭᜐᳮrᐵḄvÄÊᑮ001】075ᓄ15Ò,K5Ḅ}©᝞:classCDIJoystick0{private:IDirectInputDevice8*m_pDIDevice;public:DIJOYSTATEm_diJOYSTATE;115.1´<[÷{|ᩚpublic:HRESULTInit(IDirectInput8*pDirectInput,HWNDhWnd);voidGetInput();boolIsButtonPressed(intiButton);voidDestroy();public:CDIJoystick(void);~CDIJoystick(void);>;1.Zfᓄ□ (^ᙠû☢_`07ᦝ11Í8ÏÐÑ᪗(ᜓî,ᵨḄQ01^81ÍñwÒAÏÐÑ᪗ḄGUID。ᵫJ23Bïi=abᩚ,0^81Í8ÔᨵÒAḄabᩚ080,ᡠ8wabᩚ_`0781ÍD(ᜓI^åû,◤⌕PpïḄabᩚ。wûᙠ€01】05^17'Ḅ^^()ᡂᕒᦪÒ,✌ᐜ&ᵨ8"ṹPpabᩚ(ᜓ。DIOBJANDDEVICEOBJdiOb]AndDeviceOb];diObjAndDeviceObj.pDirectInput=pDirectInput;V_RETURN(pDirectInput->EnumDevices(Dl8DEVCLASS_GAMECTRL,EnumJoysticksCallback,(LPVOID)&d1Ob3AndDev1ceObj,DIEDFL_ATTACHEDONLY))?☢Ḅ"ṹÒDIOBJANDDEVICEOBJQo=)}©Ḅ$᪀,ᵨJᔣ%&ᦪ⌴ᡠ◤⌕Ḅᦪ£,K$᪀Ḅ}©᝞:structDIOBJANDDEVICEOBJ{ID1rectInput8*pDxrectInput;ID1rectInputDev1ce8*pDIDevice;DIOBJANDDEVICEOBJ(){pDxrectInput=NULL;pDIDevice=NULL; 250oooÎ15U9Ñ】0¯10&1ÍñᙠPp%&ᦪ£¿〗0>^1098ᓚ31È&08)Ò,wóo=PpᑮḄabᩚ_`0»^^1Í8(ᜓI^。K%&ᦪḄ"ṹ᝞:BOOLCALLBACKEnumJoysticksCallback(constDIDEVICEINSTANCE*pdidInstance,LPVOIDpvRef){DIOBJANDDEVICEOBJ*pdiAndDivece=(DIOBJANDDEVICEOBJ*)pvRef;IDirectInput8*pDirectInput=pdiAndDxvece->pDirectlnput;if(FAILED(pDirectInput->CreateDevice(pdidInstance->guidInstance,&(pdiAndDivece->pDIDevice),NULL)))returnDIENUM_CONTINUE;returnDIENUM_STOP;>_`01^8^^>8abᩚ(ᜓI^åx,e8((ᜓḄ)&、ᦪ£zb8O;Ì(ᜓḄEᩗ,᝞ᡠ9:m_pDIDevice=d1Ob3AndDeviceOb3.pDIDevice;xf(m_pDIDevice==NULL)returnE_FAIL;V_RETURN(m_pDIDevice->SetCoopUrativeLevel(hWnd,DISCL_BACKGROUND|DISCL_NONEXCLUSIVE));V_RETURN(m_pDIDev1ce->SetDataF0rmat(&c_dfDIJ0yst1ck));V_RETURN(m__pDIDev1ce->Acqu1re());◀F(᜜,ᨵîR◤⌕wabᩚ(ᜓI^(åᦪ£}ឋÙ}ឋ,8Q(J5=}ឋḄ9"ṹ。//(åᦪ£DIPROPRANGEdipROPRANGE;dipROPRANGE•diph•dwSize=s12eof(DIPROPRANGE);dipROGE.diph.dwHeaderSize=sizeof(DIPROPHEADER);dipRO__GE.diph.dwObj=O;dipROPGE.diph•dwHow=DIPH_DEVICE;dipROPGE.lMin=-100;dipROPRANGE•lMax=100;V_RETURN(m_pDIDevice->SetProperty(DIPROP_RANGE,&dipROPRANGE•diph))//(ÑÙDIPROPDWORDdipROPDWORD?dipROPDWORD.diph.dwS1ze=s1zeof(DIPROPDWORD);dipROPDWORD•diph•dwHeaderSize=sizeof(DIPROPHEADER);dipROPDWORD.diph.dwOb3=O;dipROPDWORD•diph•dwHow=DIPH_DEVICE;dipROPDWORD•dwData=2000;V_RETURN(m_pDIDevice->SetProperty(DIPROP_DEADZONE•&dipROPDWORD.diph))2;ÌabᩚÒᐭᓚ01〗(^^^5Ḅ0᝞Í£)ᡂᕒᦪ_`;ÌabᩚÒᐭ,᝞ᡠ9:voidCDIJoystack::GetInput(){if(m_pDIDevice->Poll()==DIERR_INPUTLOST) 08□“80.Ü×7uooo251m_pDIDevice->Acquire<);m_pDIDevice->Poll();>m_pDIDevice->GetDeviceState(sizeof(DIJOYSTATE),&m_diJOYSTATE);>IJabᩚᙠ&ᵨ0^0^(^1ᦊ()>;ÌᓽUbḄÒᐭᦪ£åû,◤⌕ᐜ&ᵨ?011()>,ᔲᑣSØì;ÌÒᐭᦪ£。Vwᙠû☢Xᦪ£zb(w0_0^01〗(^“^ᡠ8ᙠûᵨ01〗0v8××£$᪀&?abᩚḄÒᐭ。û᜜·e8Xᦪ£zb(w(^1^1】078〖^±2,,ᵨ0110v3××£2$᪀&?abᩚḄÒᐭᦪ£。01】0¥571£0110¥8××£2$᪀ᒹõḄᦪ£ᡂᕒÛi,ᙠûSooᑡÈ,èÅÚᦻ᫏。ÈJ^9ḄpḄ,€01*10^^ᓄ951ù0«0#᝘86Ì)ᡂᕒᦪ,ᵨJᑨeabᩚḄ)=ᢥQᔲᢥ。KᦪḄR"ṹ᝞:boolCDIJoystick::IsButtonPressed(intiButton){if(m_diJOYSTATE.rgbButtons[iButton]&0x80)returntrue?elsereturnfalse;>3.ᵨqrᩚSᐭᦪ¡9Ñ〗0)^741Í8ᓫᙢᑨeQᔲᢥabᩚḄᢥ1ᑮᢥ4,8^9abᩚÒᐭᦪ£Ḅᵨ,"ṹ᝞:if(g_pDIJoystic->l8ButtonPressed(0)==true)swprintf_s(g_strHelp,512,1"ᢥabᩚᢥ1|");elseif(g_pDIJoystic->IsButtonPressed(1)==true)swprintf_s(g_strHelpr512,1"ᢥabᩚᢥ27");elseif(g_pDIJoystic->l8ButtonPressed(2)==true)swprintf_s(g_strHelp,512,["ᢥabᩚᢥ31");elseif(g_pDIJoystic->IsButtonPressed(3)==true)swprintf_s(g_strHelp,512,"ᢥabᩚᢥ41");elseswprintf_s(g_strHelp,512,L"");4.ᐵg□⑶…îï9Ñ^1>03&10?8r,ᐹ#d⁚èÅÚV"ṹ。*15.5i[Ñ᪗QabÑÒᨬ3ᵨ、·Qᨬ@⌕ḄÒᐭ(ᜓ, Ñ᪗}CḄÊÎ>bi*i᪵。᪷£SḄ◤⌕,e8¬ᵨSḄÊÎ>b。᝞ᙠóo7fḄ}CÒ,23◤⌕ᵨÑ᪗ᑴe8>ᔣ,᝞℉ÈḄ“µ¶·▮”ab}JJ*êæ。ᙠó}7fḄÒ,ᑣ3◤⌕ᵨÑ᪗A⌱ÒḄᱥ#,ᡈ2vÑ᪗ᑴᱥ⁐ḄÎ>ᔣ¶。IJJ*êæ,✌ᐜ◤⌕᪷£Ñ᪗ᙠïôḄᓫDATÈÔÌ]+,ᯠxᑨeÔÌ]+Qᔲ}CÒḄ)=ᱥ#rÊ,ᨵîR◤⌕TÈᐹ#ḄÊA。 252oooÎ15U15.5.1ÔÌ]+ḄT᝞15.2ᡠ9,(AþQᵨᡝ2vÑ᪗⌱ÌḄA,AþßJᢗ/ïô。^e8Aᓽᢗ/ÒᔣA^÷oᩩ]+,ᦻXK]+7wÔÌ]+。᪷£ÔÌ]+Qᔲᱥ#rÊ,ᓽeᑨeÒḄᱥ#QᔲÌ⌱Ò。᝞W]+ᙢ☢á☢rÊ,᪷£ÊAᓽeTÈÎ>ᔣ。]+23ᵫÈ#Aᐸ>ᔣᩭóF,ᡠ8ᐵÏḄE⚪Q´ᑮÔÌ]+ḄÈ#Aß>ᔣᔣ。ᙠÌÿÒ,ÔÌ]+᝞15.2Òᡠ9,µᯠe8AQÔÌ]+ḄÈ#A,}CAᔆe8AḄᔣªᓽwÔÌ]+Ḅ>ᔣ。ᵫJe8AᓽÌÿḄlA(0,0,0),ᡠ8ᔣ^ᓽÌÿÔÌ]+Ḅ>ᔣᔣ。RᙠE⚪Lw᝞<᪷£Ñ᪗ᓫDATÈA^ᙠÌÿÒḄᙶ᪗。15.2ÔÌ]+9Uᙠ}COà+Ò,ÌÿÒḄᱥ#⌕vᢗ/LᣚfLᣚØ´ᑮᨬÐḄµ9。⌕᪷£BCefḄÑ᪗A,TÌÿÒAᡝḄᙶ᪗ò,◤⌕ᑭᵨFLᣚvÑḄ⌮Lᣚ,ᓽᐜ2vfôLᣚḄ⌮Lᣚ,XÑ^^ALᣚ%ᢗ/ÿ,Ù2vᢗ/LᣚḄ⌮Lᣚ,XÑ᪗A^ᢗ/ÿLᣚ%Ìÿ。1.fôLᣚḄ⌮LᣚfôLᣚ2vfô1ê,X⚔Aᙶ᪗^ᢗ/ᙶ᪗Lᣚwᨬе9Ḅ、8²wᓫßḄefᙶ᪗,fôLᣚ▣^^᝞。'To00M<0^00LVIv¦200Maxz-Minz0StartX+-----WidthStartY+---Height--Minz,_.1,L22J᪷£☢ḄfôLᣚ▣,e8´ÈXᢗ/ÿÒḄA^_0^,',。),LᣚᑮfôÒBCefᙶ᪗A5(^,)ḄT;b,᝞ᡠ9。^=P,[^~J^StartX+^-sy=-Py^^j+StartY^^—DfWidthcvWidth(HightpvHeightᐸÒ᝞ᡂ5¹^ᑖwfô·Ḅ[、7ᙶ᪗,2ẠᔊᢓᑖwfôḄO。A'@Ḅó}=ᑖvfôLᣚxḄò^ÄwUò&?ᑮU>?Ò。Ꮇ(Ñ᪗ḄᓫDAw¦&),RᙠḄp᪗QXA^IᔣLᣚ%A0_,᪷£☢ḄT;b,Sã´Èᔆ、ᔆ^ḄT;b,᝞ᡠ9: 08□(^|[^“.Ü×7uooo2532sx-2StartX-Width+2StartY+HeightWidthyHeightVw2vÑ᪗ᓫD¦Ø´ᑮ&Ḅᦪò,SØ´ᑮUò,ᡠ8N2vfôLᣚḄ⌮Lᣚ´ᑮᔆ。PQJ,S/0ÔÌ]+>ᔣᔣḄT,Vwᢥ᯿}©,ᢗ/ïô÷á☢2=1@ᔠ,ᡠ8^2=1。2.ᢗ/LᣚḄ⌮Lᣚᙠ}CÑÒᨬ3ᵨḄᢗ/Qnfᢗ/,nfᢗ/ḄLᣚ▣᝞ᡠ9:w0000h0000Q100-QZn0ᐸÒ,w=coth-cot,Qúû☢Ḅ2ò(Uò)。Cº〜、•、2/Z,_2"QfôḄàáᚖz(ᵨ5⊤9)。VwA^Ḅ2ᙶ᪗w1,ᡠ8ᙠû¦◤T^Ḅ^ᙶ᪗ò。᪷£☢Ḅᢗ/▣,SãÚÈ,ᢗ/LᣚQXÌÿAᡝḄ^、7ᙶ᪗òᑖý8^1ᓽᑖý8^“Ḅᐗ²ᡝ。0、Pn.ᡠ8XAᡝ^ᢗ/ÿIᔣLᣚ%Ìÿ,¦◤Xᐸ17ᙶ᪗òᑖ◀8ma^^^^Poo.PnoVûeᵨ᝞;b᪷£Ñ᪗ATAþᙠÌÿÒḄᙶ᪗ò。f2S^2StartX-V/idth'-2Sy+2StartY+HeightY§、'1、pWidthJG_、^^00>HeightA^!>Rᙠ´ᑮÔÌ]+ᙠÌÿÒḄ⊤9,ÔÌ]+ḄÈ#Awᙶ᪗lA,ÔÌ]+Ḅ>ᔣw☢TÈḄᡝ。15.5.2ÔÌ]+ḄLᣚVwᱥ#Ḅ⚔Aᙶ᪗Qᵨᙢᙶ᪗j⊤9Ḅ,ᡠ8⌕ᑨeÔÌ]+Qᔲᱥ#rÊ8OTÊA,◤⌕Xᱥ#Ḅ⚔Aᙶ᪗ÔÌ]+È#A>ᔣᔣLᣚᑮrḄᙶ᪗j。Vwᱥ#U`o[ᒹõ¡i⚔A,Iᐸn$LᣚTÛᜧ,ᡠ823XÔÌ]+ḄÈ#A>ᔣLᣚᑮᱥ#Ḅᙢᙶ᪗ÿ。ᐹ#>Q,ᐜXᱥ#Ḅ&▣e8▣rý,´ᑮo=ᔠ▣,ÙÕÈKᔠ▣Ḅ⌮▣Iᡷ1,2v▣1/·1IÔÌ]+ḄÈ#A>ᔣᔣn$Lᣚᓽe。☢ḄᦪRÔÌ]+ḄTLᣚvÄ://]+$᪀structRay{D3DXVECTOR3vOrig;//]+È#AD3DXVECTOR3vDir;//]+>ᔣ//T,ÔÌ]+,Iᐸn$LᣚRayCalcPickRay(IDirect3DDevice9*pd3dDevice,HWNDhWnd,D3DXMATRIXmatT) 254000Î15U//TÑ᪗ᙠïô(ᡝÒḄßPOINTpt;GetCursorPos(&pt);ScreenToClient(hWnd,&pt);//;ÌìûfôចêD3DVIEWPORT9vp;pd3dDevice->GetViewport(&vp);//;Ìᢗ/Lᣚ▣D3DXMATRIXmatProj;pd3dDevice->GetTransform(D3DTS_PR0JECTI0N,&matProj);//TÌÿÒ]+ḄÈ#A>ᔣ•floatpx=(2.0f*pt.x-2.0f*vp.X-vp.Width)/(vp.Width*matProj.__11);floatpy=(-2.0f*pt.y-2.Of*vp.Y+vp.Height)/(vp.Height*matProj._22);RaypickRay;pickRay.vOrig=D3DXVECTOR3(O.Of,0.0f,0.0f);pickRay.vDir=D3DXVECTOR3(px,py,1.0f);//XÌÿÒḄ]+Lᣚᑮᡠ◤⌕ḄÿD3DXVec3TransformCoord(&pickRay.vOrig,&pickRay.vOrig,&matT);D3DXVec3TransformNormal(&pickRay.vDir,&pickRay.vDir,&matT);returnpickRay?>☢Ḅ"ṹᵨ030996€31^-£001^00£)ᦪI]+ḄÈ#An$Lᣚ,ᓽᢥ᯿AḄ>bn$Lᣚ;I]+>ᔣᵨ0309¥E3×ᕸᕸ01^00¿1()ᦪn$Lᣚ,ᓽᢥ᯿ᔣḄ>bn$Lᣚ。ᐵJJ5*>båÿḄ,è▅/ó2»ÒḄrᐵᑁ4。15.5.3ÔÌ]+÷ᱥ#ÊAḄTᙠᵨÑ᪗}Cn$ÊÎî,3◤⌕TÔÌ]+U`ḄÊA。ᙠ}CÑÒ,ᱥ#23ᵨyzU`⊤9,yzU`ᵫᜧḄ}☢᪀ᡂ,ᡠ8ᙠTÊAî,✌ᐜ◤⌕ᑖ᪆ÔÌ]+yzU`ḄÖ=☢rÊ,nTÊA。e8ᵨ03£^Ḅ030᱄1P᝘D()ᦪᑨeÔÌ]+QᔲyzU`rÊ,KᦪR]%rÊ}☢Ḅ@AÊAḄ@ᙶ᪗(《,v)。᪷£rÊ}☢Ḅ@A,e8´ᑮrÊ}`Ḅ}=⚔A(V,,V2,V3),ne8TÈÊA^&^^,T;b᝞:V'ln.crscct=ViX(T—“—V)+V2XM+V3XVVwyzU`23ᨵ¡i☢᪀ᡂ,ᡠ8ᵨ03091¹᝘D()TÔÌ]+yzU`QᔲrÊ,◤⌕ḄTÛᜧ。ᨵîwhiT,e82vT]+÷ᱥ#᜜ᒹ}ᡈ᜜ᒹᳫQᔲrÊ,ᜧᭆᑨeÔÌ]+Qᔲo=ᱥ#rÊ。e8ᵨ030Ḅ030᱄50©80G(1?^^6()ᦪᑨe]+Qᔲ᜜ᒹ}rÊ,ᵨ03095ô1^"30¿(1?1(^^()ᦪᑨe]+Qᔲ᜜ᒹᳫrÊ。15.5.4ÔÌ9ÑÞ⁚2v9ÑPickObjeCt^9᝞<ᵨÑ᪗ÔÌ}CÿÒḄᱥ#。K9ÑF5=ₐU`,᝞WÔÌᑮ)=ₐ,ᑣᙠïô·%µ9o$ᦻn$Û。 046|0.Ü×7uooo255FᑨeQᔲÔÌᑮₐU`Ḅ"ṹ᝞://EFₐ1D3DXMatrixTranslation{&g—matWorldl,-2.Of,0.Of,0.0f);g_pd3dDevice->SetTransform(D3DTS_WORLD,&g_matWorldl);g_pTeapotMeshl->DrawSubset(0);//ᑨe]+Qᔲₐ1rÊif(GetCapture()){D3DXMATRIXmWorldView=g_matWorldl*g_matView?D3DXMatrixInverse(&g_matRay,NULL,&mWorldView);g_pickRay=CalcPickRay(g_pd3dDevicerg_hWnd,g_matRay);BOOLisPicked=false?D3DXIntersect(g_pTeapotMeshl,&g_pickRay.vOrig,&g_pickRay.vDir,&isPicked,NULL,NULL,NULL,NULL,NULL,NULL);if(isPicked==true){intcharCount=swprintf_s(g_strHelp,200,["⌱Òₐ¼11M);g_pFont->Drav?Text(NULL,g_strHelp,charCount,&g_ClientRect,DT_BOTTOM|DT_LEFT,Oxffffffff);}>☢Ḅ"ṹ✌ᐜ᪀⌼ₐU`】Ḅ&▣,ᯠx(&▣,Fₐ。1ᩭ,᝞Wᣓ;ᑮÑ᪗,ᑣT&▣e8▣Ḅᔠ▣,,TÈᔠ▣Ḅ⌮▣,ᯠxTÈÔÌ]+,,X]+LᣚᑮₐU`1Ḅᙢᙶ᪗jÿ,ᨬxᑨe]+QᔲₐU`1rÊ。FₐU`28Oᑨe]+Qᔲ÷ᐸrÊḄ"ṹ,☢Ḅ"ṹ5D。wØTᣓ;ᑮÑ᪗,ᙠᢥÑ᪗·Ïî◤⌕(ᣓ;Ñ᪗,,ᙠ³ÃÑ᪗·Ïî³ÃÑ᪗ᣓ;,᝞ᡠ9{caseWM_LBUTTONDOWN:SetCapture(hWnd);//(ᣓ;break;caseWM_LBUTTONUP:ReleaseCapture();//³Ãᣓ;break;15.601(^1Í8Q8^8᱄Ò]_`ÒᐭᜐᳮḄ%ᑖ,8z1÷hÉÎÑ21,e8ù¤;ÌᵨᡝḄÒᐭ,8gîÊÎÑḄ◤⌕。881Í8Q0^D9ÒrIÛᓫḄo%ᑖ。»✌ᐜCD᝞<*+ᓄ01^1Í^,ᯠxᑖ⌕CD᝞<ᜐᳮÏÐ、Ñ᪗abᩚḄÒᐭ。ᨬxCD÷Ñ᪗ÔÌrᐵḄᑁ4,ÔÌQᵨÑ᪗}Cn$ÊÎḄ@⌕ᑁ4。a!1.Úᦋó9»ÒḄ9Ñ0^J0&ᦝ316,ᵨ»z{Ḅᑁ4ᜐᳮÏÐÒᐭ。2.Úᦋ»9ÑM0useInput,ᵨᓽUb/ÌÑ᪗ᢥÏḄG᝱。3.Úᦋó11»ÒḄ9Ñ%¹^^H<^&,ᵨabᩚᢥᑴa。 *Î16U0᱄1^M᪾O0᱄0×Q0^^19Ḅo=KᵨÑ᪾¾(ᦻ709。×᪾¾)。01'᪾¾ØTÑᕒáf´Ḅîÿᩭ.ᑡE⚪:_`ï]、_`0&^130(ᜓ、n$_ê+úᜐᳮ(ᜓ_。ᵨDXUT᪾¾:#DireCtXÑ,Sü¤ᦔ, Ñf¹Ꮙº。ᜧiᦪDirectX50ᑍ9Ñ·Qᙠ091;×᪾¾ḄẠ:#Ḅ。16.13 M᪾Oᒈ᪆ÖÎᓹ^8^9ÑÓÔᘤ,ᢥ᯿ᙠó1»ÒCDḄvÄp,᪷£”EmptyP^0jeCt"nᡂo=⚗p,,XK⚗pXÈw^00;×&30^。2v☢ḄvÄ,_`o=091×Ñ᪾¾。16.1.1。9ô᪾¾ᦻᡂØ•DXUT᪾¾ᵫ¡i2ᵨᦻ᪀ᡂ,J2ᵨᦻᑖw55:᪶ᦻe⌱ᦻ,ᑖ&?ᙠ“0᱄。×/00^”“DXUT/Optional”p2。ᐸÒ᪶ᦻᒹ:DXUT.h、DXUT.cpp、DXUTenum.h、DXUTenum.cpp、DXUTmisc.h、DXUTmisc.cpp。2v☢ḄvÄnᡂ017?80^9Ñî,B)Îw⚗p8¹8=ᦻ。,w⚗p(rKḄ“▬¹ᒹõp2”,^ØTÆᑮᓹ9ô×ᓹ9^^&ᜮᦻ。w(ÅÚ▬¹ᒹõp2,✌ᐜᡭ:⚗p}ឋI)᪾,vÄp᝞16.1ᡠ9,ᨬxᙠCÈḄI)᪾ÒÅÚlᨵḄ▬¹ᒹõ02,ᡈ8¹HḄ▬¹ᒹõp2。091×᪶᪾¾ᑡØ。•ᓄïô(ᜓḄ_`。•¯(ᜓ_(_`、@、Åᜫ,├〉ïô_(_ê、ÏÐ、Ñ᪗)。•ᙠïôUbᐰeUbÿᑗᣚ,ᙠh^j(ᜓ¸ὃ(ᜓÿᑗᣚ。•ᑖj᳛Tîᘤ。•w)ÎstX$$¿ᢝ。û᜜,090×e⌱᪾¾R¡i3ᵨḄ#ÃØ。•2vI)᪾ᡈ?1⌱à(ᜓ。•[ᳮ0±,ᒹ1^4¿616(1ᦻ᪾。•f¹>¯ḄBCᦻ¿ᑴ。•▬¹Ḅ#5,᝞ᓫḄ᤬!5、Î᝱ᦪ5¶。 æM᪾Oooo25716.1xÚ(▬¹ᒹõp216.1.20d1^᪾¨Sìᦪ09ô×᪾¾%&ᦪQ0ô᪾¾w:#ᕒḄ1ô,090×}©JᦪḄl`。ᵨ09。7᪾¾n$:#,⌕ÃÄQᢥ᯿DXUT}©Ḅ%&ᦪl`%&ᦪḄᐹ#R,0。×᪾¾Bᙠᔠ〉Ḅî!&ᵨ:#ᕒRḄJ%&ᦪ。wØTᮣR)᝞ᙢᵨ0911᪾¾,½J%&ᦪḄl`、Äᵨ&ᵨî!Q@⌕Ḅ。☢✌ᐜ$ᔠoÞ⁚_`Ḅ0。?!^1^9Ñ,I3ᵨḄ%&ᦪn$CD,[᦮Ḅô9。×%&ᦪᑡ⊤èÅÚᦻ᫏。1.LPDXUTCALLBACKISD3D9DEVICEACCEPTABLEᙠ9Ñ^^0^^06Ò,K%&ᦪḄRᦪQ180309069^0^D1^()。DXUT᪾¾ᙠ_`8ᕸ130(ᜓåû&ᵨK%&ᦪ,IZᜓ_`Ḅ0^830(ᜓḄᱯn$bÅ。e8ᙠKᦪÒ8¹"ṹ,8bÅìû(ᜓQᔲ¿ᢝᡠ◤⌕Ḅ)ᱯ。ᡃÐᙠû☢ᔜ»ᑮḄI(ᜓØn$bÅḄ"ṹ,-e88¹ᑮKᦪÒ,᝞,e8ᙠKᦪÒ8¹"ṹbÅìûh¿ᢝḄḼ⁐ᘤ᱐Qᔲg◤⌕。K%&ᦪḄl`᝞。boolLPDXUTCALLBACKISD3D9DEVICEACCEPTABLE(D3DCAPS9*pCaps,D3DF0RMATAdapterFormat,D3DF0RMATBackBufferFormat,boolbWindowed,void*pUserContext)ᐸÒ:•pCapsᢣᔣᒹõìûh(ᜓØḄ0300?59$᪀Ḅᢣ┐。•AdapterFormat〉06ᘤzb•BackBufferFormatx'>?zb•bWindowedQᔲwïôUbᨬxo=¸ᦪô^1€0P81ᢣᔣ:#ᕒ}©Ḅᦪò,KᵨÑ23ᵨK¸ᦪw%& 258oooÎ16Uᦪ⌴ᒹõᦻ1êḄ$᪀,K¸ᦪḄÒAòwNULL。ᡠᨵô9^%&ᦪḄᨬxo=¸ᦪ-Q?1^6[0Ḅ81,ᙠx☢CDᐸ¦%&ᦪî,SÙ³K¸ᦪ。W]:ÿÀᦪᵫ〇>0;L᪾OÿᵨḄÀᦪ,ᡠ1^01L᪾O⌕WXᔜᦪḄᐹg(?136+0D6Ë1ᦪ◀᜜),?@ᕒᙠ¯°ÿÀᦪD,:9ᦪ/ᐵº»。2.LPDXUTCALLBACKMODIFYDEVICESETTINGSᙠ9Ñ0᱄^ᔥ^0^Ò,K%&ᦪḄRᦪQ90î70600656ÈÍ8()。DXUTft_`07<^30(ᜓåû&ᵨK%&ᦪ。090×᪾¾wZᜓ_`Ḅ0ᓄE130(ᜓÒA(,᝞W◤⌕IJÒA(n$Úᦋ,ᑣ◤⌕RK%&ᦪ。᝞090×᪾¾ÒA¬ᵨh⚔Aᜐᳮ,᝞Wᵨ:⚔Aᜐᳮ,e8ᙠK%&ᦪÒn$rKḄÚᦋ。K%&ᦪḄl`᝞。boolLPDXUTCALLBACKMODIFYDEVXCESETTINGS(DXUTDeviceSettings*pDeviceSettmgs,void*pUserContext)ᐸÒ¸ᦪ?'ᕸᢕÍ5Qᢣᔣ09-^^(^6È£8$᪀LḄᢣ┐,K$᪀ÒAḄ(ᜓ(。3.LPDXUTCALLBACKD3D9DEVlCECREATEDᙠ9Ñ0507^^6Ò,K%&ᦪḄRᦪQ0ᡭ0309(^&16069^0。DXUT^¾ᙠ_`(ᜓåx&ᵨK%&ᦪ。:#ïe8ᙠK%&ᦪÒ_`ᡠᨵᑁ?ü5`w030?0(^^^^^^^F0ᡈ030?00[_^v5×£^^pḄtV。K%&ᦪḄl`᝞。HRESULTLPDXUTCALLBACKD3D9DEVICECREATED(IDirect3DDevice9*pd3dDevice,CONSTD3DSURFACE_DESC*pBackBufferSurfaceDesc,void*pUserContext)ᐸÒóo=¸ᦪᢣᔣ£^0^_`Ḅ8^<^30(ᜓ,óB=¸ᦪóFx'>?Ḅrᐵ1ê。4.LPDXUTCALLBACKD3D9DEVICERESETᙠ9Ñ0᱄-^36Ò,K%&ᦪḄRᦪQ0309&68611^^6()。DXUTti¾ᙠ&ᵨ01^309〔Ჱ0^(^()%&ᦪåx,ᡈὅᙠ01830(ᜓÉᜫxឮc(ᜓîB&ᵨK%&ᦪ。e8ᙠK%&ᦪÒ_`ᡠᨵᑁ?ü5`w030?001」^?h×ḄtV。KÿÀᦪḄ©><[?0¡^C0^C0^90£10^£CL£0/w。5.LPDXUTCALLBACKMSGPROCᙠ9Ñ09ô×?^11^Ò,K%&ᦪḄRᦪQ^$?1^()。ᙠÀ$vÑÒ,0901'᪾¾Se&ᵨK%&ᦪᜐᳮᔜ5_ê。K%&ᦪḄl`᝞。LRESULTLPDXUTCALLBACKMSGPROC(HWNDhWnd,UINTuMsg,WPARAMwParam,LPARAMlParam,bool*pbNoFurtherProcessing, 0᱄1^M᪾Oooo259void*pUserContext)ᐸÒûZ=¸ᦪᑖᑩQïô¥P、_ê᪗、_êḄ5=¸ᦪ。ᙠK%&ᦪḄRᦪÒ,᝞WX¸ᦪô6?^^⇧¹ø0^887%ᢣᔣḄL(w×X。£,ᑣB¯Ñ0᱄。×᪾¾nopᜐᳮ_ê。◀K%&ᦪå᜜,DXUT᪾¾R]ᵨJᜐᳮÏÐ_Ñ᪗_Ḅ%&ᦪ:LPDXUTCALLBACKKEYBOARD*LPDXUTCALLBACKMOUSE。ᙠx☢CDᵨ091׿ᑴBCᦻî,BCD᝞<ᵨ%&ᦪᜐᳮÏÐ_。6.LPDXUTCALLBACKFRAMEMOVEᙠ9Ñ0᱄0×?ô0^Ò,K%&ᦪḄRᦪQ0#^1¹p(^0。091×᪾¾ᙠFZoåû,&ᵨK%&ᦪIn$fH。┐IᵨᡝÒᐭḄ0KᑏḄ"ṹ,23KßJKᦪÒ,᝞(&▣Rᱥ#ḄÎ。K%&ᦪḄl`᝞。VOIDLPDXUTCALLBACKFRAMEMOVE(DOUBLEfTime,FLOATfElapsedTime,void*pUserContext)ᐸÒóo=¸ᦪj7„^Q)^ÑÖÎåxᔊḄîÿ,óB=¸ᦪì13?8&1^1^Q5åÿḄîÿÿ◞,ᓫßQ。7.LPDXUTCALLBACKD3D9FRAMERENDERᙠ9Ñ09”^31^Ò,K%&ᦪḄRᦪQ(^0309?1᝞^^^ó()。ᙠFZoî,091×᪾¾&ᵨKᦪn$F,KᦪḄÄᵨrìJᙠ8ûᡠᨵ9ÑÒᡠᵨḄX60(1£)ᦪ。K%&ᦪḄl`᝞。VOIDLPDXUTCALLBACKD3D9FRAMERENDER(IDirect3DDevice9*pd3dDevice,DOUBLEfTime,FLOATfElapsedTime,void*pUserContext)KᦪḄóo=¸ᦪQᵨFḄ8830(ᜓI^,óBó}=¸ᦪᑖQÑÖÎåxᔊḄîÿ5åÿḄîÿÿ◞。8.LPDXUTCALLBACKD3D9DEVICELOSTᙠ9Ñᓹ9…^8ᢕÒ,K%&ᦪḄRᦪQ(^030Á0810^E0。ì(ᜓÅᜫî,ᓹ9…^¾B&ᵨKᦪ,eᙠKᦪÒ³Ãᡠᨵᙠ1^091^〇0^0^3090£010^05×%&ᦪᦪÒ_`ḄtV。K%&ᦪḄl`᝞。VOIDLPDXUTCALLBACKD3D9DEVICELOST(void*pUserContext)◤⌕ÛḄQ,ᙠKᵨÑ$»ÿ,ì0ᓄ^130(ᜓÅᜫî,09。×᪾¾B&ᵨ0ᓄ081069^()ᦪ,^³ÃßJ030?00_0£?⛭^ᑁ?üÒḄtV。ìᓹ^830(ᜓ^ÉᜫG᝱ឮcî,090×᪾¾B&ᵨᓃ?091[1^180<^3090£91〇£X£5×%&ᦪ,@H_`ßTD3DPOOL_DEFAULTᑁ?üÒḄtV。·QÛ,ᙠÑ$î,᝞WÈR(ᜓÉᜫR^,LPDXUTCALLBACKD3D9DEVICELOSTftLPDXUTCALBACKD3D90£¥10£X£5£×JoI&ᦪ◤⌕ᑖ&ᵨoS。 260oooÌ16U9.LPDXUTCALLBACKD3D9DEVICEDESTROYᙠ9Ñ0᱄^^31^Ò,K&ᦪḄRᦪQ(^^^>8Ḅ^^^^()。^DXUT᪾¾├0ᓄ(^30(ᜓî&ᵨKᦪ,eᙠKᦪÒ³Ãᡠᨵᙠ[?09。×00^(^^3090£¥À£ᓚ¦£×£0%&ᦪÒ_`ḄtV。K%&ᦪḄl`᝞。VOIDLPDXUTCALLBACKD3D9DEVICEDESTROY(void*pUserContext)16.2ᵨ0᱄1^᪾Oo⁚CD0©ô×᪾¾ḄØ8O09。×᪾¾Ḅ%&ᦪ。⁚$ᔠû☢_`Ḅ091×?^0^9Ñ,CDᵨ091×᪾¾n$:#Ḅp。☢✌ᐜÈ9Ñ09。×ᓹ᝞^Òᑩᡭ^ᦪḄᐰ%"ṹ。INTWINAPIwWinMain(HINSTANCE,HINSTANCE,LPWSTR,int)16.2.1R,(%&ᦪᵨDXUT᪾¾Ḅóop,Q}◤⌕ᵨ0᱄。×%&ᦪ,,ÈJ%&ᦪḄᐹ#R。ᙠo⁚CDḄ9=%&ᦪ,23-◤⌕ᵨ,ᡠ8ᙠ_`091×?^@69Ñî,·)ÎwJ9=%&ᦪnᡂᦪ᪾¾,^¦◤⌕ᙠrKḄᦪ᪾¾Ò8¹Rᱯ 0᱄。LM᪾Oooo261}ØḄ"ṹᓽe。wô9ô×᪾¾ØT&ᵨJ%&ᦪ,ᙠ*+ᓄ07"^30åû,◤⌕wô9ô×᪾¾(%&ᦪ。᝞nᡂ09。×?^0^9Ñî,)ÎI☢CDḄ9=%&ᦪn$(,᝞û☢ÈḄ^4^»1ᦪÒḄ"ṹᡠ9。᪷£◤⌕,e8ᨵ⌱àᙢ(ᐸÒḄ)%&ᦪ。16.2.2*+ᓄ0᱄ô×wô9。×(&ᦪåx,ᙠᵨ091×᪾¾åû,◤⌕ᐜ*+ᓄ09。×᪾¾。*+ᓄ0᱄。×e82vᦪ0᱄。1^ᕲ)[ᡂ,KᦪḄ¯᝞:HRESULTDXUTImt(BOOLbParseCommandLme,BOOLbShowMsgBoxOnError,WCHAR*BtrExtraCommandLmeParams,boolbThreadSafeDXUT)ᐸÒ:•bParseCommandLineᢣ909·᪾¾QᔲbÅᨵᐵX$$¸ᦪ,ÒAwTRUE。[᦮ḄX$$¸ᦪᑡ⊤,èÅÚᦻ᫏ÒKᦪḄÛ。•bShowMsgBoxOnErrorᢣ9᝞W#n┯îQᔲµ9_ê᪾,KUSTRUE。•strExtraCommandLineParamsᒹÎ᡽ÃÄÅûQᦪḄ"Ë$,.!^^。•bThreadSafeDXUTwᑴý«Æᦋ01^ᑁmḄA᝱Ó§ᔲúᐭᐵÉ(ᵨJ+Ñp),ÒAòw?15£。9:᝞WÔᨵ&ᵨ091×1¦()ᦪ,ᑿ0᱄1×᪾¾B)ÎᵨÒA¸ᦪ&ᵨKᦪ。16.2.3ᐸ¦ô91^(*+ᓄ^001×᪾¾åx,Re8&ᵨ09。1᪾¾ḄrKᦪ,nopI0907᪾¾Ḅ)>☢n$。ᙠ9Ñ09·?86Ò,✌ᐜ&ᵨ09-8v1^99ò^11_0ᦪᢣ}QᔲÖᵨᱯ}Ḅ*Ï,KᦪḄ¯᝞:voidDXUTSetHotkeyHandlmg(boolbAltEnterToToggleFullscreen,boolbE8capeToQuit,boolbPauseToToggleTimePause)ᐸÒ:•bAltEnterToToggleFullscreen᝞ÔÛQᦪ2..ÖÊ。£,ᑣ0᱄11Ö᪾Íö÷ᜐᳮÏ+£ØᡭÑ,ÒᢥÕ11#>ᡭÓ,·ÔᙠÕ1ᐰÖ1×úûᑗᣚ。Ú.È&^£。•bEscapeToQuit᝞Ô2..Ö0^,ᢥ£50Ú⌨Ç。Ú.Ö&0£。•bPauseToToggleTimePause᝞Ô2..10^,ᢥ?3Û5,ÚᨚÝÞᵨḄÓᘤ。Ú.Ö80ß。1ᩭ,&ᵨ09᝘^10^8066ÈÍ3()ᦪ,(ìᑗᣚᑮᐰeUbîQᔲµ9Ñ᪗ 262000Î16Uᐝ᪗,Ø̧ᔲÛá᪗ᐝ᪗▲ᑴᙠÖãäåØᑁ。ᦪḄ᝞:HRESULTDXUTSetCursorSettings(boolbShowCursorWhenFullScreen,boolbClipCursorWhenFullScreen)ᐸ:•bShowCursorWhenFullScreen᝞Ô2..TRUE,ᑣᙠᐰÖ1ÝÄᐝ᪗。•bClipCursorWhenFullScreen᝞Ô2..1Ê1æ,ᑣᙠᐰÖ1Ûᐝ᪗▲ᑴᙠÖãäåØᑁ。16.2.4_`ïôᙠÞᵨÀᵨᑩØ1^8Õ?1ᦪÒHÕ§èéîᩖḄ4,ë᪾ÍÙ4ᦪ0᱄0Ö0^【6í᝞*()îᓄÈñ4。ᦪḄ᝞:HRESULTDXUTCreateWindow(CONSTconstWCHAR*strWmdowTitle,HINSTANCEhInstance,HICONhIcon,HMENUhMenu,INTy)ᐸÒ:•strWindowTitleïô᪗⚪。•hInstanceKᵨÑḄ¥P,23(wNULL。•hlcon᪗¥P。᝞W(w>^^1XᵨÒᙠe᡻$ᦻÒḄóo=᪗,23(w᝞0^0•hMenuìᓫḄ¥P,e᪷£◤⌕(。PᜧiᦪabSᵨ᪗Zìᓫᵨ8Ð)ÅḄab1ô"/。•97ᢣ}ïôḄ*+ß。᝞WKᵨÑ$ᙠᐰeUb,ᑣBµᶍJ5=¸ᦪ。16.2.5_`07□830(ᜓ1^0;×᪾¾ᵨᦪ091/1<^^0^0€0ᓄ0^(^30(ᜓḄ_`,KᦪḄ¯᝞:HRESULTDXUTCreateDevice(boolbWindowed,INTnSuggestedWidth,INTnSuggestedHeight)ᐸÒ:•bWindowedᢣ}ÑÖÎîQïôUbRQᐰeUb,ÒAòw×80£,⊤9ÑÖÎîwïôUb。•nSuggestedWidthx'>?Ḅ`ÚO,ÒAòw0。w〉K(ᜓvÄjkḄ▲ᑴ,eØBIK¸ᦪ(ḄOn$&᦮。•nSuggestedHeightx'>?Ḅ`Ú,ÒAòw0。ÿ᪵·eØBIK¸ᦪ( DXUTg^S*ooo263Ḅn$&᦮。᝞WXK¸ᦪÍ88<^^È-(w0,ᑣᵨïô(ᡝḄOÄwx'>?ḄO。9:◀☢CDḄ0᱄1×᪾¾ᦪ8᜜,09。1'R¡iᐸ¦ᯛᦪ,[᦮Ḅ09。×ᦪᑡ⊤,èÅÚᦻ᫏。៉Jô9ὣ×᪾¾ᦪ(ᒹ%&ᦪ)IJᮻR$K᪾¾QᨵḄ。ç 0b30[ᜓ#`,ÿᵨDXUTMainLoop()ÀᦪzᐭW»Y。ᙠM᡻Ê,DXUTMainL00p()ÀᦪÿᵨTUḄᔜÿÀᦪ,ÄùbᵨMÕMNÜ×、ᜐᳮᔜ[ᜓ[ᐰe8[ᡂ¿ᑴBCᦻḄ÷z,PQᙠᐹ#vÄSQ>¯,ᱯQᑴᦻḄß、Ü#¶ÛÞã。wû090×᪾¾┐IBCᦻ,0091[^È6106:5、1030᱄5ô『᝞10309?0P1ôᓄᦻµ9。1ᩭᙠû☢_`Ḅ100^^^^^Ñ᪾¾ḄẠ8¹BCᦻµ9Ø。9:CDXUTTextHelper5QᙠSDKmisc.hᜮᦻÒ}©Ḅ,,Qᙠ50N1&0ÍôÒRḄ。wᵨ€09。××8È6ø615,◤⌕w⚗pŹ501<^^050〖11^0{ôôᦻ,,ᒹõ5^〖0^(^ᜮᦻ。Vw50X111750ßÆ“DXLTAOptional”p2,ᡠ8R◤⌕8¹rKḄ▬¹ᒹõp2。1.*+ᓄ7030᱄3ôᕲ87030᱄^::0ᚉI^ᙠ%&ᦪ010>3090^160676()Ò,_`103ᓹ᱄?0ᦑI^,"ṹ᝞。V_RETURN{D3DXCreateFont(pd3dDevice,15,0,FW_BOLD,1,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULTJPITCH|FF_DONTCARE,L"ArialM,&g_pFont));ᙠ%&03091^86【06v^0ᦪÒ,ឮc10309?0PÜ#I^,_`103095?1^I^,"ṹ᝞。if{g_pFont)V_RETURN(g_pFont->OnResetDevice());V_RETURN(D3DXCreateSprite(pd3dDevice,&g_pTextSprite));1ᩭe8ᵨÈ3095061610309?0îI^ᙠïôÒ¿ᑴᦻ。2.¿ᑴᦻw>¯ᦻḄ¿ᑴ,09·R00᱄170^Èᓾᡭ5。ᙠ_`K5Ḅî◤⌕ᢣ}ᐸᵨḄ-30959·610309?0ᡷI^,ᯠxᡠᨵᦻ¿ᑴÃÄ-ᵫ€017^{¦o5_`。᡽/xḄ0917?^069Ñ,ᙠ)}©Ḅ&6'6j81()ᦪÒ¿ᑴᦻ,ᐸ[᦮"ṹ᝞。voidRenderText(){CDXUTTextHelpertxtHelper(g_pFont,g_pTextSprite,15);//µ9ìûDireCt3D(ᜓG᝱F¤᳛txtHelper.Begin();txtHelper.SetInsertionPos(S,5); 264oooÎ16UtxtHelper.SetForegroundColor(D3DXC0L0R(1.0f,1.Of,0.0f,1.Of));txtHelper.DrawTextLine(DXUTGetFrameStats(true));txtHelper.DrawTextLine(DXUTGetDeviceStats());//᧎9ᐸ¦⌕1êtxtHelper.SetForegroundColor(D3DXCOLOR(1.0f,1.0f,1.0f,1.0f));txtHelper.DrawTextLine(L"Putwhatevermiscstatushere");//µ9ᓫ1êconstD3DSURFACE_DESC*pd3dsdBackBu££er=DXUTGetD3D9BackBufferSurfaceDesc();if(g_bShowHelp){txtHelper.SetInsertionPos(10,pd3dsdBackBuffer->Height-15*6);txtHelper.SetForegroundColor(D3DXCOLOR(1.0fr0.75f,0.0f,1.0f));txtHelper.DrawTextLine(L"Controls(F1tohide}:");txtHelper.SetInsertionPos(40,pd3dsdBackBuffer->Height-15*5);txtHelper.DrawTextLine(L"QuitsESC");>else{txtHelper.SetInsertionPos{10,pd3dsdBackBuffer->Height-15*2);txtHelper.SetForegroundColor(D3DXCOLOR(1.0f,1.0f,1.0f,1.0f));txtHelper.DrawTextLine(LMPressF1forhelp”);>txtHelper.End();>ᙠ☢Ḅ"ṹÒ,✌ᐜ&ᵨDXUT᪾¾ᦪDXUTGetFrameStats();Ìᒹõìû¤᳛、ᑖj᳛、x'>?zb8OUUrzbÛḄܤT。Kᦪ¦ᨵo=¸ᦪ,ᢣ}]%ḄܤTQᔲᒹõ¤᳛1ê,ᙠûXK¸ᦪ(w×X。£,⊤9µ9ìû¤᳛。1ᩭ&ᵨ09070^0〜1p$^^()ᦪ;Ììû(ᜓḄrᐵÛ。ᐸ¦"ṹÛ4᧕ᳮ,ᙠûSvi³。3.ᜐᳮÏÐ_êᙠ☢ḄX61^6j81()ᦪÒ,2vÏÐḄ“F1”ÏᑗᣚQᔲµ9ᓫ1ê,J◤⌕ᙠÑÒᜐᳮÏÐ_ê。wû,✌ᐜw091᪾¾üLᜐᳮÏÐ_êḄ%&ᦪ,ᐸ"ṹ᝞。DXUTSetCallbackKeyboard(KeyboardProc);ᐸÒ《^^(^^?QᜐᳮÏÐ_ê%&ᦪḄᐹ#R,[᦮"ṹ᝞。voidCALLBACKKeyboardProc(UINTnChar,boolbKeyDown,boolbAltDown,void*pUserContext){if(bKeyDown){switch(nChar)caseVK_F1:g_bShowHelp-lg_bShowHelp;break; 0᱄æM᪾Oooo2654.³ÃrᐵI^ᙠ000309[08〖0696()ᦪ€^^0309005Ḅ>^^^6()ᦪÒ8¹"ṹ,³ÃrᐵI^,᝞ᡠ9。voidCALLBACKOnD3D9LostDevice(void*pUserContext){if(g_pFont)g_pFont->OnLostDevice();SAFE_RELEASE(g_pTextSprite);SAFE_DELETE(g_pTxtHelper);>voidCALLBACKOnD3D9DestroyDevice(void*pUserContext){SAFE_RELEASE(g_pFont);>Rᙠ090×?^1^9ÑḄ$ᦔW᝞16.2ᡠ9。D3D916.03rpsVsyncon(398x301),X8R8G8B8ff)?4X8)HAL(hMvp):ATIMobilityRadoonHD3650PulMhaleverrrMscslalushere16.2ᵨ091;1᪾¾¿ᑴBCᦻ16.4ᵨ091^Qᵨᡝ1ôḄ@⌕ᡂ%ᑖ,w¯JᵨᡝvÄ,3◤⌕ᙠÑ☢Ò8¹ᔜ*。0901᪾¾Iᔜ*Ḅ¿ᢝ。☢809^^0^9ÑwẠ,^9᝞<ᵨᔜ*091^。wᵨ09^,✌ᐜ◤⌕w⚗p8¹rKḄ09ô×᪾¾ᦻ,ᒹ091^§07.11、DXUTgui.cpp、DXUTres.h、DXUTres.cpp、0᱄1^6ÀG8(11Íà<00L861᝞Î8ÀÏGᓹ。16.4.1*+ᓄI)᪾w¯J¹ᜐᳮᔜonḄ_,23ᐜᙠïUÒ¹DXUTI)᪾,ᯠxᙠI)᪾Ò8¹rKḄ,,ᵫI)᪾ᩭ¶ᳮ。ᙠDXUTF^ame9ÑÒ,}©}=I)᪾。wko¶ᳮᔜI)᪾,R◤⌕}©〇017^7310§'50È6p3¿8675Ḅo=,᝞ᡠ9。CDXUTDialogResourceManagerg_DialogResourceManager;CD3DSettingsDlgg_SettingsDlg;CDXUTDialogg_HUD; 266000Î16UCDXUTDialogg_SampleUI;003056È1^04Q8"(^30Ḅ]ᵨJ(0L830(ᜓ}ឋḄI)᪾5,wᐸ8¹rKḄ,,Iᔜ_n$ᜐᳮ。Rᙠ,¦◤⌕IK5ḄÉo5ᢕ1ᔴ804n$rKḄ*+ᓄ,,ᙠÑ⌨Èû³ÃrKḄtVe8。I)᪾Ê,00^5&0^^ûQ5=᪗ZḄ09『I)᪾,e88ÐÚÄQḄ4ᘤ。✌ᐜ*+ᓄ}=I)᪾,ᯠxwg_HUDg_SampleUII)᪾8¹,(ᜐᳮ_Ḅ%&ᦪ,JÃÄᵫ)}©Ḅ1&1??()ᦪ_`。voidInitApp(){//*+ᓄI)᪾g_SettingsDlg.Inxt(&g_DialogResourceManager);g_HUD.Imt(&g_DialogResourceManager);g_SampleUI.Init(&g_DialogResourceManager);//wg_HUDg_SampleUII)᪾8¹,"ṹᶍ//w9_ᓽ09_8&Í161;1I)᪾(_êᜐᳮᦪg_HUD.SetCallback(OnGUIEvent);g_SampleUI.SetCallbacK(OnGUIEvent)>1ᩭ,ᙠ03090D16067^()ᦪÒ8¹8"ṹ。V_RETURN(g_DialogResourceManager.OnCreateDevice(pd3dDevice));V_RETURN(g_SettingsDlg.OnCreateDevice(pd3dDevice));ᨬxᙠ€^0309X68v〜¥^0ᦪÒ8¹8"ṹ。V_RETURN(g_DialogResourceManager.OnResetDevice());V_RETURN(g_SettingsDlg.OnResetDevice());/"7(I)᪾{^Xyg_HUD.SetLocation(pBackBufferSurfaceDesc->Width-170,0);g_HUD.SetSize(170,170);gSampleUI.SetLocation(pBackBufferSurfaceDesc->Width-170,pBackBufferSurfaceDesc->Height-350);g_SampleUI.SetSize(170,300);16.4.2Fᙠ(^0309?1^1^'^^()%&ᦪÒ,&ᵨᔜI)᪾Ḅ01^^1^ᦪFI)᪾,^XI)᪾ᒹõḄFÈᩭ,"ṹ᝞。voidCALLBACKOnD3D9FrameRender(IDirect3DDevice9*pd3dDevice,doublefTime,floatfElapsedTime,void*pUserContext){HRESULThr?//᝞Wìᙠᑭᵨ012^€^30(ᜓ(I)᪾n$(,ᑣSFif(g_SettingsDlg.IsActive()){g_SettingsDlg.OnRender(fElapsedTime);return;>//Ð◀x'7⁐õU>õ ᱄LM᪾Oooo267V(pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_ARGB(0,45,50,170),1.0f,0));//F2if(SUCCEEDED(pd3dDevice->BeginScene())){RenderText()?V(g_HUD.OnRender(fElapsedTime));V(g_SampleUI.OnRender(fElapsedTime));V(pd3dDevice->EndScene());>>16.4.3ᜐᳮ_wᜐᳮ_,✌ᐜ◤⌕ᙠ^£?『%0ᦪÒ8¹8"ṹ。//wI)᪾tV¶ᳮᘤᜐᳮᐰþ_ê,^e8ìᙢfH0111G᝱*pbNoFurtherProcessing=g_DialogResourceManager.MsgProc(hWnd,uMsg,wParam,lParam);if(*pbNoFurtherProcessing)return0;if(g_SettangsDlg.IsActive()){g_SettingsDlg.MsgProc(hWnd,uMsg,wParam,lParam);return0;>//wI)᪾ᐜᜐ_ê*pbNoFurtherProcessing=g_HUD.MsgProc(hWnd,uMsg,wParam,lParam);if(*pbNoFurtherProcessing)return0;*pbNoFurtherProcessing=g_SampleUI.MsgProc(hWnd,uMsg,wParam,lParam);if(*pbNoFurtherProcessing)return0;1ᩭ,ᙠ01^^q?6P()ᦪÒᜐᳮ_。8_50«7ᔴ80ᓃI)᪾Ò_Ḅᜐᳮ,ÊᙠCD3DSettingsDlg5Ò。ᡠ8¦◤⌕ᙠ%&ᦪnGUmventÒᜐᳮI)᪾g_HUD8_5&0^16011ᦈᑮḄ_。ᙠû,¦I8_^10I)᪾ÒḄ_n$ᜐᳮ,᝞ᡠ9。switch(nControlID){caseIDC_TOGGLEFULLSCREEN:DXUTToggleFullScreen();break;caseIDC_TOGGLERBF:DXUTToggleREF();break;caseIDC_CHANGEDEVICE:g_SettingsDlg.SetActive(lg_SettingsDlg.IsActive());break;>ÆᐶLḄ/ὅe8ᙠûẠ,Ip_5&00^。1I)᪾ÒḄ_n$nopᜐᳮ。16.4.4³ÃI)᪾ᙠÑ⌨Èû,◤⌕³ÃᔜI)᪾ᓰᵨḄtV。wû,ᙠ0^030910810^1(^()ᦪÒ8 268000Î16U¹8"ṹ。gDialogResourceManager.OnD3D9LostDevice();gSettingsDlg.OnD3D9LostDevice();ᙠ(>10309068᝞706ᕸ6()mᦪÒ8¹8"ṹ。gDialogResourceManager.OnD3D9DestroyDevice();gSettingsDlg.OnD3D9DestroyDevice();9Ñ09-^1^1^Ḅᐸ¦Rd⁚,è¸ὃV"ṹ。Rᙠ,0᱄^30^Ḅ$ᦔW᝞16.3ᡠ9。D30911.15fpsV%^ncon(640x480).JHAL_ᕲATIMobHityR^toonM0:Pul_haie#wmHcti^ushtitContvoHff1loMc^.Ouif:FSC116.30᱄0LÇhᙠÑ$î,ᢥ“F2”ÏᡈᓫDïôḄ“ChangeDevice”ᢥ,ᑣBµ98"830(ᜓ(I)᪾,᝞16.4ᡠ9。16.40^830(ᜓ(I)᪾16.5ᔠ¯^⁚2vJᔠ00^185ÇÇ,^9᝞Create(pd3dDevice,L"Media\TerrainTexture•jpgn,L"Media\heightmap.bmpH);g_pDomeSky=newCXFileMesh();g_pDomeSky->Create(pd3dDevice,L"Media\SkyDome.x");5)ᙠ0«0309&3^0^^()%&ᦪÒ,(e8▣ᢗ/▣,"ṹ᝞。//`,(me8▣D3DXVECTOR3vEyePt(0.0f,5.0f,-15.0f);D3DXVECTOR3vLookatPt(0.0f,5.0f,30.0f);D3DXVECTOR3vUpVec(0.0f,1.0f,0.0f);D3DXMATRIXA16matView;D3DXMatrixLookAtLH(&matView,&vEyePt,&vLookatPt,&vUpVec);pd3dDevice->SetTransform(D3DTS__VIEW,&matView);//`,(ᢗ/▣D3DXMATRXXA16matPr03 270oooÎ16Ufloataspect=((float)pBackBufferSurfaceDesc->Width)/(pBackBufferSurfaceDesc->Height);D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI/4,aspect,1.0f,1000.0f);pd3dDevxce->SetTransforra(D3DTS_PROJECTION,&matProj)?ᙠûXÌ9ᜮ#Ḅ>?(wx'>?ḄOå。VwìᦋLïôXyî,0ᓄ830(ᜓBÅᜫ,^091×᪾¾B&ᵨ(^)309X65^069&()%&ᦪ,ឮcrᐵ(。Jî0×᪾¾⌴1^309X68610ôᑍ6()ᦪḄ?330w8^[66^^06068。¸ᦪ,ᢣᔣHḄx'>?}ឋ,^e8᪷£ìûx'>?ḄO@HTÌ9ᜮ#Ḅ>?。ᡠ8ᦋLïôḄXyåx,-ᯠØT&8ìḄ>?µ9。ᙠåûḄ9ÑÒ,XÌ9ᜮ#Ḅ>D(wᨬ*ïô(ᡝḄOå,ìïôᜧÞᦋLåx,Ôᨵ@H(Ì9ᜮ#Ḅ>?,ᡠ8µ9eØBL。6)ᙠ01^^^^Ã(ᢓ᝞()%&ᦪÒ,(óᐝ、ᩞW8OFG᝱,FᙢᜩI^,"ṹ᝞。//(óᐝᩞWSetLights(pd3dDevice);SetMatenal(pd3dDevice);//([ᳮ▤fG᝱pd3dDevice->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP—MODULATE);pd3dDevice->SetTextureStageState(0,D3DTSS_COLORARGl,D3DTATEXTURE);pd3dDevice->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE);pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_DISABLE);pd3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);pd3dDevice->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);//(ᐸ¦FG᝱//FᙢD3DXMatrixIdentity(&g_matTerram);pd3dDevice->SetTransform(D3DTS_WORLD,&g_matTerrain);g_pTerram->Render(pd3dDevice);/&µFᜩD3DXMATRIXA16matScale,matRot;D3DXMatnxScaling(&matScale,100,100,100)?D3DXMatnxRotationY(&matRot,-0.2f*fTrme);g_matSky=matScale*matRot;pd3dDevice->SetTran8forn(D3DTS_WORLD,&g_natSky>?pd3dDevxce->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);g_pDomeSky->Render(pd3dDevice);ᐸÒ560^¦()5“p3᝞81()ᑖQᙠ^ᓄ(^ᦻÒRḄᵨJ(ᐝVᩞWḄ)}©ᦪ,ᐹ#RèÅÚV"ṹ。7)ᙠ000309068(^^D()%&ᦪÒ,³ÃᙢᜩI^,"ṹ᝞:if(g_pTerrami=NULL)g_pTerraxn->Destroy();SAFE_DELETE(g_pTerrain);if(g_pDomeSkyi=NULL)g_pDomeSky->Destroy();SAFE_DELETE(g_pDomeSky);Rᙠ,$Jᔠ001!^1^531?16,ᐸ$ᦔW¾ó^»ÒḄ9ÑD0mSky5D。 0᱄1^M᪾Oooo27116.5.38¹ú¹Þ⁚Xᙠó〗4»Ḅ90×5^ᔴ9ÑÒRḄØᑮ€011^16%$311^^JᔠÒ,8¹ú¹ᦔW,ᐹ#p᝞。1)ᙠ1^»^ôôᦻÒ,ᒹõ8(^3ᜮᦻ。2)ᙠ““§ÍôᦻÒ,}©rᐵᐰþL,᝞ᡠ9。IXACT3Engine*g_pXACT3Engine;IXACT3WaveBank*g__pStreamingWaveBank;IXACT3SoundBank*g_pSoundBank;XACTINDEXg_lCue;HANDLEg_hStreamingWaveBankFile;void*g_pbSoundBank;CRITICAL_SECTIONg_XACTcs?boolg_bHandleStreammgWaveBankPrepared;boolg_bHandleSongStopped;3)XᙠXACTStreamlng9ÑÒRḄInltXACT()、UpdateAudio()、XACTNoti-ficationCallback(),8O€16&¿99(^()Z=ᦪcᑴᑮ0(»1^^520^16JᔠḄp30?ᓹÑᦻÒ。4)ᙠ〜11^^4()ᦪÒ,ᙠnᐭ_ê+úåû,&ᵨ^19(^()ᦪ,[ᡂrKḄ*+ᓄvÄ,"ṹ᝞。//*+ᓄ80^if(FAILED(InitXACT()))5)ᙠ(^^0^^(^0%&ᦪÒ,&ᵨG33'10()ᦪ,fH᱄ᓚ×¹⚣Awᜐᳮ,ÂÃú¯¹。6)ᙠ^!^G()ᦪÒ,ᙠ_ê+úåx,⌨ÈÑåû,&ᵨ(^3¿ô᱄0^()ᦪ,n$rKḄÜᳮvÄ。16.5.48¹ÒᐭᜐᳮÞ⁚Xᙠó15»Ḅ'7^3Í89ÑÒRḄØᑮ000^165&0^^JᔠÒ,8¹ÏÐÒᐭᜐᳮ,ᐹ#p᝞。1)Xᙠ'>^(^41Í89ÑÒR01^>^0&01^>^(^4᜜0ᦻ8¹ᑮComplexSample3^p。2)ᙠ“91^ôôᦻÒ,ᒹõ01'760&«11ᜮᦻ。3)ᙠ1^È00?ᦻÒ,}©rᐵᐰþL,᝞ᡠ9。IDirectInput8*g_pDirectInput=NULL;CDIKeyboard*g_pDlKeyboard-NULL;4)Xᙠ]67©08141Í'9ÑÒRḄ1¦0ᓄ(^1Í80、UpdateDirectInput()&O5^^40%1^7ᕸ11ÍD()}=ᦪcᑴᑮ0011^165311^16JᔠḄ43±WôᦻÒ。5)ᙠ^ᔖᕸ()ᦪÒ,ᙠnᐭ_ê+úåû,,ᙠ_`ï]åx&ᵨ18X81Í£)ᦪ,[ᡂrKḄ*+ᓄvÄ,"ṹ᝞。 272000Î16Uif(FAILED(InitDirectInput(hInstance,DXUTGetHWND()))){MessageBox(NULL,L"^]^ftDirectlnput5feiKC!",L"ComplexSaraple",0);return0;}ᙠ☢Ḅ"ṹÒ,&ᵨDXUT#ᦪDXUTGetHWND();ÌDXUT᪾¾_`ḄïôḄ¥P。6)ᙠ0#ô0^4076()%&ᦪÒ,&ᵨ᝞<^60ᢕ81Í80ᦪ,fHÏÐÒᐭ。7)ᙠ&E᝞Ì)ᦪÒ,8¹8"ṹ,µ9QᔲᢥᔜVᜮÏ。if(g_pDIKeyboard->IsKeyPressed(DIK_LEFT)==true)txtHelper.DrawTextLme([_'ᢥ·Vk-Ï1");if(g_pDIKeyboard->l8KeyPressed(DIK_RIGHT)==true)txtHelper.DrawTextLme(["ᢥ~VᜮÏ7");if(g_pDIKeyboard->IsKeyPressed(DIK_OP)-=true)txtHelper.DrawTextLme(^ᢥVᜮÏ7");if(g_pDIKeyboard->IsKeyPressed(DIK_DOWN>==true)txtHelper.DrawTextLine("ᢥVᜮÏ1")?8)ᙠWinMaln()ᦪÒ,ᙠ_ê+úåx,⌨ÈÑåû,&ᵨ8[^(^^0070^^8()ᦪ,n$rKḄoᳮvÄ。16.5.5RaÞ⁚Xᙠó11»Ḅ9^1506^&D869ÑÒRḄaØᑮ00^>^5311^>16JᔠÒ,ᐹ#p᝞。1)Xᙠ910D150606〔^7869ÑÒR€36^.11〔36^Ã?ᓹᦻ8¹ᑮComplexSampleJ^p。2)ᙠᾢᓄWᓹᦻÒ,ᒹõÍ^^^ᜮᦻ。3)ᙠ^&4.(^)ᦻÒ}©᤬!I^,"ṹ᝞。CCamera*g_pCamera=NULL;4)ᙠMain•CppᦻÒ,8¹᝞(1ᕸ€&ᖾ())}©ᦪ,᪷£ÏÐÒᐭìûßḄfH᤬!,KᦪḄR"ṹ᝞。voidUpdateCamera(floatfElapsedTime){//·~Vᜮ:ᦋLûn>ᔣif{g_pDIKeyboard->IsKeyPressed(DIK_LEFT)=»=true)g_pCamera->Yaw(-l.Of*fElapsedTime);if(g_pDIKeyboard->IsKeyPressedYaw(1.Of*fElapsedTime);//Vᜮ:ûnx⌨if(g_pDIKeyboard->IsKeyPressed(DIK_UP)==true)g_pCamera->Walk(10.Of*fElapsedTime);if(g_pDIKeyboar3->IsKeyPressed==true)g_pCamera->Walk(-10.0f*fElapsedTime);//᪷£ìûß》,(Î᤬!ḄD3DXVECTOR3pos;pos=g_pCamera->GetPos(); 0᱄1^M᪾Oooo273floatheight-g_pTerrain->GetHeight(pos.x,pos);pos.y=height+2.Of;g_pCamera->SetPos(pos);>5)ᙠ0#^ᢕ4(^60%&ᦪÒ,&ᵨ☢RḄ1^43〖6036£)ᦪ,fH᤬!。6)ᙠ000309?^0^^8^()&ᦪÒ,ᙠnFåû(e8▣,"ṹ᝞。D3DXMATRIXA16matView;g_pCamera->GetViewMatrix(&matView);pd3dDevice->SetTransform(D3DTS_VIEW,&matView);7)ᙠ&1^^1^1()ᦪÒ,8¹8"ṹ,µ9ᓫḄvÄ9。txtHelper.DrawTextLine(["·VᜮÏ:·Ã"txtHelper.DrawTextLine("~VᜮÏ:~Ã"txtHelper.DrawTextLine(^VᜮÏ:ûn"txtHelper.DrawTextLine(âVᜮÏ:x⌨"8)ᙠ€^0309068^^06v^^0%&ᦪÒ,³Ã᤬!I^,"ṹ᝞。SAFE_DELETE(g_pCamera);Rᙠ[ᡂJᔠ€^1^^530^16,,$KJᔠ,ᦔW᝞16.5ᡠ9,ᙠÑ$vÑÒ,RBSeÂÃú¹。hfkk^:hY.^S:^tt:^K.1»Ë»:«×^Rft*JP,*Qu<:(SC116.5ᔠ¯^(^00^^53æ 16ḄAᦔ®16.6»✌ᐜᑖ᪆ᓹ9ô×᪾¾Ḅ3ᵨ%&ᦪ,ᵨ09『᪾¾ᑏ0ᓄ830ÑḄ⌕ÃÄQRJ&ᦪ;ᯠxCDᵨ091×᪾¾Ḅp,8O᝞<ᵨ091_1×᪾¾RBCᦻḄ¿ᑴḄF÷¶ᳮ;ᨬxÈo=JᔠḄᐹ#Rp,8/ὅØTü¤ḄKᵨ:#。ᵨ091×᪾¾e8Ñᕒ^ᜧñ、@-@cḄÃÄÒῃÈᩭ,X⌕ÖÔᢗᐭ 274oooÎ16U᪶"ṹḄᑏvÑÒ,V ᨵᑭJï´ÃÄ,¹üÑḄ:#¤,ÃÄᦔ᳛。a!1.ÅÚᡠᨵDXUT᪾¾ᜮᦻḄᑁ4,091×᪾¾ḄØ。2.xÚᦻ᫏,09。×᪾¾ḄᔜØᦪ%&ᦪ。3.Xó10»ÒḄ9Ñ?0^^?[᝞ᑮ0᱄0×᪾¾,,ᵨ030?00[_DEFAULTR#ü_`FjkḄ⚔A>?。4.Xó13»ÒḄ9Ñ^^1〖<^1^^ᔢ£^1ᑮ09。×᪾¾。 ▬C08□0^3010.08□&3011ᙠó1»CD0ᓄ830îᑮv,pûQ8"8309、0^^1301007(^3011}=᱐ᐳ?。ᵫJ883010ᓹ7(^3011¦Ø$J%(10〜8¥78〖&〜^᝞〜87á'å,0©D3〇9ØTî$Jpû-ᯠᓰOḄ^^0〜5᱄?8OᨬHḄ¥4(1(^5%ᕸWindows7jkå,K&Direct3D9ᐹᨵfâḄ〉Kឋ,wû-ᯠᵨ0^8309。PQw/ὅØTI07G130ᨵo=fᐰ☢Ḅ,ᙠ▬2ÒI0^È0100^È011n$⌕CD。A.1Direct3D10Windows%¿ᢝᐰHḄµ9ÉÎU`,Kµ9ÉÎU`"⊤)^ᵨJ”ᓄ(1(^8988ᩭo71^0^8ÉÎU`(WDM)Ḅ⌕Lᓄ。Jo@H(TḄU`I᧜f⚣h^20ᐝ᪕ᓄvÄ001KᵨÑ⚞r,ᔣᵨ³}ØhḄ30ab,8OᨬÐᔣ¿ᢝfᜧឋØKᵨÑḄR"eÑᜐᳮᓫᐗ(GPU)Ḅ^L。wᐙᑖ#ᢵHḄ…ᓄ᝞>^978〖&ÉÎÑU`(WindowsVistaDisplayDriverModel,ᑏw〜00^o"hḄØ,9:o=ᐰH᱐Ḅ07"(^30?1,ᓽDirect3D10。0783010ᨬ*Qd078950R(December2006)#Ḅ。A.1.101□¹010FOà+^0ᓄ8309ᑮ0ᓄ^3010,w᪀`ᐰHḄF#j,¹£o"ab30iÝ#KᵨÑḄØ,8830Ḅj¾᪀#n᪷Lᓄ。Direct3D10[ᐰᑤ◀³}ØOà+,ᵨeÑ$᪀Ì"³}Ø$᪀,,᩽ᜧᙢᓄᑁ%R。Direct3D10ḄFOà+᝞.1ᡠ9,e8ᵨ0ᓄ83010?1IFOà+ÒḄᡠᨵeÑ▤fn$,ᐸÒᔜ▤fḄÄᵨ᝞。•Òᐭùᘤ▤#(Input-AssemblerStage)K▤f_`wOà+ᦪ£(}、+8OA)。*•⚔%Ḽ⁐ᘤ▤'(Vertex-ShaderStage)K▤fᜐᳮ⚔A,23᡻$Lᣚ、ℳ8Oᐝ᯿¶vÄ。⚔AḼ⁐ᘤḄÒᐭQᓫ=⚔A,,nᡂo=ÒÈ⚔AB•()Ḽ⁐ᘤ▤'(Geometry-ShaderStage)K▤fᜐᳮ᦮=ᐗ。K▤fḄÒᐭQ᦮=ᐗ(IJ}Q}=⚔A、IJ+Q5=⚔A、IJAQo=⚔A)。û᜜,Z=ᐗRe8ᒹõ÷Uê1ᐗḄᦪ£。e8ᨬiw}w᜜}=⚔A,w+fᨬiew᜜5=⚔A。IJo=Òᐭᐗ,Ḽ⁐ᘤe8ÅxKᐗ,ᡈnᡂo 276ooo▬C=ᡈi=Hᐗ。•OÒÈ▤f(Stream-OutputStage)K▤f_`^Oà+2vOᔣᑁ?ÒÈᐗᦪ£。ᦪ£e82vOÒÈᡈ⌴ᐝ᪕ᓄᘤ。ÒÈᑮᑁ?Ḅᦪ£,e8@HÄwÒᐭᦪ£ÌÃᐭOà+Òᡈ^0?0/Ì。•ᐝ᪕ᓄᘤ▤f(Rasterizer-Stage)K▤f_`úûᐗ、w²Ḽ⁐ᘤZᜓᐗ,8O}Qᔲ&ᵨ²Ḽ⁐ᘤ。•²Ḽ⁐ᘤ▤f(Pixel-ShaderStage)K▤f1ᦈwᐗn$òxḄᦪ£,,nᡂ⌲²ᦪ£,᝞7⁐。•ÒÈᔠ,ᘤ▤f(Output-MergeStage)K▤f_`Xᔜ*5`ḄÒÈᦪ£(²Ḽ⁐ᘤÒÈḄᦪ£、UUr1ê)Fp᪗ᑁ48OU/Ur>?ᑁ4$ᔠ®ᩭ,nᡂᨬÐḄFOà+$W。.10ᓄ83010FOà+2v☢ḄCDe8ÚÈ,Direct3D10FOà+3ᮣR,ᐹᨵḄ〉Kឋ。÷Direct3D9FOà+r,DirectX10FOà+ḄᨬᜧLᓄQ½¹|<Ḽ⁐ᘤ▤f(705ᓫᐗ),2v|<Ḽ⁐ᘤe8w6?。z1ᜐᳮUr▢/ᱯᦔ(StenciiShadows)、Î᝱ᔣ᧜](Dynamiccubemaps)Oßc(Displacementmapping)¶vÄ,ᙠvyJvÄQᵫ0?。[ᡂḄ。û᜜,|<Ḽ⁐ᘤᨬe¿ᢝ1024=⚔Aᜐᳮ,îeS⌕Ḅ⚔Aᦪ£ᑤ◀,J5⚗Ø´¿XᐹᨵfḄᦔ᳛。◀½¹|<Ḽ⁐ᘤ▤få᜜,DirectX10FOà+÷8^8309FOà+rᐸ,ÔᨵᦋL。⚔AF÷²F@Sn$,¦Qᙠhj,FÃÄSÙᵫäḄ⚔AḼ⁐ᘤ、²Ḽ⁐ᘤn$,QÊ2ᵨḄkoḼ⁐ᘤ(ᡈὅÛkoFᓫᐗ)。A.1.207「6&3010Hᱯ0ᓄ83010[ᐰᑤ◀0^È09ÒḄᦪ=Øß,Ì"åḄQ(TÐḄ、¦ᨵ´ Direct3D10.08□083011ooo277ᦪe⌱Ḅ┐Iᱯ}tVzbḄᵨ ©ḄØᔠ,,᩽ᜧᙢᓄ0?0Ñ÷z。DirectX10·ᡂwóo*/0h(TḄ?1——koFOà+"/kḄᑖãF,^ØtGPUfḄFᦔ᳛eÑØÔ。៉07^8309Ḅ:#ᕒ,ᙠ07^(^3010ÒXB#Rojᑡؽ£ឋØᓣ,ᒹ8>☢。•ᙠHḄ|<Ḽ⁐ᘤ▤fᜐᳮ᦮=ᐗḄØÔ。•2vOÒÈ▤fᔣᑁ?ÒÈOà+nᡂḄ⚔Aᦪ£ḄØÔ。•ᵨ5=SLḄG᝱I^(Oà+G᝱,^e8füᙢOà+。•ᵨ3>?(Ḽ⁐ᘤ3,wḼ⁐ᘤ3ᦪ£eØhi$O_Ñ。•᡻$⌲ᐗᩞWÊᣚ8Oᵨ|<Ḽ⁐ᘤn$(ḄØÔ。•HḄtV5`(ᒹØT^Ḽ⁐ᘤ@AḄ[ᳮᦪ)tVzb。•ᵨftVEḄ2ᵨឋ。•ᑤ◀8“309ÒḄhØß。•ᑖjḄ$î,Direct3D10?1ᵫi=j᪀ᡂ,᪶jØ,᜜je⌱Ḅ#:#ᕒn$:#ḄØ。•[ᐰḄÒ5[ᡂ,ᡠᨵ0^D3010Ḽ⁐ᘤ-Qᵨi^1ᑏḄ,,Qᵨ2ᵨḼ⁐ᘤᑁ᪶(Common-ShaderCore)RḄ。•½¹Fp᪗、[ᳮ8O¬᪵ᘤḄᦪ,,Ḽ⁐ᘤḄ«Ôᨵ▲ᑴ。•᦮`Ḅ⌲ßḄḼ⁐ᘤvÄ。•oSÙÄwFp᪗,e8%/(readback)U/Ur⊤☢ᡈi¬᪵tV。•i¬᪵31ô1^40-0(^^^6¿ᢝ0IJ8ûḄf⚣h,⌕¿ᢝᡠᨵ883010Hᱯ,⌕SQ883010r4µᓱ,Seئ¿ᢝ%ᑖ07ᕸ13010Hᱯ。ᡠ8,S0^8309e8ÉÎ078᱄7î"ḄhÖ᪵(ÓᯠeØ)ØS¿ᢝ),Direct3D10¦ØᙠHo"µᓱÃÄ。IJ¿ᢝὁµᓱḄKᵨÑ,8·¿ᢝ07"83091ô。Xᩭ᱐Ḅ07H130X᪀`ᙠ0^83070å,8᡽/H᱐Ḅ?1,&Q0^83010ØḄ。ᙠ01"89SDK(March2008)᱐Ò,Direct3D10ᓣᑮ07"。13010.1。0^83010.1I0^83010?1n$᡽/,Direct3D10.1½¹e⌱Ḅ1ô8O▬¹ḄḼ⁐ᘤU`,8¿ᢝÖ¿ᢝ0^D3010.1Ḅf⚣µᓱḄHhᱯ。ᡠᨵ¿ᢝ883010.1Ḅh·[ᐰ¿ᢝ^83010,,ab:#ᕒe8ᵨ883010.1Ḅ▬¹ᱯ。9:Direct3D10.1Qᑩ'0〜87Y☢ᵨḄ?1。 ᑩ'0ᢓ975(3jḄAwSDirect3D9。A.208「6(^3011Windows7᪀`Æ”1^0~8¥413Oà+å,▬¹Ḅᱯᓹ1。〜1ᓄ(^^7¿ᢝHḄ0^^^30᱐,mDirect3D11。Direct3D11Qd07。1᱄50«:(August2009)#Ḅ,Direct3D11ᙠAᐭHᢈGḄî&ᶇ07^^3010.1Ḅᐰ%ᱯឋ,8QDirect3D10.1Ḅ。 278ooo▬CA.2.1Direct3D11HᱯDirect3D11᪀`J07ᦝ13010.1?1å,^DirectX11S¦QᓫḄᓣ,8Aᐭ¡i@⌕ḄHᱯ。ᐸÒ⌕ḄHᱯᒹ8Z=>☢。•T,Ḽ⁐ᘤ•Î᝱Ḽ⁐ᘤë1•i+Ñ¿ᢝ•h╨Ò☢✌ᐜIJZ=⌕ḄHᱯn$⌕CD。1.TḼ⁐ᘤ(ComputeShader)TḼ⁐ᘤQo=eÑḼ⁐ᘤ▤f,8ÔᨵÌz1ë1ᑮᐸ¦Ḽ⁐ᘤ▤f。TḼ⁐ᘤᐸ¦eÑḼ⁐ᘤo᪵,·Qᵨ^151(TRḄ。÷0910ÒAᐭḄ|<Ḽ⁐ᘤSḄQ,TḼ⁐ᘤ,SQFOà+Ḅo%ᑖ,8Ḅ⌕ᵨ⌶ᙠJ½£0?。Ḅ2ᵨTØÔ。TḼ⁐ᘤ¤Ḅ2ᵨTØ,,ØTᑭᵨ0ᓹ0ÒᜧḄ,$ᜐᳮᘤ。TḼ⁐ᘤᑁ?ᐳÌ+Ñpᱯ,^e8ᵨf¹ᦔḄ,$Ñ>。Iab(#ὅ¡,3ÈJ)*◤⌕6?0Ø᡻$2ᵨTᢣ$,P8iḄF$᪀ᓾIGPU⌼ᡂÞiÔÕo᝞Û,Ñᕒe8ᙠo=²Ḽ⁐ÑÒ£$¹ᐭ2ᵨ,PᓾNdUᑭᵨÞ᝞᪛$᪀å5Ḅᦪ£$᪀,JÑᕒ$ᩭᜧḄÖ2。Vwᙠ²ÿᐳÌᦪ£ḄvÑ32ᳲ,ᐜ¿ᑴ}ᦪ£$᪀、Ù¹ᐭcQoḄ.>ᫀ,PJX|@/00?0ḄFឋØ。ᙠ07^(^(11TḼ⁐ᘤḄ,èᩭḄab:#ᕒXSÙÞJû,¦Ðe8z1gvcᩖḄᦪ£$᪀,,ᙠJᦪ£$᪀Ò$fiḄ2ᵨ。 JXᵫTḼ⁐ᘤ]_`,SBFᓫᐗ$ᩭw᜜Ḅ_ÿ。2.Î᝱Ḽ⁐ᘤë1(DynamicShaderLinkage)wIḼ⁐ᘤn$¶ᳮ8eØÚᓄḼ⁐ᘤ"ṹ,Fjk◤⌕[ᡂᜧcᩖḄÃÄ。ì◤⌕2vâ▎Ḅh,ᙠo=FÒ¿ᢝᜧᨬSḄᩞWî,E⚪BL´f¹cᩖ。w.JE⚪,Ḽ⁐ᘤ:#ᕒ3ÕJ5*>åo。o*>Q_`ᒹõᐰ%ᱯḄ“uber-shaders”,J*Ḽ⁐ᘤØᱨo}ḄឋØ8ᣚÌᡠ◤⌕ḄᮣRឋ,=᜜o*>Q]wZ=O◤⌕Ḅóᐝ5`ᩞW5`_`ᓫäḄḼ⁐ᘤ。ó-*>2vᵨSḄ⚜ᜐᳮᘤ}©@HrḄḼ⁐ᘤᩭ.J*ᔠE⚪,óB*>£ᑴ:#ᕒ_`.KE⚪,wû:#ᕒ3 ᙠ¦ÐḄabOà+Ò¶ᳮᦪᓟ=SḄḼ⁐ᘤ᣸ᑡ。Dircct3D11Ḽ⁐ᘤU`5Aᐭ/☢ᔣI^ ¡Ḅ$᪀,,wḼ⁐ᘤë1$î¿ᢝ,8:#ᕒ.JḼ⁐ᘤᔠE⚪。Î᝱Ḽ⁐ᘤë1ᵨ1ôᦪᑖᒘḼ⁐ᘤ"ṹf,,ᐕ¡KᵨÑᙠ$î⌱à⌕ᵨḄf。J*>2vz1u}ᡠ◤⌕ḄḼ⁐ᘤ"ṹ8ឋØ。3.i+Ñ¿ᢝ’¡iKᵨÑᵫJὑîḄ0?0vÄ,᝞ᔊ、I^᣸8Oᱥᳮhi¶,´0?。ᡂwÚ⚠。¶Rᙠi᪶jkL´gᩭgý,z᪶ᜐᳮᘤºᡂw?0:jkḄ᪗Zᜓ,}᪶、Z᪶fQnᐭOÜ。ᯠ ,Rᙠ¦ᨵwᦪSiḄabo¸ØTIi᪶á Direct3D10.08□3011ooo279'ÐḄ¿ᢝ,lVᙠJ,ᵨ8û᱐Ḅ01^^30wi᪶á'ÑᓝᑖÞã。᝞W¬ᵨ8^8911Äw:#á',Ö"ṹHØz1¿ᢝi᪶á'。DirectX11ᙠj1¶i᪶á'ḄtVᑖ«E⚪,0^^11⚜9Ḽi+ÑabiìpᐭR。᝞IJoᝅZ᪶abá',ìᙠÒFo=⁐8Ḅ}=î,DirectX11BÖÎZ=+Ñn$,$ᜐᳮ,ᦔ᳛µᯠ⌕pûᓫ+ÑᜐᳮḄ>b⌕ü´i。Ditect3D112v8Øwi+Ñ¿ᢝ。•ᙠᓫäḄ+ÑÒ,$_`I^——I^_`ᐭôASÙ+Ñu}ᙠo®,^i=+ÑØTî_`I^。᝞,ìKᵨÑᙠo=+ÑÒn$Fî,e8ᙠ=᜜o=+ÑÒḼ⁐ᘤᡈ¹[ᳮ。•ᙠi=+Ñ_`X$ᑡ⊤——X$ᑡ⊤Qµ2ḄX$ ¥。Direct3D11e8ᙠi=+Ñ_`X$ᑡ⊤,ᡠ8ØTᙠi=+Ñ,$ᔊᦪ£?ᡈ,$n$ᱥᳮᜐᳮ。4.h╨Ò╨Òe8XôP(d⁚Ûi)ḄÒᐭ☢ᱏdᑖwfá¸Ḅî☢。Z=☢ᱏ(Z¼ᡈ})ÌᑖᒘᡂfÞḄ}☢,^e8fᙢUᡠ»Ḅ⊤☢。2v╨Ò,e8ᵨSḄd⁚Fo=U`,᪷£Ḅd⁚◤Õnᡂf¹ÖḄU`。IJe8ᵨfid⁚U`ᑖj᳛Ḅjk,╨Ò3@⌕,VwᙠF»ÿe8hiIᑁ?$OḄ◤Õ,ᨵᦔF¤。ᙠ01"(^3011Ò╨Òᵫ0?1R。Óᯠ2v:·Ø[ᡂ╨Ò,PQᵨhR╨Òe8nᡂᜧḄefᓄd⁚(ᒹ¿ᢝß᧜]),,X╨Ò÷z^0?0Ãᑮ0?0R,^e8µ℉KᵨÑḄឋØ。◀8Z=⌕ḄHᱯå᜜,0ᓄ^3011R¿ᢝ306¦8〔7[ᳮ/þzb、5.0᱐ḄḼ⁐ᘤU`、10ᓄ^19ᱯ÷>¥X?10:F(ᜓ。2v101^619ᱯ,Direct3D11ØTᵨo¿ᢝ0^8309Ḅµᓱ。9:%TDirect3DllAPI,〜(10^87ÁWX 0%011.1、Direct2D、DirectWriteñh,sᢝ>^00%1.1=M。A.2.208□(^3011FOà+Direct3D11FOà+¿ᢝᙠ8『^3010FOà+ÒḄr▤f,î½¹w᜜Ḅ▤f8¿ᢝḄØ,᝞.2ᡠ9。I.1.2e8#R,Direct3D11¿ᢝ}=HḄ▤f:᜜ÝḼ⁐ᘤ▤f、╨Òᘤ▤frḼ⁐ᘤ▤f,J}=▤fᵨJR╨Ò,ᔜ▤fḄÞ`ᑖ᝞。•᜜ßḼ⁐ᘤ▤f(Hull-ShaderStage)K▤f^ÒᐭᑴAnᡂÒÈᑴA(8O☢ᱏ3);ᑖj᳛JᑴAḄᵨᵫᵨᡝ.}。•╤Òᘤ▤f(TessellatorStage)K▤fXo=r(Z¼、}ᡈ+)ᑖᒘᡂ¡ifÞḄI^(}、Aᡈ+)。•rḼ⁐ᘤ▤f(Domain-ShaderStage)K▤fwÒÈ☢ᱏÒZ=ÌᑖᒘxḄAT⚔Aß。 280ooo▬CÒùᘤ▤f♦^_4_ᑁ[²c(⚔AḼ⁐ᘤ▤fy,.[—〈(᜜ÝḼ⁐ᘤ▤fy╨Ùᘤ▤¢~^~Ḽ⁐ᘤ▤¢>——(Z[、ᳮ、jÝZ[)(|<Ḽ€ᘤ;f>——=d~HÀ▤¢►ᐝ᪕ᓄᘤ▤¢>*1C.208A3011MN~A.308□^12O᪀(DXGI) 018¾᪀(DirectXGraphicsInfrastructure,DXGI)Q〜4(10%¥7818AᐭḄo=HḄjk,0961Ḅ⌕p᪗Q¶ᳮiḄ、ØTäJ8(^9$îḄ÷z。DXGIwXᩭḄo=2ᵨ᪾¾,óo=ᵨ0901ḄQ0^83010。ᙠ8û᱐Ḅ01^(^30Ò,JiḄ÷z,᝞Pph(ᜓ、ᔣÒÈÊF、âᑴ8O¶ᳮᐰefÃᣚ¶,-ᒹõᙠ0ᓄ830$îÒ。RᙠJ÷zᵫ0901_`。01×z1ᑁ᪶UbÉÎÑ8Ojkhn$21。KᵨÑîe8z10901I),·e8&ᵨᙠ0301000Ò}©Ḅ01830API(J?1ᜐᳮ0901åÿḄ21)。᝞WKᵨÑ◤⌕Pp(ᜓᡈᑴ᝞<ᔣÒÈÊᦪ£,ᑣeØz1ᵨ0901。KᵨÑ、、DXGI、µᓱÉÎ8Of⚣håÿḄᐵj᝞.3ᡠ9。A.4Û₞ᵨḄ08□^30᱐ᨬxÈ⌱àᵨ0^^130?1᱐Ḅ|ᩩlᑣ。•᝞WKᵨÑ¿ᢝᑩ'0^9?8O8û᱐ḄvÄjk,ᑣ¦Øᵨ0^831)9。•᝞W¿ᢝ$9?01(WindowsXPDisplayDriverModel)ÉÎÑḄ〜7^(^8Vista*Windows7,ᑣ¦Øᵨ078309。IJ´0L83010ᡈff⚣h¿ᢝḄ21^(^8Vistaᡈ20<50〜87,e8⌱àᵨᙠ\^᝞7^9?ÒᵨḄ078309"ṹ, Direct3D10.08「6^3011ooo281ᡈὅ2v8D13010.1^;Direct3D11ᵨ10^619ᱯ。1C.3bᵨM、12ñh、DXGI、[ᓱ=5*h#1Ḅᐵᙠᑩ1^0〜897D¥71^0^7jk,`Úᵨ0^83011,8ᐙᑖᑭᵨo"f⚣hḄØ。 ὃᦻ[1]▰ᓱ,¶.011^(^930Ñ(T^].ä:äåzᢈGÈ᱐",2003.[2]Charles,Petzold.〜4(10〜8Ñ(T[^].¤µz,.ᓅ:ᓅᜧzÈ᱐",1999.[3],¶.Ö288930÷ÎÑ(T^].ᓅ:RᵯÈ᱐",2007.[4]FrankDLuna.0Ì(^9.030ab:#ÑẠ^].fæ,.ᓅ:Ü¥ᜧzÈ᱐",2007.[5]WolfgangF.Engel.ᓹ&…ᓹabᡂᐭ]ᦟÑ㈧].2᱐,ᕜçè,éê,nᵂU,.ᓅ:RᵯÈ᱐",2005.[6]ât¡.^D1&+¿X839930ab:#A^].ᓅ:RᵯÈ᱐",2006.[7]AdamsJ,LaaMItheA.'X89ÎᑴÄ㈧].ᑢj,.@ì:@ìᜧzÈ᱐",2005.

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭