Can someone point me in the right direction?

Member
Posts: 509
Joined: 2002.05
Post: #1
Ok its time to start getting ready for my uDG 2003 game! I'm not going to say all that much, but it will be a 3D open GL game, and probably programmed in cocoa. Im looking for some advice.

I am using the Building Cocoa Applications book to learn cocoa right now, but I still need to learn Open GL and the 3D concepts. I have a small 3D background (how to make a 3d work, rotate it,sort it, perspective it, and render the polygons), but keep in mind this was done in METAL with no 3D commands at all, just plot x,y . I need a good book to learn OpenGL(Cocoa instead of carbon code would be REAL REAL nice), and 3D math. Does anyone have any suggestions?

Or would it be better to program in carbon as david did?
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #2
The specifics of openGL are not API dependent. It doesn't really matter if you Cocoa or Carbon or whatever.

The only difference is in the initialization of openGL.
Forum please correct me if I'm wrong.
Quote this message in a reply
sh4ggy87
Unregistered
 
Post: #3
For learning OpenGL, I would say you should get the Red Book (OpenGL Programming Guide). You can buy it on Amazon.com, though gamedev.net has a link to an online verison here (it's about halfway down the page, and the OpenGL Reference Guide that is right next to it is useful too). To run OpenGL in Cocoa, you should read the AppKit documentation on NSOpenGLContext, NSOpenGLView, and NSOpenGLPixelFormat. The documentation on these will have links to examples of how to use them.
Quote this message in a reply
Member
Posts: 57
Joined: 2002.04
Post: #4
Also look at nehe.gamedev.net; you should be able to learn most of what you need from there, and it's much easier to start with than the Red Book. (iDevGames also has Carbon and Cocoa ports of the first few tutorials at nehex.idevgames.com; as NYGhost said, the actual OpenGL code is about the same, but the NeheX code shows how to set up OpenGL on OS X.)
Quote this message in a reply
Member
Posts: 509
Joined: 2002.05
Post: #5
Ok thanks, but Im still a little fuzzy. Are cocoas methods named differently, say NeHe (which i was leaning towards before i posted this thread) has code saying GLRender(), or GLFog(10), would cocoas be [GLView Render], [GLView fog:10] , or are all the names changed so that NeHe will be alot harder?

And will NeHe teach me the math I need for physics, when I browsed through the chapters it looked like most of them just taught the API(but i'm not sure about this)
Quote this message in a reply
Member
Posts: 57
Joined: 2002.04
Post: #6
The OpenGL functions are the same regardless of API; you would call glTranslatef(x, y, z), for example, the same way in Cocoa as you would in Carbon or in any other API. The Cocoa code at NeHeX is a good example of this.

You'll have to go somewhere else for physics; a quick Google search turned up this page, which looks like a good resource.
Quote this message in a reply
Member
Posts: 509
Joined: 2002.05
Post: #7
Oh, after looking at some code that makes sense. That definitely helps for porting to C++ someday when I need to compile for winblows.
Quote this message in a reply
Post Reply