This project has moved and is read-only. For the latest updates, please go here.

debug view in 3d space

Topics: User Forum
Mar 22, 2010 at 3:17 AM
Edited Mar 22, 2010 at 3:31 AM

Hey all,

I've asked this question on the XNA community forums, but nobody seems to have replied. I need to find out what matrix to pass SpriteBatch to have Farseer's SimulatorView overlay my objects properly. I'm using Farseer in a 2D game, using textured quads in 3D space (still 2D logic - it's all on z=0) instead of SpriteBatch. I noticed that the objects weren't actually hitting when they started to bounce off of each other so I put in the debug view that comes with Farseer, but that uses SpriteBatch to show the AABB's and stuff.

My world coordinates are 1-to-1 with Farseer's logic: I'm actually setting the origin of the Quad to it's Body.Position so the farseer coordinates are the world space coordinates.I'm trying to find the right matrix to pass to the SpriteBatch so that the AABB's overlay correctly, but I can't find the right one.  I tried Camera.View * Projection, and it showed up in roughly the correct configuration, but it was upside down and about a mile down the Z-axis: I had to set the FOV (very) close to zero to find it.

If anyone has suggestions I'm willing to hear them.



Mar 26, 2010 at 4:48 AM

5 days and no answers?

Mar 26, 2010 at 7:32 AM

I'm not sure about this, I think you'll probably just have to experiment. Try the matrices in different orders too, as that matters.

Id also suggest asking on the Gamedev.Net forums under "DirectX and XNA", they can be quite helpfull. You haven't gotten any help here because this isn't really a physics question.

Hope that helps. And if you do find a solution please post back, I'd be interested in hearing.

Apr 17, 2010 at 12:48 AM

I did a quick fix my plugging in the FlatRedBall engine, but eventually I want to get back to my own renderer. Thanks for the advice.