资源描述:
《directx游戏编程基础教程》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
ᐰ☢ᙢḄᔜ☢,⌕ᑁᒹ:!"#$%&'(Ḅ)Ạ+,、0»^^<./ᐵ12ᢈ45〜^^0#87Ḅᐵ、08930:;12<=>?@、A᱄C…DE⚣?@、08A1GHᐭᜐᳮ500LM᪾OPᑁ。R,TUVWXYZ[Ḅ]^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Ḅᑩ^0Vista、〜^(^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ᙠᐹ#ᵨîᑣS8ᕸ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Û>᠒。SvJ^£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^^^¯Kn。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+0830,ᑡ#/,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%44Ḅ⚣()*+,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,VhiKᵨÑḄ$ᦔ᳛。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。⌱þ+]Ḅ=,⌱þ]^MM6⌱þᔲ=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+á☢ḄÊA2.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ß>^0A5ÑÒ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$ᜐᳮ。ᙠ8m”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ᢕ36()ᦪ_`€01I^,e8ᐜ;Ì1'“(^01ôḄᢣ┐,ᯠx&ᵨ1'ᓃ(^^::ᓹû71·06()>ᩭ;Ìᡠ◤⌕ḄZ=1ô。PQW¦◤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、〜4Z812[ᜓ"(GraphicsDeviceInterface,GDI)、HAL<[]*håÿḄᐵj3.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ᵨ08300^ᦊ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。ÃÄGQ(ᜓḄì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`,If⚣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,ᒹFGIJK。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=},$ᦔW14.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'&[$ᦔW4.9ᡠ9。4.99Ñ1086!^$ᦔ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ô,◤⌕ᒹõ4340"ᜮᦻ,,◤⌕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?1I^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$ᦔW4.10ᡠ9。Û:cd᳛:¯DmMḄAd0,ᡠᙠ`éḄ]^MÊVµ[]MḄcd᳛。R,nð¶Õã·ᙢmbMḄAd0,ᙠç0ᓄ。13£>[ᜓD=030?£5¸1^_ᓹCC^L£8᪀Ḅ?9863^(^16^31ᡂᕒ[÷nD3DPRESENT_INTERVAL—IMMEDIATE.9:nð¶ᜐᳮFᩖḄÂg<56,ID3DXFonO^oᙠᑁ¹ᵨ〇01Uᑴᦻ,ᡠᙠឋ▁4.109Ñ×^120$ᦔWðàᶍᨵ»ᜫ。®UᑴḄᦻᦪA¼e,ᑣµ×[½MḄAឋð。4.7MNfFGᑴ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(FG0305^_?^[^^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ÈRJKe。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'ᵨ½(᪵FGD3DRS_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ᐵFGrᐵ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.39&ᙶ᪗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]=U1]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Ḅ。e82vFG030&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ᡷ32^^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,ᡠ8Wᱥ#⊤☢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ÍḄ$ᦔW6.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ᦔW7.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ᵨonẈᜋḄ[ᳮ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ᦔW7.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ᦔW7.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Ḅ$W7.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Ḅ$ᦔW7.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。Ñ$ᦔW7.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,ᡠ8Wᢣ}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$ᦔW7.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à+Qb,,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ᓄᜐᳮ8OUst}*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⁐ò,Vx¿ᑴḄᱥ#Ù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"ṹ。$ᦔW8.1ᡠ9。8.19Ñ1?1^81(1$ᦔW W]: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,$ᦔW8.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,VoᓄᦔWfÖ,P"PQTᜧ。JḄoᓄᦔW8.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ᵫMNfD3DRS_FOGVETREXMODEÇᑴ。vw34¬ᓄ,¬ᓄi6ᵫMNfD3DRS_FOGTABLEMODEÇᑴ。]^M?%ᵨᢣᦪ⚔@¬ᓄi6,ᐸ[÷9ṹ。g_pd3dDevice->SetRenderState(D3DRS_FOGVERTEXMODE,D3DFOG_EXP);3.2.HᓄQᦪ¬ᓄᦪᒹ¬ḄX⁐<ᵨwB¬ᓄ4¼^Ḅ/ᐵᦪ。(1)[÷¬ḄX⁐.¬ḄX⁐90305_?000^0MNf[÷。]^MF0g=¬ḄX⁐[÷n×X⁐,9ṹ。g_pd3dDevice->SetRenderState(D3DRSFOGCOLOR,D3DCOLOR_XRGB(45,50,170));(2)[÷B¬ᓄ£ᔠ4¼^Ḅ/ᐵᦪnBÀ¬ᓄ£ᔠ4¼C◤⌕᪷¸⌱þḄ¬ᓄBÜ6,ᵨ/ᐵḄMNf[÷vbḄ¬ᓄᦪ。ᐹgᒹ,nឋ¬ᓄ[÷?L<O2$,5nᢣᦪ¬ᓄ<ᢣᦪ¬ᓄ[÷¬Ḅ%0。MNfD3DRS_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);FGD3DRS_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ñᙊ,ᐸ$ᦔW8.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¼Àᦪ。ᐸÊ$☢MNfA¼íᓫ,☢u@-.`☢MNf。MNfD3DRS_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^FGD3DRS_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᱄WX030&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^()ÀᦪÊ,'ÀᦪḄv9ṹ。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"ṹ,$ᦔW8.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"ṹ,ᐸ$ᦔW9.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"ṹ,ᐸ$ᦔW9.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_iW©ᦻÔᨵᒹõ+ᦪ£,ᑣᵨ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"ṹ,ᐸ$ᦔW9.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,ᡠ8Wuµ(ᐝ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Ḅᔠ。•?306v3^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:82zM◀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,8O1ᳫḄÒ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"ṹ。ᐸ$ᦔW9.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`ḄQ8GjS$᪀(®ᩭḄ,=$᪀Òᨵ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ᔠ,ᵫFGD3DRS_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ᔠ,◤⌕XFGD3DRS_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ÐåÿḄᐵj9.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ê,,2vG$᪀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`᪾¾(¾)8G$᪀ᔠ®ᩭ;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ᦪ£Q8GjS(®ᩭḄ,ᐸÒᡂᕒ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`Q8GjS$᪀(®ᩭḄ,SffASD3DXFRAME_DERIVED^᪀5`,ᐸÒZ=᪾¾⁚A-2vD3DXMESHCONTAINER_DERIVED$᪀&?÷årᐵὶḄyzᦪ£。2)┐I=yzU`Ḅ}=vÄ:(▣、fH▣、F=U`,-◤⌕┐IG᪾¾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᪾¾⁚A8G$᪀(®ᩭ,^[ᡂℳÎ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ᓃḄ$ᦔW9.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`Ḅᵨ,PQW◤⌕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⊤]ÖÙμ,|niØÖÙᙠ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£FGwᡠᨵAÖᮣᢣ}rḄᜧÞ。9:®⚔@zᨵEL&ᓃᜐᳮḄ⚔@,ᑣ@Yᮣᜧ ×Æ1ᙶ᪗ᓫL0Ḅ。ᔲᑣ,@YᮣᜧMNµ᪗àḄ34nᓫL,wDµZ`☢ḄOö。óBp,᪷£FGD3DRS_POlNTSCALEENABLE,}AᜧÞḄT>b。WKFGw〖31#,ᑣXopÒᢣ}ḄᜧÞz1ÄwefÿAḄᜧÞ。WKFGStme,ᑣ᪷£☢Ḅ;bTAÖᮣᙠefÿÒAḄᜧÞ。ᐸÒ:•ᡀwÑÒwZ=Aᢣ}ḄᜧÞ,ᡈᵫFG030X5』0Ì×512£wᡠᨵAÖᮣᢣ}ḄᜧÞ。•A、B、0nᦪ,ᑖ,ᵫMNf0308_?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ᵫFGD3DRS_POINTSIZE_MAX(ḄᨬᜧXy,·SØÞJᵫFGD3DRS_POINTSIZE_MIN(ḄᨬÞXy。ᐸÒ030X5_?0«^5I£_^᱄(ḄòÞJ¶Jìûh¿ᢝḄᨬᜧò。9:MNf0305_?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ÖᮣḄ[ᳮᙶ᪗FGD3DRS_POINTSPRITEENABLEᑴQᔲwAÖᮣḄ4=⚔AT[ᳮᙶ᪗,Kᵨ[ᳮ。WKFGw^^,ᑣw4=⚔AᑖT[ᳮᙶ᪗,,X©[ᳮ]ᑮAÖᮣ⊤☢。ìᜧÞᜧJo=²ᜧÞî,JQᨵᵨḄ。WKFGw〖&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^FGwᓄû,ᑣì>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ᐵFGpd3dDevice->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ᐵ*FGpd3dDevice->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Ñ$ᦔW10.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"ṹ,ᐸ$ᦔW10.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ᔜ*FGIAÖᮣ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%◤Ḅ,|npà÷,ᙠ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Ḅ[ᳮᙶ᪗eT。V.tu=j/m_numVertsPerCol;V.tv=1.0f-i/m_numVertsPerRow,᪷£☢ÈḄT>,2vᔊᡠᨵ$ᑡ,¯e8TÈᡠᨵ⚔AḄßᙶ᪗[ᳮᙶ᪗。⚔A+ḄTXᙠx☢CD。3.}@AT11.1ᡠ9,(ᙢyzÒḄ⚔AQ⌲$&?Ḅ,ᓽ✌ᐜ^·ᔣ~⌲=&?ᨬ☢o$⚔A,ᯠx&?o$⚔A。ᑣßJó1$ó』ᑡḄ⚔AḄ@AeT。i*m_numVertsPerRow+j11.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$+ឋò,eTA^ḄÑᦪ£: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^,$ᦔW11.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Ñ$ᦔW11.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ᦔW11.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"ṹ,ᐸ$ᦔW11.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ḄGe8IFÛᮣ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=ᐗ²w005`Ḅ}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。•staticWᐰþLℏᙠ¯îᵨᐵÏÜ8vᓄ,UᕡḼJ=LᙠḼ⁐ᘤÑSeq,J=ᐰþLLᡂKḼ⁐ᘤḄþ%L。Wo=᥅%Lᙠ¯îᵨstatic,ᑣKL÷0+ ¡ÒḄþ%Lℏᐹᨵ[ᐰrḄ$w。、•uniformWL¯îᵨâᐵÏÜ7ᓄ^⊤KLeᙠḼ⁐ᘤÑån$E。ᙠ0++"ṹÒILn$*+ᓄ,ᯠxÙÄwÒᐭḼ⁐ᘤ,,¦Øᙠ5SFåÿᦋLLḄò,VIñᡠᨵ⚔A²,KLᐹᨵrḄò。•externÔÓÀᵨÈᐵ"6^^1^⊤+ᙠḼ⁐ᘤúû,¢ᵫ++¸ṹµᐸúû。ᨵᐰ+ØÀᵨᐵ"^ᓄ^,(ì*☟ḄᐰᙠA¼§6^Ḅ。•sharedWL¯îᵨᐵÏÜ51^«^1,ᑣ9ᦔW᪾¾,KLeᙠi=ᦔWåÿᐳÌ。¦ᨵᐰþLe8ᵨKᐵÏÜn$¯。•volatileWL^¯îᵨᐵÏÜÍ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^035`,ᙠ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ᐵḄG1ê。ìἭᵨ⚔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。QW◤⌕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。ᐸ$ᦔW13.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¹ᑖᦪ¸。R4n10308356^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^ᓃ8786r,ᐹ#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Ñ^^^ᓃ×61^Ò,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$÷