2d openGl game in iphone? - iphone

I want to develop simple 2d opengl game with animation.in that animation I have to clip the image frame and draw it.
Any single tutorial link or book which gives step by step Teachings to animate the image frame(sprite) and to do calculation.

http://apress.com/book/view/9781430225997

A free tutorial on OpenGL ES for the iPhone:
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html

Related

Implement Zoom(using UI Canvas) in Unity 2d game

I want to implement as showed in the below image in 2D game, I can find so many tutorials for 3D like mini map concept but for 2D i couldn't find anything. In my game i want to show a secondary
camera as in below image and also i need to zoom the content that will show through it. I developed one concept but it can be done with sprites or with Canvas in World Space mode. So you can see
they won't resize or positioned according to the screen resolution. If you guys have any idea how to do this task,it will be very helpful for me. And i also tried with depth mask shader .Thanks in advance.
Use a camera with target texture
Follow my tutorial here: Particles with Dynamic Text but disregard the parts about the particle system, they are irrelevant for you.
Once you've made a material, stop following the tutorial, and instead:
Create a sprite renderer on a canvas that is "Screen Space - Overlay" and set the material to be the one that you created.

Playing 3D Animation in iPhone App (Possibly using a looping video)

Is there a relatively easy was to include a 3D animation into an iPhone app? We have the animations already made up for another project and our client has asked if they can be placed inside an iPhone app. We could perhaps include a low-res looping video of the animation (it's just a 3D component rotating on a single axis), or would it be better to look into getting the 3D animation directly onto a view?
Cheers,
Dan
You could either split it up into a set of frames and use the UIView animationImages property like so:
http://appsamuck.com/day2.html
Or assuming its already an OpenGL animation you could port the code to openGLES.
Here are good tutorials for openGL ES:
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html

Is there an tutorial on loading an 3D model in openGL ES on the iPhone?

I've started to play around with some 3d modelers a while ago. Now I'm curious: How can I bring such an 3D model to the iPhone or iPad, so that I can see it on screen and maybe even rotate it with gestures?
1) What's the best file format for the 3D models?
2) How would I load a particular 3D model file into openGL ES and then render it?
3) How would I apply an material to the polys, i.e. to make the model appear red?
4) Does the model have some sort of center or pivot point where I can rotate it easily around? Or do I need incredible freakin' math skills to transform all the vertecies in 3D space myself? How hard is it to rotate something?
5) Can I scale models or fit them into the camera viewport? How hard is that to do? Freakin' awesome math skills needed?
5) Does openGL ES support some kind of shader tree model with gradients and effects that can be applied to the model or material?
Would be so happy if someone can point out an quick starting guide for people who know 3D, but don't know OpenGL ES. Maybe someone already made a great tutorial on this topic?
How about Using 3D Models from Blender in OpenGL ES.

2D Game Character Animation in iPhone - How is it done?

What I mean is, do animators work on an animation in say Flash (or some other kind
of key frame animation program) and then export it to the iphone somehow?
For example, say I am an animator and I want to create a person waving for an iphone
game. What type of external program would I use and then what libraries on the iphone
sdk would I use to load them in?
I think it all depends on how in depth you want to get. Making a 2D game is a broad statement. For example, to make what you ask. You would just make a series of PNG images for a cell based animation of the wave. wave1.png, wave2.png, waveN.png...
Then load the PNG images in and then play them in sequence. You can do this with UIImageView, Core Animations classes, or manually your self with UIImages and UIViews.
There a lot of great game engines you can check out too. Here is a link for an example of what is available. Game Engines
For the best performance, most companies/developers use OpenGL to do both 2D and 3D style games. You can utilize a lot of tricks for the textures used in your games.
The iPhone natively supports key frame animation with the CAKeyframeAnimation class.
I think the most popular framework for 2D games is Cocos2D: http://cocos2d.org/

OpenGL ES iPhone Textures

For one of my new games I'm using OpenGL ES since it has multiple enemies and bullets, etc. How do you draw images on the screen with Opengl ES? I have a player.png image that is a 48x48 pixel image; how would I draw that on the screen?
The basic answer is that you create a quad out of two triangles and draw that "camera facing" or in 2D mode on the screen.
In the iPhone example of OpenGL ES (the rocket ship one) you can see the Texture2D class which handles loading png's and displaying them. It's simple, but works.
But I would suggest you take a look at cocos2d iPhone. This framework handles a lot of this stuff for you and lets you focus a lot more on your game: http://code.google.com/p/cocos2d-iphone/
You might also look at GameSalad for a non-programmery way of making simple iPhone games: http://gamesalad.com/