Skip to main content
gamedev.net
🔒 Locked

RHW?

Started by intrest86 Dec 27, 2001 at 1:43 PM 2 replies 850+ views
Original Post
intrest86
intrest86
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!
Turring Machines are better than C++ any day ^_~
Omalacon
Omalacon
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
sdoherty55
sdoherty55
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?


CaptainJester
CaptainJester
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.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.