Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best process to show an OpenGL Animation in iPhone [closed]

I'm having issues being able to import a bone and skeletal animation from Maya to Blender to iPhone. Here's what I've done:

  1. install the ColladaMaya plugin to export a DAE for Blender to export
  2. used Jeff LeMarche's script to be able to export a single keyframe of the model and import this .h file into the iPhone game
  3. Setup the GLView using more of Jeff LeMarche's steps and rendered into our Game, so this model display next to the actual game (not in 3D).
  4. Researched oolongngine, sio2 (applied but haven't yet gotten e-mail back from them), other SO q's for solutions, including mine from game dev
  5. Reviewed using FBX SDK content pipeline to dynamically generate class files for the animations.

I can import a model and display it. A lot of these processes respond to that issue and leaving the developer to manipulate the game object programmatically. My main issue is finding the best, defined process of importing an animation into iphone next to the existing game? I don't need a whole game, or a whole scene, just one animating model and some steps to follow.

This animation is meant to play in a loop. There are 3 more animations that will play on different game states (good move, bad move, etc.). So I'm concerned that LeMarche's keyframe solution (which basically means exporting EVERY keyframe as a .h file) will be incredibly time-intensive and memory-intensive. I'm definitely willing to do it, but after all the research I've done (additional links not included), I'm lost as to where to go next besides hand-exporting each keyframe and importing them.

EDIT:

I've added a bounty to this for anyone who can give me a clearly-defined process for importing an animation from a 3D application into iPhone. NOT the entire application itself (i.e. Unity, Sio2, etc.), but just showing a 3D overlay in an application (like an animating model next to a bejeweled-esqe game, not interacting with the world.)

People keep saying, "create your own model loader". Are there scripts, examples, tutorials, anything that walks through this "model loader" process from EXPORTING from the 3D application (preferably Maya or Blender) and IMPORTING this animation and rendering it in Objective-C?

like image 327
Dominic Tancredi Avatar asked Apr 14 '11 18:04

Dominic Tancredi


3 Answers

This is really a big problem with animation export. I had this problem recently and ended up with Assimp.

However it also has problems with skeletal animation exported from Maya and Blender. As for me I prefer 3Ds Max (don't forget to reset Xform before rigging), it has no problems with Collada and animation.

Though if you want to use that models in your game I suggest you to write your custom exporter for Maya or Blender. Also try the mesh (morph) animation. If you don't use inverse kinematics or something like that this is what you need.

like image 153
Max Avatar answered Nov 15 '22 22:11

Max


I have written code that reads Blender files and parses the mesh, bone and animation data. It then applies the bone animations to the meshes world transforms etc. It's a lot of work, but certainly doable. If you have any questions about Blender peculiars, just ask me.

The other option is using a library like OgreKit, which can read blend files and does skeletal animation for you as well out of the box.

like image 38
Steven Kramer Avatar answered Nov 15 '22 21:11

Steven Kramer


AnimKit is a small animation library that can read a .blend file and play an animation using Glut. It extracts all data for skeletal animation and more, including bones, mesh and animation channels etc from a Blender 2.5 .blend file.

AnimKit is open source (using the permissive zlib license) an you can check it out using Subversion:

svn co http://code.google.com/p/gamekit/source/browse/#svn%2Fbranches%2FAnimKit AnimKit

AnimKit doesn't run on iPhone yet, but I'll port it soon, using Oolong Engine.

Another interesting resource is Proton SDK (protonsdk.com) it has a customized Irrlicht SDK that runs on iPhone/Android etc. The RT3DApp sample can play an animation.

like image 44
Erwin Coumans Avatar answered Nov 15 '22 23:11

Erwin Coumans