Learning OpenGL

Member
Posts: 64
Joined: 2005.06
Post: #1
I would like to learn OpenGL in Cocoa but I have not been able to find any good tutorials. All the tutorials listed on Apple's site do little more than give you the code on how to do something, and don't explain why it works, or what's actually going on.

Other than the Apple site, I haven't found any good Cocoa OpenGL tutorials, and I wouldn't even know where to begin on getting a book on it.

Anyone know any good tutorials, books or anything else?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You have two sensible choices at the moment:

1) first learn Cocoa, then learn OpenGL.
2) first learn OpenGL, then learn Cocoa.

NeHe (http://nehe.gamedev.net) will help you with learning OpenGL. His tutorials are all/almost all ported to the Mac, and widely considered the best resource for learning from.

Apple's tutorials, the Vermont Recipes and CocoaDevCentral (http://www.cocoadevcentral.com) will help you learn Cocoa.

Once you're up with the basics of both, you'll be able to see how they fit in. Apple's "no frills" samples will be more useful, and the code on this site (like GLCubes) will make sense.

There's no particular reason to make life hard for yourself by trying to learn both at once.
Quote this message in a reply
Member
Posts: 64
Joined: 2005.06
Post: #3
I already know Cocoa (I can't even be called good at the moment, but I do know it; still practicing and writing very small test programs), but I don't even know where to begin with OpenGL (past setting up an OpenGL view).
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Then NeHe's the place for you.
Quote this message in a reply
w_reade
Unregistered
 
Post: #5
NeHe, NeHe, NeHe. And when you've done that, more NeHe. Really, it's good. There's plenty to learn from there.

You will probably find the OpenGL Red Book useful as well. IIRC there's an old (but perfectly good) version of the RedBook somewhere in the resources section at gamedev.net - seek and ye should find.

If you don't know any 3d maths, learning some will help too - it can seem complex, but there are any number of pages that'll help you. You should manage to find one which makes sense to you.

With the above, you should be pretty much set with OpenGL - and if you have any specific problems, this forum is a damn fine place to get them sorted.
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #6
There is also this fruit based company that has a little web site to check out:

<http://developer.apple.com/samplecode/Sa...ics_3D.htm>

especially you want to look at:

<http://developer.apple.com/samplecode/Sa...InitGL.htm>

also - if you just want to learn the OpenGL stuff and worry about also learning the Cocoa stuff until later you can always use GLUT.

If you have Apple's free developers tools - look on your hard drive at:

/Developer/Examples/OpenGL/

for cool examples.

Also - dont forget about the download section of this web site:

<http://www.idevgames.com/content/download.php?id=221>
and
<http://www.idevgames.com/content/download.php?id=189>

also check out past uDevGames sourcode submissions - many of the games used OpenGL so you can get a fell for how a full game is written with it.

ok - youve got a lot of reading to do now! Good luck.

HTH,
Codemattic
Quote this message in a reply
Member
Posts: 64
Joined: 2005.06
Post: #7
Already tried Apple codemattic; they didn't help all that much, aside from just giving code and not explaining what any of it did.
Quote this message in a reply
w_reade
Unregistered
 
Post: #8
Hey, I just saw that NeHe has OS X source code for (?)all the tutorials. When did that turn up? Last time I looked, I'm sure the mac stuff was pretty thin on the groundÖ here's the link again in case you missed OSC's:

http://nehe.gamedev.net
Quote this message in a reply
Member
Posts: 104
Joined: 2002.04
Post: #9
A good book for learning Graphics programming and OpenGL is Ed Angel's book "Interactive Computer Graphics: a Top Down Approach with OpenGL" With that and the Red Book, you'll be stylin'

Nehe is good as well if you don't want to spend the money on the books.
Quote this message in a reply
henryj
Unregistered
 
Post: #10
Quote:"Interactive Computer Graphics: a Top Down Approach with OpenGL"

Didn't like this book at all. One of the few books I've ever bought that I wish I hadn't. Who cares about Mandelbrot sets?

If you intend programming with openGL then you have to buy the red book. You are wasting you time and money other wise.
Quote this message in a reply
Feanor
Unregistered
 
Post: #11
Quote:Originally posted by w_reade
Hey, I just saw that NeHe has OS X source code for (?)all the tutorials. When did that turn up? Last time I looked, I'm sure the mac stuff was pretty thin on the groundÖ here's the link again in case you missed OSC's:

http://nehe.gamedev.net


I posted about those ages ago, you must have missed it. Really they're all by one chap, he did a splendid job. People should add this new link to their bookmarks:

http://www.withay.com/macosx/opengl/

That's "with a y" doc com. He became a member here and posted I think one time just to advertise.
Quote this message in a reply
blb
Unregistered
 
Post: #12
I've posted a few times...

And for anyone using the ports on 10.2, there are a couple known issues (fullscreen on some systems and lesson 31's C++ code with gcc3.1); feel free to email me if these issues are encountered. As soon as I have the time, they will be updated for this and a number of other reasons.

Bryan
Quote this message in a reply
Member
Posts: 64
Joined: 2005.06
Post: #13
Thanks for all the help guys. Now I just need to find the time to not only learn OpenGL, but continue practicing Cocoa.
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #14
When you first start out with OpenGL, use GLUT... It shields you from getting bogged down in view and context manipulation and lets you concentrate on the GL drawing commands. Once you have all that down, it's easier to switch to an NSOpenGLView.
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #15
Quote:Originally posted by Mark Levin
When you first start out with OpenGL, use GLUT... It shields you from getting bogged down in view and context manipulation and lets you concentrate on the GL drawing commands. Once you have all that down, it's easier to switch to an NSOpenGLView.


on the contrary, I started directly using the cocoa stuff and have never looked back. I used my friend's source code as a starting point to set up the window right. Then I just did all my init in awakefromnib and all my drawing in drawrect. and keys are done with simple cocoa keyroutines. I fail to see how glut is easier than the cocoa alternative.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Learning OpenGL from scratch ajmas 5 3,635 Aug 13, 2005 02:47 PM
Last Post: akb825
  Learning OpenGL Justin Brimm 5 2,771 May 1, 2003 10:21 AM
Last Post: GoodDoug
  Learning Quicksilver 1 2,414 Dec 13, 2002 11:18 AM
Last Post: Feanor