Jump to content
  • Advertisement

Archived

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

intrest86

RHW?

This topic is 6023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have seen it in a lot of the tutorials but have never seen an explanation for it. I think taking it out of my user-type is what screwed my work up, so I would like to know more about it... Thanks for any help!

Share this post


Link to post
Share on other sites
Advertisement
Has to deal with "homogenous coordinate spaces". In homogenouse coordinate spaces, several different coordinates can point to the same point in space. This is because each component of the coordinate is multiplied by a constant (the same constant).

i.e. (1.0,1.0,1.0,1.0) = (2.0,2.0,2.0,2.0)
the general form of this could be (ax,ay,az,aw)

where "a" is the constant, and x,y,z,w are the components.

When you do transformations the w coordinate my not come out as 1.0 (which is required by DirectX and OpenGL), if this happens you have to multiply all the components by 1/w or the reciprocol of the homgenous w to fix it to the proper coordinate space.

Sorry if that was a bit technical, but it''s the only way I know how to explain it.

-Omalacon

Share this post


Link to post
Share on other sites
Not sure this is what you are looking for:

D3DFVF_XYZRHW tells the system that your game has already transformed the verticies and Direct3D does not have to do it. Therefore, you will typically see the coordinates defines in terms of the screen. Where x is 0 to screen width. Also I believe the z coordinate is almays parrellel with the screen.

D3DFVF_XYZ is pretransformed. Therefore, you will typically see verties defines from -1 to 1. Where 0 is normally the center of the image.

Hope that helped?


Share this post


Link to post
Share on other sites
sdoherty55 is correct. Plus this allows you to use the z coordinate as a z-buffer. This way, you can have items with the lower z coordinate drawn last, so they appear to be on top.

---
Make it work.
Make it fast.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!