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.
今天Q做了个实验得知Q在点l构体中没有RHWӞDirect3D执行视、投影、世界等变换以及q行光线计算Q之后你才能在窗口中得到你所l制的物体。当点l构体中有RHWӞ像上面那段英文所qͼ告知Direct3D使用的顶点已l在屏幕坐标pM了,不再执行视图、投影、世界等变换和光U计,因ؓD3DFVF_XYZRHW标志告诉它顶点已l经q了q些处理Qƈ直接顶点进行光栅操作,M用SetTransformq行的{换都对其无效。不q这时的原点在客户区的左上角了Q其中x向右为正Qy向下为正Q而z的意义已l变为z-buffer的象素深度?/p>
值得注意的是QD3DFVF_XYZRHW和D3DFVF_XYZ、D3DFVF_NORMAL不能共存Q因为后两个标志与前一个矛盾。在使用q种点Ӟpȝ需要顶点的位置已经l过变换了,也就是说x、y必须在屏q坐标系中,z必须是z-buffer中的象素深度Q取D_0.0Q?.0Q离观察者最q的地方?.0Q观察范围内最q可见的地方?.0?不过我测试的时候似乎zg起作用?/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表示投媄I间中顶Ҏ在的齐次?x,y,z,w)(homogeneous point)的w坐标的倒数(reciprocal)?/p>

]]>