direct3d coordinates
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?
The 45 refers to how wide of a view the camera's "lens" has.
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.
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.
Usually the center of your scene is at (0,0,0), so if you only specify positive cooridnates, you'll only occupy a quarter of the screen.
Quote:Original post by Evil Steve
Usually the center of your scene is at (0,0,0), so if you only specify positive cooridnates, you'll only occupy a quarter of the screen.
I will look it up but I am confused about the centre of the screen.
I thought the top left was 0,0 so I am assuming this is 0,0,0 for xyz.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement