VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: D3DVertex Rectangle...HELP! Adam Hoult (4 replies, 0 views) (2000-Aug-23) Hey almar,
Ok well this obviously all depends on where you current Viewpoint is (or Camera if you prefer), If you set it up, so that your camera is at 0,0,0 and uses the default orientation (Using The IndentityMatrix for to set current ViewMatrix) then basically you only need set your Vertices X/Y Coordinates (remember this is WORLD coordinates not Screen coordinates), then set your Z coordinate for the distance from the camera to the vertex itself (remembering that Positive Z values are away from you by default)
If you want to specify a Colour for each vertex then use the D3DLVertex Type (Or set up your own custom vertex format).
Thats really all there is to it.
If you REALLY want to specify the coords for the vertices by using ScreenSpace coordinates (i.e 0,0 is the top left hand corner of the screen) but still use untransformed vertices, it will require a Transformation between ScreenSpace to WorldSpace coords when you set up the vertex. This is really easy so let me know if you do and I will post the code to do that here.
HTH
Adam Hoult
Lead Programmer
Atypical Interactive
<http://www.atypical-interactive.com>
|