How To: Create an Orthographic Projection Matrix for OpenGL

This version of the code uses the Matrix4f class from LWJGL Utils, but you can obviously use any 4×4 matrix class you’d like:

To place the origin in the bottom-left corner of the window (positive y-axis pointing upwards) you’d then create a matrix like this:

While to place the origin in the top-left corner (positive y-axis pointing downwards) then just switch the windowHeight and 0.0f to make the line:

As a final note, for 2D graphics sitting on z = 0.0f (you can easily have a 3D orthographic projection – for example in a CAD package) we typically specify the near and far values as -1.0f to 1.0f in a right-handed coordinate system (such as OpenGL) – putting them both as 0.0f can cause issues, so its’ best not to.

Microsoft’s IllumiRoom prototype aims for immersion

The basic idea of the IllumiRoom setup is that you tap into visual content from a console and have that content affect how a projector displays additional/augmented/related content onto the walls surrounding your TV – you’ve really got to see it to get it:

Interesting, huh? I like the idea, but… it seems a little impractical to have a projector on your coffee table. Also, to really take full advantage games would have to be created which deliberately interact with this system, which is increased developer effort, and how many people will have and use one of these devices? I really do like the idea, but I just don’t see it reaching critical mass right now. If there was a drive for people to move from buying large TVs to projectors in the first place – then maybe it would stand more of a chance of gaining high adoption, but in that case you generally clear the projection surface so it wouldn’t have to compensate for room geometry in the first place. Still, it’s a great idea and some very cool tech!

3D Projections onto Buildings

The above video is doctored a little to improve contrast and things – so it’s essentially fake, but you can see live video of the process here and here – which definitely isn’t, and is still rather impressive.

I guess they take a depth map of the building with lasers and then compensate for the angles and depth of the building geometry much like logos on sports pitches appear to be a flat and correct 2D images from the perspective of the main TV camera, but are all distorted when you look at them from another angle. They must create clipping masks for the windows and any other special features, too.

Clever stuff.