Recommended Posts

I have looked at some directx docs and could someone tell me a better explanation of the coordiante system for images.
eg so I can understand a coordinate system of xyz images then UV and where it should be on the screen with matrix math.
struct Vertex
{
float x, y, z;
float tu, tv;
};
Vertex g_quadVertices[] =
{
{-1.0f, 1.0f, 0.0f, 0.0f,0.0f },
{ 1.0f, 1.0f, 0.0f, 1.0f,0.0f },
{-1.0f,-1.0f, 0.0f, 0.0f,1.0f },
{ 1.0f,-1.0f, 0.0f, 1.0f,1.0f }
};
1) why have -ve points for xy as isn't it easier to start at 0,0 or do they want to use a standard xy graph system.
2) D3DXMatrixPerspectiveFovLH( &matProj, D3DXToRadian( 45.0f ),
640.0f / 480.0f, 0.1f, 100.0f );
3)doesn't this line project along y axis at 45 deg so the object should be on its side but it isn't?

0

Share this post

Link to post

Share on other sites

The negative values are there because frankly, only humans find positive numbers easier to work with, the computer doesn't really care. Most of my projects start at 0,0,0, yours can too, but theres no technical reason for it to be that way.