View Full Version : The red book(Opengl Programming guide) is so hard!!

07-04-2003, 06:47 PM
Why everybody says the red book is definite programming guide to the opengl?
I just feel its text are vague and abstract
and its dull examples confuse you more than clear out something.Anybody has the same feeling?

07-04-2003, 08:47 PM

The red book is a beginners guide. There is a lot more to 3d graphics than that.

07-05-2003, 01:46 AM
I think that close to everybody found at least some parts of the red book hard the first time they read it. Its more the subject that is hard than a confusing book. OpenGL is something complex and it will take time to understand it. A good advice is probably to look at some tutorials like NeHes for some time if you find the book confusing and dull. After the tutorials can you return to the book and things should be clearer.

In my opinion is the red book excellent and part of the reason why OpenGL is a success.

07-05-2003, 09:58 PM
Take selection chapter as example, there is nowhere in the text explain why we should use glLoadName not glPushname to assign the object ID into the namestack.
So what the difference between the glPushName and glLoadName??I can not find answer in the book.

Also ,as for the returned selection data,how we interpret the returned hit data in the select Buffer.Again there is no explaination i can find.

07-05-2003, 10:11 PM
Originally posted by RunningRabbit:
So what the difference between the glPushName and glLoadName??I can not find answer in the book.

In my Red Book (page 534), it explains that quite clearly -

"... the commands to manipulate the stack allow you to push a name onto it (glPushName()), pop a name off of it (glPopName()), and replace the name at the top of the stack with a different one (glLoadName())."

This is similar to glPushMatrix(), glPopMatrix() and glLoadMatrix(). Like others, I think the red book is very good. However, it is also very concise - it doesn't tend to repeat the same information over and over again like a "tutorial" book would. Maybe you could look at the OpenGL Superbible or some alternative text if the red book doesn't suit you at the moment?

07-06-2003, 04:37 AM
I know the glLoadName replace the name on the top of the name stack . and glPushName simply push the name into the stack.
what i can not understand is why the glLoadName is used to assign the object id .
So what's use of the glPushName in selection ??
And what is difference in the usage of the glPushName and glLoadName.

07-06-2003, 05:02 AM
If you're only using selection to do so-called "simple" picking - i.e. you want an id for each object you draw and then just get an id back when the user clicks, then I agree you don't need to bother with the name stack. Just load and id before you draw each object.

Where the stack comes in useful is if you are picking objects from a hierarchical structure. Say you have a rendering of a person, which has two arms, two legs, two hands, five fingers on each hand etc. Then, as you draw each element in the hierarchy, you also push the id's onto the name stack.

So, for example, when you draw the left arm, you push "LEFTARMID", for right arm you push "RIGHTARMID". But when you draw the hands, you just push "HANDID" - whether it's for the left or right arm.

This makes the code much simpler as it follows the sort of hierarchical or recursive structure you would expect to use.

When it comes to picking, if the user clicks on a hand, you'll get all of the names in the stack in the selection buffer. So you know that they clicked on a HANDID that belongs to LEFTARMID rather than RIGHTARMID for instance. It really saves you having to define an ID for every single instance of every selectable object.

I don't think there is anything difficult in understanding what the functions *do*, it seems that you're more confused about when and why you'd do it (correct me if I'm wrong http://www.opengl.org/discussion_boards/ubb/smile.gif). That's why I'd suggest more of a tutorial book like the Superbible or like the NeHe examples, where you can actually see these functions being used.

Like I said before, I think the red book is great and the blue book supplements it more formally, but it does have a habit of only telling *what* something does, rather than *why* you'd want to do it.

Does this make it any clearer? (I'm trying hard...)

07-06-2003, 04:10 PM
Great input !!! I could not be appreciated more . For my part ,you explain it clearer than the red book does on the glLoadName. OK ,now I am more comfortable with opengl selection.
But my opinion for the Red book remains so so for the real beginner like me .It is as cold as textbook in the high school. Maybe after one or more years into the Opengl, i would find the red book more attractive.

[This message has been edited by RunningRabbit (edited 07-06-2003).]

07-06-2003, 11:08 PM
I think the OpenGL redbook is a very good book. It explains very good the transtormations that need to be done to get from 3D to an image on you screen. Now I actually understand what is happening. I have never seen a book that does such a good job on this. I've tried Direct3D also and the book you find on this API assume you are comfortable with all this and start to write small games and give you a bunch of (useless)C++ to work with. I don't want this, and I don't want to write a game or something, I want to learn the damn API and de basics! The OpenGL redbook is one of the best book out there to learn the OpenGL API. I think this book is great. Just to say something, I've never done anything in OpenGL, and after just one day of reading and trying the well explained thing i wrote myself a little 3D clock to put on your desktop. And in the same time I also figured out how to draw in any kind of window using Microsofts MFC wrapper classes. I do not want to use GLUT because it is not flexible enough for my needs. I can only say god things about the OpenGL RedBook!! I hope they will update it to OpenGL v1.4 soon.

[This message has been edited by KineticBytes (edited 07-07-2003).]

07-07-2003, 12:07 AM

What chapters are read through? For my part,No not very first several chapters sucks .But from the chapter "Drawing Pixels,Bitmpas,Fonts and images" and following chapters,oh, my god,it really make my head spins.Usually ,i will have hard time to swallow idea paragraph by paragraph some thing like "pixel padding" "glPixelTransfer" "convolution",bla,bla,bla , and have no idea what it talk about
and totally blank minded.
Maybe it is just *ME* who get this impression.But it would be great that there is someone there who shares the same feeling.

[This message has been edited by RunningRabbit (edited 07-07-2003).]

07-07-2003, 01:35 AM
I don't think it's just *you* that feels this way. I'm also not saying that everything in the book is perfect. Maybe you just expected it to be different in some way?
What I am saying is that it is really what I was looking for in an OpenGL learning book.

To get into the Direct3D stuf again, In many of those books they handle I don't know how many topics, even sound and user input. First of all, IMO, if you're a beginner you should not be playing with adding sound when you don't even master the 3D api you're using. Basically I find these D3D books I got crap. They handle to many topics in little detail and supply a CD to cover up the *crapyness* (is that a word?) of the book. However, the openGL Redbook does a good job in explaining the OpenGL API and not on how to load a Quake 2 model or something. Things like that I find on the internet or in more specific books.
I'm afraid you'll have to live with the redbook my friend, it's the best book out there to learn OpenGL API.