Fluxtah

I dont think I am quite understanding this, I created the following test to try and get a quad to render in screen space

Quad quad = new Quad(new Vector3(0, 0, 0), new Vector3(0, 10, 0), new Vector3(10, 10, 0), new Vector3(10, 0, 0));

Matrix matView = Matrix.CreateLookAt(new Vector3(0, 0, 1), Vector3.Zero, Vector3.Up);

Matrix matProj = Matrix.CreateOrthographicOffCenter(0, ScreenWidth, 0, ScreenHeight, 0.0f, 1.0f);

The quad renders in the bottom left corner of the screen, I want it to render in the top left of the screen, I though maybe flipping the Up Vector so its 0,-1,0 would solve the problem and allow me to draw shapes with the origin being the top left of the screen however no matter what I try I cant get it to work.

I think the problem is due to my understanding of CreateOrthographicOffCenter, can somebody explain in newbie terms how I can go about acheiving this.



Re: XNA Game Studio Express newbie problem with CreateOrthographicOffCenter

Fluxtah

Never mind I tried something I already tried that was not working and now it works, bizzare.

Matrix matView = Matrix.CreateLookAt(new Vector3(0, 0, 1), Vector3.Zero, Vector3.Up);

Matrix matProj = Matrix.CreateOrthographicOffCenter(0, ScreenWidth, ScreenHeight, 0, 0.0f, 1.0f);

EDIT: I realise now why it did not work the first time I tried this is because the vertex winding order is flipped.