1],
tells Direct3D that the vertices that are being used are already in screen
coordinates. This value is normally used in fog and clipping calculations and
should be set to 1.0.
浠婂ぉ錛屽仛浜嗕釜瀹為獙寰楃煡錛屽湪欏剁偣緇撴瀯浣撲腑娌℃湁RHW鏃訛紝Direct3D灝嗘墽琛岃銆佹姇褰便佷笘鐣岀瓑鍙樻崲浠ュ強榪涜鍏夌嚎璁$畻錛屼箣鍚庝綘鎵嶈兘鍦ㄧ獥鍙d腑寰楀埌浣犳墍緇樺埗鐨勭墿浣撱傚綋欏剁偣緇撴瀯浣撲腑鏈塕HW鏃訛紝灝卞儚涓婇潰閭f鑻辨枃鎵榪幫紝鍛婄煡Direct3D浣跨敤鐨勯《鐐瑰凡緇忓湪灞忓箷鍧愭爣緋諱腑浜嗭紝涓嶅啀鎵ц瑙嗗浘銆佹姇褰便佷笘鐣岀瓑鍙樻崲鍜屽厜綰胯綆楋紝鍥犱負D3DFVF_XYZRHW鏍囧織鍛婅瘔瀹冮《鐐瑰凡緇忕粡榪囦簡榪欎簺澶勭悊錛屽茍鐩存帴灝嗛《鐐硅繘琛屽厜鏍呮搷浣滐紝浠諱綍鐢⊿etTransform榪涜鐨勮漿鎹㈤兘瀵瑰叾鏃犳晥銆備笉榪囪繖鏃剁殑鍘熺偣灝卞湪瀹㈡埛鍖虹殑宸︿笂瑙掍簡錛屽叾涓瓁鍚戝彸涓烘錛寉鍚戜笅涓烘錛岃寊鐨勬剰涔夊凡緇忓彉涓簔-buffer鐨勮薄绱犳繁搴︺?/p>
鍊煎緱娉ㄦ剰鐨勬槸錛孌3DFVF_XYZRHW鍜孌3DFVF_XYZ銆丏3DFVF_NORMAL涓嶈兘鍏卞瓨錛屽洜涓哄悗涓や釜鏍囧織涓庡墠涓涓煕鐩俱傚湪浣跨敤榪欑欏剁偣鏃訛紝緋葷粺闇瑕侀《鐐圭殑浣嶇疆宸茬粡緇忚繃鍙樻崲浜嗭紝涔熷氨鏄x銆亂蹇呴』鍦ㄥ睆騫曞潗鏍囩郴涓紝z蹇呴』鏄痾-buffer涓殑璞$礌娣卞害錛屽彇鍊艱寖鍥達細0.0錛?.0錛岀瑙傚療鑰呮渶榪戠殑鍦版柟涓?.0錛岃瀵熻寖鍥村唴鏈榪滃彲瑙佺殑鍦版柟涓?.0銆?涓嶈繃鎴戞祴璇曠殑鏃跺欎技涔巣鍊間笉璧蜂綔鐢ㄣ?/font>)
If you use D3DFVF_XYZ, then your vertex format needs to have 3 floats
in it, for x, y and z. Those are used to define a vertex position in 3D
space.If you use D3DFVF_XYZRHW, then your vertex format needs to have 4
floats in it, for x, y, z and rhw. X and Y are used to define a vertex
position in 2D space, Z is ignored (I think, it may be used for fog and
such, but I don't recall just now - I always set it to 0.0f), and rhw
is the Reciprocal of Homogenous W - which is basically 1 / the depth of
the vertex.
Usually, you use D3DFVF_XYZRHW for doing 2D, and D3DFVF_XYZ any other
time. However, a lot of people just use D3DFVF_XYZ, and use an
orthoganal projection matrix to make it seem 2D.
_______________________
[1] RHW琛ㄧず鎶曞獎絀洪棿涓《鐐規墍鍦ㄧ殑榻愭鐐?x,y,z,w)(homogeneous point)鐨剋鍧愭爣鐨勫掓暟(reciprocal)銆?/p>

]]>