Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
XNA 4 3D Game Development by Example: Beginner's Guide

You're reading from   XNA 4 3D Game Development by Example: Beginner's Guide Create action-packed 3D games with the Microsoft XNA Framework with this book and ebook.

Arrow left icon
Product type Paperback
Published in Sep 2012
Publisher Packt
ISBN-13 9781849687089
Length 322 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Kurt Jaegers Kurt Jaegers
Author Profile Icon Kurt Jaegers
Kurt Jaegers
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

XNA 4 3D Game Development by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introduction to XNA FREE CHAPTER 2. Cube Chaser – A Flat 3D World 3. Cube Chaser – It's A-Mazing! 4. Cube Chaser – Finding Your Way 5. Tank Battles – A War-torn Land 6. Tank Battles – The Big Guns 7. Tank Battles – Shooting Things 8. Tank Battles – Ending the War 9. Mars Runner 10. Mars Runner – Reaching the Finish Line

Matrices – big scary math things?


You knew we could not avoid it forever, right? It is time to talk briefly about matrices and matrix math. Don't worry! It is not nearly as scary as it sounds at first.

A matrix is really nothing more than a grid of numbers. Mathematically, a matrix can have any number of rows and columns, but in XNA we use 4 by 4 matrices, meaning the matrix has four rows of four columns. Each of these columns contains a number. The XNA Matrix class defines these values as floats, and assigns them names of M11 through M44 (the first number being the row, the second being the column; so M23 is the second row, third column). We will also use 1 by 4 matrices, or matrices with one column and four rows. We have already used them, in fact, though you may not immediately recognize them as 1 by 4 matrices because of the way they are declared in our code. More on that in a moment.

We have used the identity matrix before, and it looks like this:

When we multiply two matrices together...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image