Using 3D objects in an iOS app - iphone

How would I go about adding a 3D object from Maya into an iOS app? For now, before it gets too complicated, I just want to add it in, no response to touch yet. Is there a tutorial about this? Thanks!
Edit: It doesn't necessarily have to be Maya. I can learn how to use another program.

Molecules is a great open source iOS app that uses OpenGL ES to render 3D objects that have nice touch interaction. Maybe that would be a good starting point.

Go to Xcode and start an OpenGL-ES Project.
Export your maya-model to *.obj(Wavefront)-format and use Jeff Lamarches obj-loader to create c-header files that you can include into your iPhone project!

For a more modern example of rendering 3D meshes, check out this library. It comes with an OBJ parser, so if you can export your geometry as an OBJ file, you can render and interact with it using the library on iOS. Here's a short video of the library in action.

Related

3d Avatar in iOS app

I would like to pass an avatar that I made on Maya to my project on Xcode 6(swift language). The app that I made was created in Single View Application and now I would like to know how I can implement my project to add the 3d avatar.
PS: I know that some of you guys think that my question already exists but mine is a little different.
I think SceneKit is the simplest solution for you. iOS 8+ only.
http://www.raywenderlich.com/83748/beginning-scene-kit-tutorial
Also you can write OpenGL ES code (pure OpenGL ES or using game engines like cocos3d), but it's more diffucult than SceneKit if you have no experience with it before.

Which formats can I use for animated 3D objects

.. in order to use in augmented reality application on iphone?
I have an app working like that; camera detects the marker and then it places an object related to that marker. However the object is not animated. It stands there. Of course i can move the object programmatically but i don't want to do that. What i want is the object has animation itself. I searched but i can't find exact file format. There are .obj files (not animated itself, is it true?), .mtl files, .anm files .etc. If the format is one of them, then can you give me an example model?
Thanks
Definitely MD2 is your best choice. I have integrated jPCT-AE and Vuforia and it works like a charm. AFAIK MD2 is best for animated models mainly because it can store the key-frame animation in itself and you can have any kind of animation with it at almost no cost.
Here is a test video:
http://youtu.be/chsHh0pEhzw
If you have more question do not hesitate ;)
You should specify what AR SDK/platform you are using to create the iPhone application you are talking about. That being said, for many of the common AR SDK available the MD2 format is often used to display animated models (either with a built in render engine or with example code that shows how to use the MD2 format with that SDK):
http://en.wikipedia.org/wiki/MD2_(file_format)
http://www.junaio.com/develop/docs/documenation/general/3dmodels/
OBJ (Wavefront) files do not support animation.

OpenGL ES - Where is EAGLView.h? xcode 4

Hello I'm very new to OpenGlES and i have started to try to learn it with online tutorials... but in each tutorial they ask me to create a OpenGL ES Xcode project, and then edit EAGLView.h. But I can't find it. Is it just me or has Xcode 4 changed its location etc. Also, when I run the application it gives me two cubes... 1 red and 1 blue... spinning around. In some tutorials, there is simply a multicoloured box, not in 3 dimensions. Is it possible to go back to that?
Thanks
The sample application has changed significantly since the tutorials you are reading was written.
EAGLView, in its many incarnations, provided a UIView subclass that connected OpenGL to UIKit. As of iOS 5 there's no need for a custom class because of the introduction of GLKit. The modern OpenGL sample simply uses a GLKView, which is a built-in UIView subclass connecting OpenGL to UIKit.
What the sample actually shows has also changed to highlight the vector manipulation parts of GLKit that provide everything GL ES 1.1 supplied but which was cut from ES 2.0, and more.
If you want to work up from a tutorial, you're probably going to have to find a newer one. Searching for GLKit tutorials directly is probably the best idea — this one (amongst many others) looked like it covers mostly the modern stuff, for the sake of saying something rather than nothing.
Instead of EAGLView.h and m, they have moved all of the code into files named viewController.h and m.
If you have truly generated an "OpenGL Game" project as they are calling it in the newer versions of XCode!
In terms of the OpenGL code implemented to show the red and blue boxes etc... They have changed there sample code, you can from the m file put whatever you want there!!!
You can download sample code from here and work from that:
http://developer.apple.com/library/ios/#samplecode/GLES2Sample/Introduction/Intro.html

'Embed' cocos2D in UIKit app

I've already created an iPhone app using UIKit. However, for one part of my app i will need to perform relatively heavy graphica (particles, lots of moving images). I can't rewrite the entire app in cocos2D due to my deadline. It's just for graphical purposes and i won't need user input via cocos2D. Another option i was considering was using plain openGL, but i'm quite sure cocos2D will be easier to learn.
In short: How can i use cocos2D in a small part (say one UIView) of my app without rewriting it? (User interaction is not necessary).
Edit: I found out, after a while more searching. For the record if someone else will need it in the future:
http://www.cocos2d-iphone.org/forum/topic/4708
http://www.cocos2d-iphone.org/forum/topic/9239
First, integrate cocos2d into your project.
Copy cocos2d directory into your project from downloaded cocos2d-iphone.
Modify cocos2d/ccConfig.h, #define CC_FONT_LABEL_SUPPORT 0
Copy fps_images.png into your project from downloaded cocos2d-iphone/Resources/Fonts if you want to show FPS that is implemented in cocos2d.
Next, implement to use cocos2d as cocos2d-iphone/tests/attachDemo/attachDemo.m.

UIView "suck" animation

I'd like to use the UIView "sucking" transition (view is "sucked" into a point) referenced here:
http://iphonedevwiki.net/index.php/UIViewAnimationState#Using_suckEffect
The method above, however, uses private APIs, which makes it next to useless for an App Store app. How can I recreate a similar effect without relying on private APIs? I'm guessing the answer has to do with OpenGL, although I have zero experience there.
As long as Apple doesn't publicly document the effect, and you want to avoid the risk of being rejected for using private API's you'll have to roll your own.
A suggestion to start working on this would be using OpenGL ES shaders.
The following blog post includes a demo Quartz Composer patch to create the Genie effect as seen in OS X and iOS:
http://www.aderstedtsoftware.com/users/erik/weblog/c7cb9/
A good start for your OpenGL ES shader would be to use the code in the Genie Filter in this QuartzComposer file. The code can almost be copied to a shader for OpenGL as is. The most work would probably be integrating OpenGL in your application: rendering the right view to a OpenGL texture and overlaying OpenGL over your application to perform the animation based on your shader.
Please have a look at my project at git://github.com/rmd6502/Genie.git - it's very slow right now, but improvements are forthcoming.
have you checkked out the cocos2d framework. it's an objective c wrapper for openGL and it's done really well. you can check out their demo video which shows all the transition types that the library supports.