First off sorry if this is to wrong section.
I am currently working on a way to to take the world space coords of a model and turn them in to screen space coords. Now I am still new to XNA and what i found as I can use the viewport.project method to convert the world space to screen space. I have set this all up but every time i get can the same numbers which are the center on the window. It makes no difference what the world space values are.
Now i am think I have made a mistake with the matrices and they are not calculating correctly but I have no idea any more and after 24 hours of tiring to fix this it is now killing me.
Console.WriteLine("X: " + min.X + " :" + max.X);
Console.WriteLine("Y: " + min.Y + " :" + max.Y);
Min2D = graphics.GraphicsDevice.Viewport.Project(min, project, view, world);
Max2D = graphics.GraphicsDevice.Viewport.Project(max, project, view, world);
//test project
Vector3 temp3 = graphics.GraphicsDevice.Viewport.Project(new Vector3(0, 0, 0), project, view, world);
Console.WriteLine("X: " + Min2D.X + " :" + Max2D.X);
Console.WriteLine("Y: " + Min2D.Y + " :" + Max2D.Y);
flames = new BoundingBox(Min2D, Max2D);
This is the where I am projecting the values. The matrices are past in from the main Initialize.
private Matrix world = Matrix.CreateTranslation(new Vector3(0, 0, 0));
private Matrix view = Matrix.CreateLookAt(new Vector3(0, 0, 10), new Vector3(0, 0, 0), Vector3.UnitY);
private Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), 800f / 480f, 1f, 100f);
This is the creation of them. I have check over them and I cant see what is wrong.
If anyone can help me with this I will be in your debt. For clarity I am using XNA with monogame and the values I am passing into project are
minX = -3 maxX = 3
minY = -3 maxY = 3