#### Archived

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

# Direct3D 8 Coordinate problem

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

## Recommended Posts

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...

##### Share on other sites
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).

##### Share on other sites
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 };

home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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

1. 1
2. 2
3. 3
Rutin
24
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002228
×