Archived

This topic is now archived and is closed to further replies.

MatthewB

More FVF questions

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites