#### Archived

This topic is now archived and is closed to further replies.

# Question about device coordinate system

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

## Recommended Posts

Hello, I was following a simple tut on directx and I have a simple question. In the app, the origin of the device is located at the center of the device. Is it possible for me to have the origin be at the top-left corner of the screen so that if the vertex value is (0,0,0) it is mapped to the top-left corner instead of the center of the screen? Im new to this stuff so if im not clear plz let me know. -Flack

##### Share on other sites
Use a translation matrix and move from point a to point b then restore the Identity matrix to reloate back to the original point. eg.

D3DXMATRIX identMat;D3DXMATRIX translation;float x=1.0f;float y=0.0f;float z=0.0f;// translate matrix, to new originD3DXMatrixTranslation( &translation, x, y, z);device->SetTransform( D3DTS_WORLD, &translation);// draw your object..// restore location using the identity matrix.D3DXMatrixIdentity( &identMat);device->SetTransform( D3DTS_WORLD,  &identMat );

[edited by - DevLiquidKnight on January 24, 2004 2:07:05 AM]

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 20
• 14
• ### Forum Statistics

• Total Topics
632950
• Total Posts
3009377
• ### Who's Online (See full list)

There are no registered users currently online

×