Open GL

Discussion in 'Mac Programming' started by cruzrojas, May 25, 2007.

  1. cruzrojas macrumors member

    cruzrojas

    Joined:
    Mar 26, 2007
    Location:
    USA
    #1
    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
     
  2. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #2
    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
     
  3. lazydog macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #3
    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
     
  4. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #4
    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.
     

Share This Page