Burkey's Blog

Random musings of a PhD student on video games, technology and music.

  • About
  • Contact
  • Publications
  • Games
  • Screensavers
  • Game Completion List
  • Archive for August, 2009

    August 25, 2009 @ 1:40 pm

    Stop-Motion Lego Homage to Games

    Wow.

    Filed under Video Games · 3 Comments »

    August 5, 2009 @ 9:49 am

    XNA Code Snippet: Setting and Getting the Near & Far Clipping Planes from a Projection Matrix

    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 Programming · No Comments »

    August 3, 2009 @ 4:24 pm

    Laser + Sound Test

    As Arnold Schwarzenegger once said… “This, is really cool!”.

    Filed under Geeky · No Comments »

    Archives

    Categories

    Twitter Updates

    • Clare and me just played the first level of the Scott Pilgrim game. Class craic, even Clare enjoyed it. 4 hrs ago
    • Spending my lunch going through Pitchfork's Top 200 tracks of the 90's. Nice little walk down memory lane. http://is.gd/eRlWM 20-1 tomorrow. 12 hrs ago
    • More updates...

    Recently Played Tracks


    Twitter  Last.fm  Facebook  Flickr  LinkedIn  SlideShare