Jump to content
  • Advertisement

Archived

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

Flack

Question about device coordinate system

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

If you intended to correct an error in the post then please contact us.

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 this post


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

D3DXMatrixTranslation( &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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!