Matrix Math
Matrix Matrix_Multiply(Matrix mat1, Matrix mat2) { int i, j, k; Matrix mat; // For speed reasons, use the unroll-loops option of your compiler for(i = 0; i < 4; i++) for(j = 0; j < 4; j++) for(k = 0, mat[j] = 0; k < 4; k++) mat[j] += mat1[k] * mat2[k][j]; return mat; } vertex matrix_vertex_multiply(matrix mat, vertex vert) { vertex v; v.x = vert.x * mat.matrix[0][0] + vert.y * mat.matrix[0][1] + vert.z * mat.matrix[0][2] + mat.matrix[0][3]; v.y = vert.x * mat.matrix[1][0] + vert.y * mat.matrix[1][1] + vert.z * mat.matrix[1][2] + mat.matrix[1][3]; v.z = vert.x * mat.matrix[2][0] + vert.y * mat.matrix[2][1] + vert.z * mat.matrix[2][2] + mat.matrix[2][3]; return v; } That should be enough to start you off. (C)1997 Jeff Weeks and Code[sup]x[/sup] Software
Related Tutorials
A Day As A Game Designer
The fabled game designer. The man, the myth, the legend behind the game. An inspiration to young creatives who wish to …
Kai Wüest
So You Want to be a Game Developer?
Battletech tools developer Chris Eck describes his journey and advice for getting a job in the industry.
A Quick Guide to Gamification and Gamification Careers
If you find yourself slightly stumped over the ever-growing buzz around gamification, and unsure whether there is any o…
Sophie Jackson
Raph Koster's Postmortems: Una Carrera
This excerpt from Raph Koster's Postmortems is an adaptation from a speech he delivered at GameDay Peru in early 2015. …
Raph Koster
Negotiating Sign-On Bonuses in the Games Industry
A quick blurb on signing bonuses in the games industry and how to approach asking for one.
A LinkedIn Profile for Job Hunting and Networking
Marc Mencher is founder and CEO of GameRecruiter and author of Get in the Game!, an instructional book on building a ca…
Discussion
More from Jeff Weeks
Comparing Shadow Mapping Techniques with Shadow Explorer
New Incentives and a Whole New Platform From The Intel AppUp developer program
The final installment in this series on Intel's AppUp program details additional incentives and opportunities for devel…
The Game Maker
This book excerpt contains the first chapter of the book that introduces beginning game developers to the Game Maker pr…




Discussion