May 25, 2011 at 2:11 PM
Edited May 25, 2011 at 4:10 PM
Hi, it's OP again. I think I fixed it :D I turned off framing.Draw(), and I saw that DebugDrawXNA was rendering debug data underneath the background! That's why I couldn't see it. This is great,
now I can visualize what's going wrong. Thanks, meds!
Now I just need to figure out why DebugViewXNA is rendering with a reversed Y axis, as you can see in my screenshot.
Here's how I changed it to work without a camera, for anyone reading this thread in the future. Note that this code is still broken like in the above screenshot.
Matrix proj = Matrix.CreateOrthographic(Graphics.PreferredBackBufferWidth / 1f / 100.0f, Graphics.PreferredBackBufferHeight / 1f / 100.0f, 0, 1000000);
Vector3 campos = new Vector3();
campos.X = (-Graphics.PreferredBackBufferWidth / 2) / 100.0f;
campos.Y = (Graphics.PreferredBackBufferHeight / 2) / -100.0f;
campos.Z = 0;
Matrix tran = Matrix.Identity;
tran.Translation = campos;
Matrix view = tran;
DebugViewXNA.RenderDebugData(ref proj, ref view);
EDIT: I fixed it :). Screenshot. It's simple really . . you just have to make your orthographic matrix with the negative of your buffer height.
Here's what that looks like:
Matrix proj = Matrix.CreateOrthographic(
Graphics.PreferredBackBufferWidth / 1f / 100.0f,
-Graphics.PreferredBackBufferHeight / 1f / 100.0f, 0, 1000000);