@Karthik, this might be a well-written book, and it seems to be from a cursory dip. But here's a red-light warning that it is obsolete:
this glBegin/glEnd block harkens back to the "fixed function" pipeline. The link below talks about this. Fixed Function "...have been replaced by Shaders of some sort." What this does, if memory serves, is causes the GPU to receive instructions between the begin/end block. It slows things down, definitely. Teaching beginners to do things that way, is, IMHO, a mistake. It seems rather sad that this is still being included as of Jan 2016.
it is not. The author could be very knowledgeable, but perhaps we should gently encourage him to learn shaders and update the book yet again. Finally, it would surprise me if you could NOT find a lot of hardware and drivers etc., that still do this. I saw code only a couple of years ago that used fixed function successfully (and even impressively).
I think author justifies using deprecated APIs, because he wants the book - being an introductory one - to emphasize graphics and geometry concepts first, with opengl being just a library to demo those concepts.
For the next two chapters, the discussion is limited to OpenGL 1.1. OpenGL 1.1 is a large API, and we will only cover a part of it. The goal is to introduce 3D graphics concepts, not to fully cover the API. A significant part of what we cover here has been removed from the most modern versions of OpenGL. However, modern OpenGL in its pure form has a very steep initial learning curve, and it is really not a good starting place for someone who is encountering 3D graphics for the first time. Some additional support is needed—if not OpenGL 1.1 then some similar framework. Since OpenGL 1.1 is still supported, at least by all desktop implementations of OpenGL, it's a reasonable place to start.
However, in light of what you have said, I think I got it wrong and did a disservice to the author by describing it as "a good intro for OpenGL and the more recent WebGL".
It's probably better to describe it as "seems like a good intro to graphics programming".
Thank you for tactfully pointing out the dangers of an incomplete survey.
The approach could still mislead (even with this explanation), but the author definitely has a point about the learning curve. This is why I liked the idea of using Java3D--even though that is not well supported. JavaFX does the same, though I have not done as much with it, and cannot yet fully judge. They leverage object-oriented concepts better than JOGL, and you don't have to use Shader code unless (and disclaimer: I have not tried this) you exceed the limits of what can be done in the API.
I have seen graphics programmers turn up their noses at these wrapper-ish libraries, because they want to maximize their power. I should make it one of my own goals to find out how to get at the Shader layer from JavaFX.