Direct3D 8 Coordinate problem

Started by
4 comments, last by Dealerz 22 years, 11 months ago
How are the coordinate system done in d8... in 2d if I want to place a square at the corner of (20,20) I would just place that as x y... but in d3d8 they want you to use floating number as x,y,z.... How are they used in conjuction with the coordinate systems on the monitor.... I setup 2 type of vertex structures... The first on is just a x,y,z, and color structure and then the second one is a texture vertex which has x,y,z and tu, tv stuff..... But I''m having problems trying to figure out how to place a squre in the (20,20,0) area and then the problem of placing a texture in the correct placement. need help...
Advertisement
Try something like (20.0f, 20.0f). The .0f means its a floating point number and that all decimal places after the f are 0 (I think).

Make sure you''re using the correct Flexible Vertex Format and Vertex Shader for screen coordinates:

typedef struct sVertex
{
FLOAT x, y, z, rhw;
} sVertex;
#define VERTEXFVF (D3DFVF_XYZRHW)

sVertex Vert = { 20.0f, 20.0f, 0.5f, 1.0f };



Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
Thanks I got it to work now by the way what does rhw stand for... I only have the sdk help files and its hard to find stuff on direct3d... There needs to be a book on this topic to help out... Because this is much different then D73D.
Thanks I got it to work now by the way what does rhw stand for... I only have the sdk help files and its hard to find stuff on direct3d... There needs to be a book on this topic to help out... Because this is much different then D73D.
quote:Original post by Dealerz

Thanks I got it to work now by the way what does rhw stand for... I only have the sdk help files and its hard to find stuff on direct3d... There needs to be a book on this topic to help out... Because this is much different then D73D.


RHW is the homogeneous W for the transformed vertex.
RHW is actually the reciprocal (SDK Lingo ) of the W coordinate from the homogeneous point (x,y,z,w). Pretty much the distance between the eyepoint and the vertex (Just read it up in the SDK).


- Goblineye Entertainment
The road to success is always under construction

Edited by - Tornado on April 24, 2001 7:34:47 AM
Goblineye EntertainmentThe road to success is always under construction

This topic is closed to new replies.

Advertisement