Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cruzrojas

macrumors member
Original poster
Mar 26, 2007
67
0
USA
Hi, I want to teach myself open GL, so I have a couple of questions. I want to do pretty basic stuff, like 2d plots, 3d plots, maybe some animation of simple objects, ie. sphere bouncing on the ground.
My first question is, is it really worth the time investment. Or I'm better of just learning different programs to do that kind of stuff.
Second question. which mac friendly book would you recommend to learn to program using open GL. By mac friendly I mean no Visual Studio stuff, or a book that is mostly focused on windows.

Thank you all in advance.
Best Regards
Jesus Cruz
 

toddburch

macrumors 6502a
Dec 4, 2006
748
0
Katy, Texas
There is an OpenGL Reference guide out there somewhere. Amazon probably has it listed.

FWIW, the Ruby scripting language has some nice (simple) examples of OpenGL programming. I've ran most of them (under Windows) and they work pretty good. With Ruby, you are a bit removed from the nitty gritty programming of the calls and the environment, but for learning the calls and seeing the behavior, it might be a good start for you.

Todd
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
Hi

OpenGL is fun and relatively easy to learn especially if you use GLUT. GLUT is a cross platform run time enviornment for developing OpenGL programs. It handles creating a window for your application, attaching an OpenGL context and running a keyboard/mouse event main loop for you. All you need to do is write a few callback functions, eg for drawing your objects etc. The API for GLUT is simple and quick to learn. There is an example GLUT project which you can use as a 'template' in the examples folder. An advantage of using GLUT is that there are tons of OpenGL programs written for GLUT that you can download from the internet. Most will run straight away on the Mac (after cutting and pasting into an Xcode project).

As for learning OpenGL, the OpenGL Programming Guide (the Red Book) is a good one to start with.

b e n
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
I found OpenGL: A Primer to be a great introduction to OpenGL. It is very clearly written and made it very easy for me to get started writing real OpenGL code. You start by drawing a dot in a window, then a square, then a colored square, then a spinning square, then a cube, etc. Later you'll definitely want some of the doorstop tomes, but this book is a good starter.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.