Putting It Together

You now have 4x4 matrices with support for multiplication, transposition, and inversion. Not bad!

Sadly, there’s not a lot related to ray tracing that you can do with those routines just yet, but you’ll take care of that little problem in the next chapter, Chapter 4, Matrix Transformations. However, there’s always room for a bit of experimentation. Before moving on, take a few minutes to explore a little more.

  1. What happens when you invert the identity matrix?
  2. What do you get when you multiply a matrix by its inverse?
  3. Is there any difference between the inverse of the transpose of a matrix, and the transpose of the inverse?
  4. Remember how multiplying the identity matrix by a tuple gives you the tuple, unchanged? Now, try changing any single element of the identity matrix to a different number, and then multiplying it by a tuple. What happens to the tuple?

When you’re ready, turn the page! In the next chapter you’ll use your matrices to implement transformations, entities that will help you position and orient the objects in your scenes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.183.150