Original Post
I have two questions: 1) When programming in DirectX, how do you know the 'range' of the X and Y axis? For example, if I was to define a quad like so: How would I know how the red quad would appear on the screen? Does an X value of 1.0 mean the right edge of the display area and an X value of -1.0 mean the left edge of the display area? Does a Y value of 1.0 and -1.0 mean the top and bottom edge of the display area, respectively? 2) What do the w and h parameters of the D3DXMatrixOrthoLH() function do? Do they refer to the width and height of the display area in pixels, or is it an arbitary unit which the programmer must convert between? Thanks.
/*
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE)
struct CUSTOMVERTEX
{
float x, y, z;
DWORD colour;
};
A---------B
| / |
| / |
| / |
C---------D
*/
CUSTOMVERTEX quad[] =
{
-1.0, 1.0, 1.0, 0x00ff0000,
1.0, 1.0, 1.0, 0x00ff0000,
-1.0, -1.0, 1.0, 0x00ff0000,
1.0, -1.0, 1.0, 0x00ff0000,
};