Sign in to follow this  
Syranide

Err... uhm... orthogonal setup

Recommended Posts

Ok, I believe I'm loosing my mind this very moment (00:52) after having spent more than half an hour wondering why i keeps stepping with increments of 4 (i += 4 of course)... (Oh, yes, I'm talking about 2D at the moment) And now I come to yet another shot in the head... it's all very simply, I've got my "engine" up and running, it can draw some nice text (really nice of course)... however, for the moment (and I will most likely need this later anyway) I don't want to "hardcode" the coordinates into the vertexbuffer (that is, I want the first character to always be at 0,0) and instead move it by the use of a matrix for the view/projection.
D3DXMatrixOrthoOffCenterLH(&world, 0, 800, 0, 600, 0, 100);

And... then I ... uhm ...
D3DXMatrixTranslation(&view, 1, 1, 0);

And of course I expect it to move the 1 unit (pixel in this case) in both X and Y... no it moves it half a screen in both X and Y... probably I'm the one upside down currently... and I guess I'm doing it wrong... but is there a way to move using a matrix as I would move it using coordinates in the vertexbuffer? (that is, 1 equals 1)... Also, while I'm at it... after setting up the orthogonal view, I get (0,0) in the lower left corner, is it possible to get it in the upper left (that is without "modify all coordinates before you use them"). Hope what I said makes half a sense at least.

Share this post


Link to post
Share on other sites
Quote:
Original post by Syranide
Also, while I'm at it... after setting up the orthogonal view, I get (0,0) in the lower left corner, is it possible to get it in the upper left (that is without "modify all coordinates before you use them").

Hope what I said makes half a sense at least.

I don't know about your other problem, but for this one just switch the "0" and "600" when you set up your projection matrix.

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