Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I will be working on a 3D project and i need to learn c++ and opengl fast. as i have heard it is the best combination to do graphics. I would also like your recommendation on this book I came across:

Angel E, Interactive Computer Graphics: A top-down approach with Open GL, 5th Edition, Addison Wesley 2008

what do you recommend? thanks!

share|improve this question
sounds daunting and terrifying and potentially a lot of fun :) – Doug T. Jun 29 '11 at 15:48

migrated from stackoverflow.com Jun 29 '11 at 10:14

6 Answers

There is no such thing as a fast track to C++. C++ is one of the most complicated languages to master properly. And also OpenGL and computational geometry is a vast field, time consuming to learn.

OpenGL is some graphics API. But saying it was the best API for graphics is like saying a workshop full of tools and all the raw materials are the best for driving on the Moon.

OpenGL is a toolbox and it provides some raw materials. But the bulk work is up to you, and if you don't have a considerable amount of knowledge about

  • linear algebra
  • geometry
  • programming
  • core concepts of the C programming language (the OpenGL API is designed along C)

you'll get stuck early trying to learn OpenGL.

So this is what you need to master:

  • linear algebra and geometry and some calculus (assume at lest 1 year for learning this)
  • C programming (you can learn the language in about 6 months, but it takes at least 3 years to fully master it, if you use it continously)
  • if you want to implement some of the sophisticated graphics algorithms you'll also need some topology and differential geometry (consider this some additional 2 years of learning)

So if you're really going for this, you need patience and some stamina, but it is worth it. So which resources do I recommend:

  • "Computer Graphics – Principles and Practice", a must have read
  • Some higher math textbook, undergraduate level. For German readers I recommend the books by Klaus Jänich "Lineare Algebra" and "Analysis für Physiker und Ingenieure"
  • For learning C "The C Programming Language" by Kerninghan and Ritchie
  • For learning C++ "The C++ Programming Language" by Strostroup and for further reading
    • "Modern C++ Design" by Alexandrescu
    • "C++ Coding Standards" by Herb Sutter
  • "The OpenGL Programming Guide" aka "The Red Book", it is something between the specification and tutorials; I've never read the Superbible, so I can't tell you about this.
  • Work through all the papers on the developer website of NVidia and ATI/AMD
share|improve this answer
For C++ resources, I'd link to the C++ Book list over on SO. – greyfade Jun 29 '11 at 16:01

Before I begin, in the interest of full disclosure, I have my own set of intro OpenGL tutorials. So feel free to take my assessment in that regard.

First, ICG 5th edition has been supplanted with ICG 6th edition, which teaches from shaders. You should look into that, as shaders are important. However, looking at the blurb on Amazon, it seems to stop with OpenGL 3.1, for some reason. 3.2 and 3.3 all run on the exact same hardware as 3.1, so there's no reason for them to have stopped there (except for the production and publication date, of course). So some of the information may be out of date. There don't seem to be any reviews up on Amazon as of yet.

You also may want to consider the 5th edition of the OpenGL Superbible. I'm more familiar with this one, but I think some of its teaching methadology is flawed. It uses a large C++ framework to make it easier to show how to do things, which is fine. What I have a problem with is that it starts with the framework, then later teaches about the OpenGL calls it makes behind the scenes. I've seen more than one question from users of the Superbible who were confused as to where OpenGL ended and the Superbible's framework began.

There are quite a few online resources. I would suggest avoiding any online tutorials that don't use shaders, as you can't really call yourself a graphics programmer these days without the ability to use them. The OpenGL Wiki plays host to a number of OpenGL 3.0 or better tutorials that all teach shaders for the beginning programmer. Again, in the interest of full disclosure, I wrote one of them.

share|improve this answer

For OpenGl I found HeNe to be pretty good. Explained things in simple easy to digest chunks.

share|improve this answer
2  
NeHe or some-such, no need to be afraid of C/C++ or maths, they will come naturally. One note though, Nehe tutorials are not "modern" and doesn't cover modern paradigms. But learning shaders and that like from scratch will be hard without previous knowledge. So Nehe first, everything else after you have learned something. – Coder Jun 29 '11 at 16:44

Unless you are writing for the very highest performance ( and if you are having to learn C++ for the job, you won't achieve it because you won't yet be good enough at C++ to do it ) I would definitely look for a 3D binding for a language you already know. There are good Direct3D ones for .net, you can use OpenGL from Java ( I believe Minecraft was written that way ) and you will have a hard enough time mastering 3D programming without having to master a difficult new language at the same time.

Also, unless you have a very specific and specialised application in mind, please don't reinvent the wheel. There are so many 3D engines, scenegraph APIs and other helpers for 3D programming around, both open and closed source, that will help you get the job done a lot more quickly and easily. I would certainly look at those before thinking about rolling your own.

share|improve this answer

Using C++ and OpenGL/DirectX is the most used way to create top games. However, there are easier alternatives. Xna & .net for example.

You'll still need to learn C#, the XNA framework and some basic math.

share|improve this answer

For OpenGL, I recommend The OpenGL Superbible, which came out in a new edition just a year ago.

Here's a review:

http://slashdot.org/story/10/10/25/134209/OpenGL-SuperBible-5th-ed

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.