Monday, October 15, 2012

Book Review: WebGL: Up and Running

Book cover with the tonyBot (in running mode) superimposed

I have just finished my first reading of WebGL: Up and Running written by Tony Parisi.

Note and disclaimer: The author is my very good friend. I prepared demonstration material for the book. Tony mentions me by name three times in the book in glowing terms. Therefore you can assume that my point of view is not particularly neutral. On the contrary I am definitely biased in favor of Tony and his work.

For reasons that are tl,dr, I did not open the book on my e-reader until this evening. I am a proponent of just-in-time learning, so I read tech books like this by studying the table of contents, reading the book as quickly as possible and then later coming back to chapters of interest as and when needed - often on numerous occasions. The point of the first reading is not to understand what is going on but to establish a memory bank of what is available. I try to let my brain build a table of contents or index of the book. I do this so that later on, whenever a relevant situation occurs, my brain will tell me something like "Go look in Tony's book, there's a good answer/response there..."

I did not track the time, but my guess is that it took about two or three hours including breaks to complete the reading - which is a good fast read for me. I think this is because the writing is quite consistent. Once you get on to Tony's wavelength it's easy to keep the reading rate at a good speed. I didn't find any place where I really slowed down or ended up not reading a page. So Tony doesn't beat you with sticks of tech text. And then in terms of carrots, he has opinions. And, boy, does Tony have opinions. Every few pages there is an observation or an anecdote or wisecrack. It all makes for a lively read. The book's a page-turner.

And what sort of things seemed to register in my brain? I have been writing JavaScript quite seriously for a couple of years now. But note that I much more of an designer than a programmer. I design stuff but instead of using pen and paper I design using code. So my code tends to be arrays, equalities, if/thens and for loops - tons of it. Looking at the code of Tony's sim.js makes me think that I should really get a basis on objects, prototypes and closure and just coding a bit more effectively.

The other thing I need to learn about is shaders. So many possibilities. And very high on my to-learn list. Well now I have the place where I am going to learn how to to do shaders. Yay! And the other thing I am going to come back to fairly soon is the section on tween.js. On the other I could come back to the part on collisions first. Well, you are beginning to get the idea. My brain has built up its own image of the book and wants to re-visit quite a bit of it.

Were there any downsides? Of course. There was a lot of code that I could not just read and immediately comprehend or take in. But isn't that what a good book is about? Taking you by the hand to unfamiliar places. Thank you for doing this, Tony.

WebGL: Up and Running

Link to code for demo in header

1 comment:

  1. Given that you already like the idea of IF/THEN programming but also would like to get more into objects you many want to have a peek at AgentCubes. It allows you to author game and simulations including 2D/3D visualizations and turn them into HTML5/Three.js project. The programming is so simple that kids can do it: