Public Group

# direct3d coordinates

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

## 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 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 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 on other sites
Quote:
 Original post by Evil SteveUsually 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.

1. 1
2. 2
3. 3
4. 4
Rutin
11
5. 5

• 12
• 19
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632666
• Total Posts
3007720
• ### Who's Online (See full list)

There are no registered users currently online

×