August 25, 2009 @ 1:40 pm
Stop-Motion Lego Homage to Games
Wow.
Filed under Video Games Permalink · 3 Comments »
Burkey's BlogRandom musings of a PhD geek on video games, technology and music.
Wow.
Filed under Video Games Permalink · 3 Comments »
It may be the case in your XNA code that you’re given a 3D projection matrix from a library method but its near and far clipping planes aren’t set as you require and so you’ll need to alter them. I had to do just such a thing yesterday and it took me a short while to figure out how to do this, so I thought I’d post the code up here for anyone who needs it. You’ll can then alter the code as you require it.
Setting the clipping planes:
public Matrix SetMatrixClippingPlanes(Matrix m, float near, float far)
{
m.M33 = far / (near - far);
m.M43 = near * far / (near - far);
return m;
}
Retrieving and printing the clipping planes:
public void PrintClippingPlanes(Matrix m)
{
float near = m.M43 / m.M33;
float far = (near * m.M33) / (m.M33 + 1);
Console.WriteLine("Near Clipping Plane: " + near);
Console.WriteLine("Far Clipping Plane: " + far);
}
Hopefully this helps some of you out and saves a bit of time.
Filed under Geek Permalink · No Comments »
As Arnold Schwarzenegger once said… “This, is really cool!”.
Filed under Geek Permalink · No Comments »