World space -> view space?

Topics: Developer Forum
Nov 20, 2010 at 11:51 PM

Hi,

I'm attempting to use Farseer with the GLEED2D editor. One discrepancy that I've come across is that when drawing primitives (using DebugViewXNA), I can't seem to make them visually line up with their normally drawn counterparts. Eg, if I have a rectangular object, the rectangle isn't drawn in the same position and scale when using the debug view, even though it's using the same camera view.

I'm guessing there's a problem converting between game-world space and farseer-view-space somehow? How can I fix this?

Thanks.

Coordinator
Nov 21, 2010 at 12:23 AM

The DebugViewXNA class uses a projection and view matrix to draw the debug info on the screen. I've updated the SimpleSamples XNA (in the source control) project to use a camera class that works with a projection and view matrix that supports scaling, rotation and translation. You should take a look at it.

Nov 22, 2010 at 3:03 PM

Thanks, switching to that camera fixed it. :)