This project is read-only.

Using Farseer's matrix with Krypton?

Jun 26, 2012 at 8:25 PM
Edited Jun 26, 2012 at 8:28 PM

Hi. Does anyone know how I can make Krypton use the same matrix that Farseer uses for the camera? This is Farseer's matrix code which is in the draw function:

Matrix projection = Matrix.CreateOrthographicOffCenter(0f, graphics.GraphicsDevice.Viewport.Width / MeterInPixels, graphics.GraphicsDevice.Viewport.Height / MeterInPixels, 0f, 0f, 1f);

Matrix view = Matrix.CreateTranslation(new Vector3((_cameraPosition / MeterInPixels) - (_screenCenter / MeterInPixels), 0f)) * Matrix.CreateTranslation(new Vector3((_screenCenter / MeterInPixels), 0f));

I'm also using this to make the camera follow the main character (in the update function):

Vector2 cameraMovement1 = new Vector2(-MeterInPixels, -MeterInPixels);
Vector2 cameraMovement2 = (mSprite.Position * cameraMovement1);
_view = Matrix.CreateTranslation(new Vector3(new Vector2(cameraMovement2.X + _screenCenter.X, (cameraMovement2.Y + _screenCenter.Y) + 150), 0f));


Now this works fine, but Krypton also follows the camera so each light moves. Anyone know how I can make Krypton fixed?


Nov 16, 2012 at 6:24 PM

Did you ever figure this out?