small medium large xlarge

29 Jul 2013, 19:57
Stuart Bowes (1 post)

I’m really enjoying the book so far, it’s great.

There was however one thing that wasn’t explicitly pointed out in section 6.7 Switching to a Projection Matrix, that I had to go to the downloaded code samples to figure out. Near the bottom of page 107 it says “Instead of hard-coding the z values, let’s use a translation matrix…”

By the end of section 6.7 it shows Figure 32 with the air hockey table appearing to be a 2D rectangle again, filling most of the screen.

On my first attempt mine was still 3D i.e. the table was tilted into the distance as it was earlier in the chapter.

What I though was missing from the text was a little reminder to say that as we are no longer hard coding z ( or w) we needed to go back to only specifying the X, Y, R, G, B coordinates in the tableVerticesWithTriangles array and changing POSITION_COMPONENT_COUNT from a value of 4 back to 2 again in the AirHockeyRenderer code.

Having highlighted “Instead of hard-coding the z values, let’s use a translation matrix…” it seems more obvious now but I had to go back and find that line in the text to figure out I had to remove some of the coordinates again in my code.

Thanks for writing an inspiring book. Looking forward to reading the next chapter.

30 Jul 2013, 17:41
Kevin Brothaler (47 posts)

Thanks for the feedback! I’ll take note of this and I’ll also let the editor know for when we do an updated release.

You must be logged in to comment