Cocoa framework integrated with GLUT and OpenGL - ios

I am new to MAC OS X programming. I am trying to develop an application that represents the rotation movement of the earth in 3D. What I want to do (probably I have mixed concepts, so sorry me) is to develop a Cocoa app where I will can visualize some controls in the window.xib that will allow me to change the rotation speed of the earth and things like that. The big issue that I have here, is that I don't know how to "connect" this controls with a 3D sphere and his functionality. I wrote a C++ program that uses GLUT libraries, that represents the sphere and the rotation movement, but I think I am going in the wrong way. Please somebody can clarify me how to integrate GLUT with a Cocoa application and the controls that Coca framework provides? If this is not possible I will appreciate any guide, tutorial or advice to continue with the development of my app.
Thank you so much and sorry for my poor english.

So your basic options for Open GL and OS X are Open GL or GLKit. GLKit is essentially an Objective-C wrapper around Open GL that integrates it into Cocoa.
My first suggestion however would be Unity 3D
Also you can look into Objective-C++ if you really want to go down that route, however I'd advise against it.

Related

Cocos2D + Box2D Editor?

I want to develop an Angry Birds style game (more for learning purpose), so I am digging into Cocos2D + Box2D and after having done a few test all by code I am wondering which tool can I use to design level easier ?
A bit of google pointed me out Tiled or R.U.B.E. but I am not really sure if it's what I need. Tiled seem to be more designed for tiled game like a plat-former and I don't really know about R.U.B.E.
What I'd like to do is being able to place my body manually in a scene, set their physic property and so...
Which tool would you recommend for this kind of level design ?
Thank in advance.
I advise you to download/buy LevelHelper/SpriteHelper, they have helped me a lot when I was a novice with box2d. I think it's just what you need, once you learn the basics then you can go forward freely without them. In addition now there's also one or more tutorials on the Ray Wenderlich site that will help you even more like this (The softwares are not free, but in my opinion they worth their price)

Easiest way to create simple 3d ios app

I'm looking to create a simple iOS app (for a geometry class) where you can tap and drag around 3d figures (cylinders, cubes, triangular prisms, etc.). What would be the easiest way to do this? Note I don't know any Objective-C.
It's kind of early but check out cocos 3d. Cocos 2d is a popular 2D game platform. Cocos 3D should insulate you from OpenGL ES.
http://brenwill.com/cocos3d/
Both cocos3d and cocos2d are built on top of the OpenGL ES frameworks
that runs on all iOS devices, and both are written in the native
Objective-C familiar to all iOS developers. With cocos3d, you can
effortlessly create a full 3D game or application without getting into
the nitty-gritty needs of the OpenGL ES state machine, and without
having to switch over to C or C++, as required by most other 3D
frameworks.
There's a mashup sample project to illustrate how to use it's APIs.
... the cocos3d distribution contains a Demos folder, where you
can build and run the CC3DemoMashUp app, a more sophisticated sample
of what’s possible with cocos3d
Here's the programming guide:
http://brenwill.com/2011/cocos3d-programming-guide/
If you download before april 8 2012 you get a free version of unity 3d ios version (android too if you are interested)

diff between various frameworks for iOS game development?

Struggling to distinguish between frameworks for iOS game development. Looking to draw a comparison amongst following frameworks i came across :
How to choose between frameworks or we can mix/match these together, what goes with what ?
Cocos2d
Quartz2D
OpenGL ES
sparrow
any other frameworks out there to consider ?
Which collision detection framework to use :
Box2D or chipmunk ?
is this a choice only with cocos2d ? what if i am using any of the other frameworks listed above , e.g openGL ES - can box2d be used with that or some other popular framework serves a better combination ?
edit #1
When we start a fresh cocos2d project following lines of code seems to be ref to openGl - does that mean we can mix and match the two or one is built on top of other... ?
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8
depthFormat:0 // GL_DEPTH_COMPONENT16_OES
];
// attach the openglView to the director
[director setOpenGLView:glView];
Ok,
Regarding physics engine of Box2d or chipmunk, i think both are great, each having its own benefits, it depends on you, using which engine you are more comfortable with?
Chipmunk is written in C, while Box2d is c++.
Box2D does support Continuous Collision Detection, but Chipmunk does not.
I personally use Box2d, may be i will be little biased, but i prefer Box2d. You can search more on cocos2d forum http://www.cocos2d-iphone.org/forum/.
Now regarding the frameworks, then what i know cocos2d and sparrow are the game engines while openGL ES and Quartz 2D are the graphics rendering API.
there is a post regarding the difference between a framework and the engine given below
What's the difference between an "engine" and a "framework"?
cocos2d uses openGL ES for drawing , difference between cocos2d and sparrow is well defined in the link given by bryanmac.
Using an engine is far more better to start than using an API and create your own framework. You will get many well defined functions already written in the engine which you have to code yourself if you use only rendering API.
I don't know much about sparrow but cocos2d is thoroughly developed, well documented, open source, Objective C language, so i will prefer cocos2d.
For what I have seen Cocos 2d is very powerful, you have full control of the scene, and it is still high-levelly as a framework. The learning curve is somehow steep, but it worth it. Of course you can integrate with Box2d http://www.raywenderlich.com/28602/intro-to-box2d-with-cocos2d-2-x-tutorial-bouncing-balls
Now, Sparrow for me is a speed framework, it is not as versatile as cocos-2d, but you can develop a game in a few days. In my experience, without knowing squat of sparrow, I took 15 days to develop a full simple game, where 60% of time I spent in designing the sprites and backgrounds. And yes you can use Box2d http://www.codeandweb.com/blog/2012/05/07/physicseditor-sparrow-box2d.
If you are starting, and your game is sprity, use sparrow, then little by little start moving to cocos-2d.

OpenGL on Mac OS X for an iPhone developer

I'm looking for a good example of a basic OpenGL App for Mac OS X, but not too simple.
I have a good solid base of experience with iOS and objective-c, but I've never built a Mac OS X App.
All I've been able to find are super simple examples that do all the drawing and logic in drawRect: or overly complex examples with layers and layers of abstraction. I don't want to use Glut, SDL, or any other 3rd party libs or engines.
I want to be able to drive a Game Loop and use CADisplayLink like I do on my iOS games. I'd also rather not use .xib files because I like to understand what's going on and having that black box there hides too much for me, although I'd be happy to use it as a first step if it got me everything else (game loop, CADisplayLink, etc).
My iOS code creates it's OpenGL Views by hand, but there seems to be enough of a difference between iOS and OS X that I'm having trouble making heads or tails of it. I just need to get a Window and an OpenGL view and be able to draw to that via the game loop.
Can someone point me to a good resource? The Apples examples jump between to simple and too complex as does everything else I can find on the Internet.
Sorry I can't answer to your questions. I always did use XIB files (a looong time ago, I too always wanted to re-invent the wheel, but now I'm lazy and prefer getting stuff done :p) and I never used display links.
What don't you like about overriding drawRect: ?
And the sample I used to get started with OpenGL was this one : http://developer.apple.com/library/mac/#samplecode/CocoaGL/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004501
Not too complicated, and simple enough to understand it (and it doesn't use any XIB, if I remember well :p)

Language/Program for simple 2D animation

I want to write something like this: http://www.youtube.com/watch?v=5S4KpCkHDqM I mean, I want to have 2D gaming space, but to have stylized as 3D, so my characters will move on the surface, but will have nice 3D effect. I wounder if Flash/ActionScript will do? Any other suggestions?
Flash and Actionscript can definitely accomplish this. There are at least 2 ways to accomplish the 3D look in 2D space.
The easiest is to do as #Blender said in the comments. Render some 3D images and bring them into flash. There are easy tools in flash to create animated sprites, including a native movieClip class, that has a timeline to play back frame-based animation.
But there is also full 3D in flash. You can bring low-polygon 3D models into flash easily using free and open source libraries such as Away3d (away3d.org) and papervision (papervision3d.org). Presently, flash player 10 has runs slowly when using these libraries.
But Adobe is about to release a new version of the player (version 11) that supports open GL for 3D and has significant performance improvements.
Away3D and papervision have already developed version of their libraries to support the new beta player and openGL.
So to summarize, yes - flash can make a game like that. It is currently the best way to develop games that are intended to be played in a browser. Because at least for the time being it has the most widespread support, and is stable between platforms and browsers.
Your example is pretty much entirely 2D: it just uses effects like shadows, animation and parallax scrolling between layers to achieve a (mildly) 3D effect.
As Plastic Sturgeon and Blender have pointed out, Blender might help for creating your assets - but it has a pretty steep learning curve, and you might be more comfortable 'faking it' in Adobe Illustrator or Photoshop if you've used those before.
Once you've created your assets, you need a platform to put together your gameplay: Flash is one possibility, but you could also look at Unity3D, which has good support for 2D and 3D, and has a browser plug-in if you want to make your game web-based.
If you're looking for a java-based solution, you could try Processing, which is cross-platform, and can export to javascript for web deployment. It's not exactly designed as a gaming environment, but it might do the trick - and it's free.
Hope this helps.

Resources