Get the latest tech news

Matrices can be your friends (2002)


Take an OpenGL matrix: float m [ 16 ] ;Consider this as a 4x4 array with it's elements laid out into four columns like this: m[0] m[4] m[ 8] m[12] m[1] m[5] m[ 9] m[13] m[2] m[6] m[10] m[14] m[3] m[7] m[11] m[15]WARNING: Mathematicians like to see their matrices laid out on paper this way (with the array indices increasing down the columns instead of across the rows as a programmer would usually write them). Look CAREFULLY at the order of the matrix elements in the layout above! ...but we are OpenGL programmers - not mathematicians - right?! The reason OpenGL arrays are laid out in what some people would consider to be the opposite direction to mathematical convention is somewhat lost in the mists of time.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of friends

friends

Photo of Matrices

Matrices

Related news:

News photo

SoundCloud gets more social by adding a way to see the songs your friends like

News photo

An unwelcome megatrend: AI that replaces family, friends — and pets

News photo

CNN Warns Food Delivery Robots 'Are Not Our Friends'