Sign in to follow this  
jagguy

direct3d coordinates

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.



Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this