Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 07 May 2007
Offline Last Active Jan 18 2012 04:19 AM

Posts I've Made

In Topic: Finding a projection matrix from a 2D image

11 January 2012 - 04:39 PM

I have taken a look at it, and it does indeed seem like a correct way of doing this. However, I'm having a little trouble isolating t in the final equation without substituting the values for the ones that are known.

This means that I can at least verify that this is a correct solution by hand, but I can't implement it in code just yet.

Once again thanks. I will verify the solution tomorrow as it is getting late.

In Topic: Finding a projection matrix from a 2D image

11 January 2012 - 11:35 AM


I can't yet claim to understand what you wrote, but I will have a look when I'm near some paper (I think I will need it). If this works, you are truely a mathemagician

Thanks a lot, I'll be sure to let you know if I can get it running.

In Topic: World, View and Projection

30 June 2010 - 07:35 AM

Indeed.. In XNA, GraphicsDevice.Viewport.Project(...) does the trick.

Thanks for your help!

In Topic: Resources on Matrix/Vector math

29 June 2010 - 07:40 AM

Thanks. Everything works like a charm now, save for the fact that I have to point my camera at (0,0,-1) instead of (0,0,1). I assume this is because the code I am using assumes a left-handed coordinate system.

I am using the following method to convert from the 3x4 matrix to a XNA 4x4:

private Matrix ConvertToMatrix(NyARTransMatResult result)
var matrix = new Matrix();
matrix.M11 = (float)result.m00;
matrix.M12 = -(float)result.m10;
matrix.M13 = -(float)result.m20;
matrix.M14 = 0;
matrix.M21 = (float)result.m01;
matrix.M22 = -(float)result.m11;
matrix.M23 = -(float)result.m21;
matrix.M24 = 0;
matrix.M31 = (float)result.m02;
matrix.M32 = -(float)result.m12;
matrix.M33 = -(float)result.m22;
matrix.M34 = 0;
matrix.M41 = (float)result.m03;
matrix.M42 = -(float)result.m13;
matrix.M43 = -(float)result.m23;
matrix.M44 = 1;

return matrix;

I tried a few things, and I've read online that I need to multiply by a 3x3 matrix of
to get to a right-handed coordinate system.

So I created an Identify matrix and changed M33 to -1, and while that does makes my model within camera (0,0,1) range, it seems to shift it a distance to the left..

What am I doing wrong? It is even possible in a (relatively) simply way to transform a LH transformation matrix to a RH?

In Topic: Resources on Matrix/Vector math

24 June 2010 - 10:43 AM

Nicely done - I didn't expect that thorough an answer, but I am very grateful. I'm off to bed, but I will read and try to understand tomorrow.

I had originally added the last row as 0,0,0,0, but I got some.. well. unexpected results.

Once again, thanks a lot!