# Rioki's Corner

Programming and other nonsense.

## Transform to View Matrix

06 Feb 2014

How do you construct a view matrix from a transformation matrix?

If you search the web about how to build a view matrix you will find many references to gluLookAt or a custom look at implementation, maybe even how to setup a FPS camera. These all come in handy when you setup a scene ad hoc, but the general case, when you already have a camera that has a transformation matrix is seldom discussed. After I pieced this information together, I want to share it with you.

The general case is quite simple, to get the view matrix (V) from the transformation matrix (T), all you need to do is take the inverse.

But computing the inverse of a 4x4 matrix is not much fun and definitely quite computationally expensive.

But if you remember what the transformation matrix contains and how you compute a view matrix through the look at function. You will see an interesting correlation.

## Redesign with Bootstrap

17 Nov 2013

This website just got a lifting. With the help of Bootstrap the site looks spiffy and the effort to get it work was about 15 minutes. This is the fastest redesign to date.

The design is based on the Narrow Jumbotron. Which was easy a quite easy conversion. I dropped the twitter, github and RSS links at the top.

## MinGW-w64 for the Uninitiated

16 Oct 2013

The recent version of MinGW32 fully and totally broke on me this weekend. Actually it broke earlier, I just did not register it. But after SDL2 was unable to load OpenGL on code that worked before the upgrade, the cat was out of the box. All the little issues I had with libraries acting odd are related to something with MinGW’s internals being broken; probably something in glibc. (Before someone disses me for this, yes I know the upgrade to GCC 4.7.0 is ABI incompatible, I spent about two days recompiling ALL third party libraries from source.) Finally the MinGW package definition for the installer was updated, but in a broken unusable state, which even ensured that MinGW would not install.

So after some detours I ended up using the MinGW-w64 fork. If you listen to the community, the w64 version is better and more up to date, so that is a plus. The only thing that put me off was the ease of use of getting MinGW32 up and running with the automated installer.

As it turns out it is not that hard to get MinGW-w64 up and running. The only problem is it is not obvious. For that reason I will show you here and now how to get your MinGW-w64 environment in about 5 minutes. (Shorter than it takes you to read this post.)