More FVF questions

Started by
2 comments, last by MatthewB 21 years, 3 months ago
Why would I want to use the D3DFVF_XYZRHW flag versus the D3DFVF_XYZ flag? The extra float (RHW) describes "the position of a transformed vertex." Huh?? I thought it took 3 values(X,Y,Z) to describe a position in 3D space. How can ONE float do that? I guess I either do not understand what the help file means by that exact phrase, or I am missing out on some basic concept. Thanks again.
Advertisement
I actually don''t know this for a fact, I''m just starting out in directX, but it looks like that fourth component might be the quaternion W. A quaternion is a four-tuple that has applications to rotations. Just a guess, hope it helps.
--"The greatest pleasure in life is in doing what people say you cannot do." -- Walter Bageholt
RHW stands for "reciprocal homogeneous w".

Long story short, homogeneous coordinates (x, y, z, w) are used so that all matrix operations can be done with matrix multiplcation. Basically, they allow translation to be done with multiplication instead of addition. The short answer is that the reciprocal of w is a byproduct of those operations, and you can usually get by with a value of 1.0 for 2D stuff.

For a better explanation, you might want to take a closer look at matrix transformations.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
Thanks, I thought it stood for Right-Handed-W(something).
I came to the conclusion that for what I am doing, that I do not need that in my FVF.

This topic is closed to new replies.

Advertisement