Rendering Maya animation on Android? - android

I've been able to import 3D models from Maya into OBJ files, which in turn, are read by my Android app. This model can now be displayed and I can apply transformations on them as well, even on high-polygon count objects, which is nice.
The next step is to figure out if there's any reasonable way to display animation defined within Maya. I really have no clue how to approach this and my initial research on this essentially came up empty.
Has anyone attempted this before? If so, how would this work?

I think it's worth noting that this question has little or nothing to do with Maya. Maya's file formats are proprietary and opaque; you will NOT find a way to directly display them on Android (or anywhere else, come to that). But you can export data from Maya to (basically) any format, which is what you actually want to do.
So, here's the process:
Figure out how you're going to display 3D models and animations on Android
Figure out how to get stuff from Maya into the format your answer from step 1 requires.
There's a lot of ways to do step 1. For sheer ease of use I'd probably go for Unity myself. Basically it's game development tool that can create 3D apps and games that run on Android (and iOS, OSX, Windows, etc.) It's not free - the Android addon costs $400 - but if you're actually planning on doing anything serious with Android, you'll find it worthwhile. With it, it's actually pretty trivial to make a little Android app in Unity that displays an animated model (and a LOT of 3D Android and iOS games are made in Unity). Unity also wants models and animations in FBX format, which is a widely supported interchange format - you'll have no problems getting stuff out of Maya into FBX.
If you've gone with Unity in step 1, then step 2 is trivial: Export your models from Maya as FBXes, and you're done. If you've decided to roll your own Android rendering app, well, good luck. :)
Anyhow, the point is that what you want to do is find a generic solution for rendering animated models on Android, and only then figure out how to get your content out of Maya.

Instead of outputting each individual frame to a separate obj file like spicyweenie suggests, why not export just keyframes to obj files. Implement interpolation in your code in order to fill in the missing frames. If your models are complex, you'll probably want to cache the interpolated models in memory, but at least you don't have to load them all from files too.

Unlike Cody Hatch's answer, I'm interested in this too. This is my theory as to come about animating a model:
Lets say your model has 30 frames. One way would be to export each frame as an individual OBJ model. From there, you can possible make a folder for those 30 OBJs. So now you have 31 files total. If the person hits a button, the trick would be to load each OBJ in order according to the length of time the button (or whatever action) is valid. and if it lasts over 1 second (30 frames), loop back to the beginning.
The only problem with this theory is that it would most-likely be resource and power intensive, not to mention, a space hog if you try to load a lot of things into one scene.

Related

Step by step object detection with ORB

I must create an Android app that recognizes some objects from the camera (car steering wheel, car wheel). I tried with Haar classifier but without success and I'm running out of time (it's a school project). So I decided to look for another way. I found some other methods for my goal - ORB. I found what should I do in this answer. My problem is that things are messed up in my head. Can you give me a step-by-step answer of what to do to implement the answer from the question in the link I gave:
From extracting the feature points to training the KD tree and using it for every frame from the camera.
Bonus questions:
Can you give a definition of feature point? It's something I couldn't exactly understand.
Will be the detecting slow using ORB? I know OpenCV can be used in native android, wouldn't that make the things faster?
I need to create this app as soon as possible. Please help!
I am currently developing a similar application. I would recommend getting something working with a single reference image first for a couple of reasons:
It's easier to do and understand if you're just starting out, and you can change it later.
For android applications you have limited processing capabilities so more images = lower fps.
You should have a look at the OpenCV tutorials which are quite helpful. Once you go through the “OpenCV for Android SDK” section and understand the three tutorials you can pretty easily add in functionality that will allow you to analyse the video feed.
The basic logic path I'd recommend following when making the app is:
Read in the reference image.
Create and use your FeatureDetector, DescriptorExtractor and DescriptorMatcher.
Use the above to detect keypoints and then descrive keypoints (the first two, don't forget to convert it to a mat and then to greyscale).
Every time you get a frame from your camera repeat step 3. on it and then compare the keypoints in the images (with the third part of 2.).
Use the result to determine if there is a match (if there is then draw a box around it or something).
Get a new frame.
Try making it to work for a single object and then add in others later. Another thing you could add is a screen at the start to allow users to pick what they want to search for.
Also ORB is reasonably fast, especially compared to SIFT and SURF. I get about 3fps on a HTC One with a single reference image.

OpenGL ES Startup

I done a 1:1 copy of the iOS App "MohrenJass" to Android.
-> Austria Cardgame.. Good training example :)
Good introduction to Activity, Views, Canvas, Preference, APIs, and more
Now i done the OpenGL ES Sample from the Developer page.
I read about OpenGL but i have a Question about it.
There are realy some points in it who give me some hard times.
Matrix, vertex, shader, fragment, projection, camera,...
Its not that i not understand it, but only to know "do this when that"
is not enough for searching errors in code...
I think about trying the ReplicaIsland code next,
but should i start with OpenGL first?
I found this fro OpenGL -> Prefer it because its german
http://wiki.delphigl.com/index.php/Hauptseite
(Dont know if its possible with my stand of knowledge)
Also found this
http://www.learnopengles.com/android-lesson-one-getting-started/
Or skip this and go into ReplicaIsland?
Learning by doing was always a good way,
but sometimes its a punch in my face...
I wont to try next a simple 2D Application.
A Square to go left/ right, jump above a other Square or somthing.
Only for learning to reach someday my target of realy create a App :)
I also read something about Unity, but i think its not the way i should start that.
Possible if i know what i am doing it will get with it easy...
Well.. I hope you have any tipps for me!
As for libraries such as Unity or Cocos 2D and such you will be able to start with your application quicker but they usually limit your capabilities as a developer at one point or another. If this is for a purpose of creating a simple game then you should go for it. If the goal is to get as much knowledge as possible I suggest you try the openGL. It is not easy and it does not get easier over time but it is worth it. And if you later turn to some library everything will be as clear as day.
So about the tutorials and examples there is a fact that they are in most cases misleading. They will explain to you how something is done but the code structure will be completely unmaintainable. If you want a good code that will help you over time you should begin with creating a simple "debug" scene to which you can then add components you later expect to need. For instance you should create a class that can contain an openGL context which should later be extended to include caches such as textures, shaders... Then you should have a class containing the view you draw to, the frame buffer and the render buffers you use on it. It should contain all the necessary tools to initialize with view, enable depth buffers, stencil buffers, presenting the content... All of these and more can be more or less pasted from examples and tutorials, all you need to do is restructure them. This would be your base construct as you will be able to create all components to draw and present but can not draw with it. To test it all you can do is try to clear the buffer to some value and see if you get the expected result.
After this the fun part begins: Creating the classes to handle and compile shaders, classes to create textures from images, matrix stacks, VBOs... Again all of these can be pasted from web but need restructuring.
So when you have all this necessary tools you can actually start working on the game itself. At this point most people take the wrong turn. Try to create objects that contain all the data you need to present a certain element in your game. For instance you have a character which is defined with a location, speed and an image (texture). This object can then have a draw method and a move method. The draw method will use the location to translate the matrix, will generate or reuse some vertex data, bind the appropriate texture and simply draw itself. The move in this case will only use the speed to change the location. As you go deeper more components are usually added and the situation can get complicated. But imagine only having what I wrote above you can create 3 images: character, enemy, bullet; then create as many objects as you need at any time with this images, move them around as you please, create crash detecting (which is very simple with this data) and you have a simple game which can become very advanced very quickly only by adding a few tricks.

3d structure in android application

So, for a personal project, I'm trying to make an app that helps newcomers get used to the school quickly. And for one section of it, I'm trying to build a 3D Structure, in a shape of my school campus, with lables incidating where the rooms are, so when the using searches for specific rooms, they can easily find it. So, It would be like from one activity, when I click a button, it opens a new activity with a search bar on the top, and the rest of the screen a 3d image people can navigate through. What's a way I can accomplish this?
I know that the structure part can be accomplished with Unity, which I haven't learned but have an idea of what it is, but I don't know how to build the rest of the app with Unity.. So..
You probably want to start with designing the model (structure) in some-kind of modeling program, Maya, 3DS Max, Cinema 4D, Blender, etc... (Personally I recommend using Blender since it's free and open source). Then you would want to export it to some 3D model format, I recommend using .obj since it is very human-readable and easy to parse on your own, but you can use some other format and parse it using a library.
Now comes the more difficult part and it's to render the loaded model onto the screen. This can be accomplished with OpenGL ES or a more highlevel library which can abstract it for you. If you're not familiar with OpenGL ES or OpenGL in general, I wouldn't recommend using it since it may take some time to learn. There are few libraries out there which can render 3D models pretty easily. Now you should probably create some-kind of a controllable camera as well so you can use it to navigate through the model.
This maybe looks like a lot of work but if you already familiar with computer 3D graphics it can ease it up for you.
Well, you can make a 3d model of your school using Blender (which is a free tool, but will almost certainly be a lot of work). Export the model as a mesh which you can insert into your app as an asset or resource. Read the resource and present it using (probably) opengl. This is a SUPER high level view, in actual fact there's quite a lot of work in each stage. Some third party libraries can make it a little easier, but it will still be a big job. I personally like libgdx for abstracting the pain of opengl, but that's just my personal opinion.
It's a big job, but would be super cool .. good luck!
I recommend starting off with building the structure in a program like Blender, Maja or 3ds Max. You can export your projects from those programs to pretty much any game engine and it makes more sense to build things in one of those programs.
Once you're done with that you can choose which engine you want to use to add the search function, if unity or Unreal or whatever but either way you're going to need to make yourself familiar with java or c to add the search function.
I recommend to use blueprints of building if available, it will save you a loads of nerves. Use it as a material texture and place it on a plane polygon to get a good lining helper.
If you do use Unity for development then try Maya for polygonal modeling. At least they are looking similar to each other whereas 3DSMax is always a mind f*cking experience.

Interactive animations on Android

This may be a duplicate question, but none of the questions I found were exactly what I had in mind.
A friend and I want to create an App that lets the user play around with 3D objects on the screen. My friend is creating the objects and the animations in Blender or Maya. Therefore, the possible animations will be preset (not being programmatically animated). I have no experience in 3D programming and I naively suggested that he render the animations in Blender and send me all the frames. I would then play the appropriate animation by quickly running through all the frames. Each animation would leave the object in its original position so that it would be ready for the next animation.
Now that I've been thinking about it, that's a lot of images that I have to store in order to make this work. For every object, I would need to have all its frames for all of its animations, which maybe overkill.
Is there another way to play animations in an Android app? I considered just saving the animations as videos and playing them, but that would look horrible for our purpose.
I'd suggest min3D
Take a look at the animated troll example they have.
There are a lot of 3D libraries for Android. I would recommend AndEngine. Alternatively, you can just use the native OpenGL compatibility. Instead, ask him to send you the actual 3D files. Then you can use a library to render them.
EDIT: I just found this link. It'll probably help you. In my opinion, you should go through it and learn the whole package instead of just glancing a bit for this one little project; it'll help in the future.
Yes, there is a way you can manupulate the models you created in Blender. here is an example which uses Open GL in android to animate a 3D model created in Blender Check This Video Out. However it animates the object programatically, frame animation is indeed not worth if you wanna create animations that are long as you will run out of memory quick.

Built en Character For Unity3D

I am new in Unity.I am going to make 3D fighting game so I need character so that i can customize them in Unity and can start on my work.So can anyone tell me is there any way to get built en Character so that i can not waste my time to make character in Other 3D modeling just like MAYA etc... So can i found Character and make them customize with my needs.
There are several resources like Unity Asset Store, Blendwap, 3DExport.com, Mixamo Autorigger, TurboSquid and others, where you can find a lot of models off the shelf. But be warned:
Chances are very high that at the end you will find yourself tuning and customising in Blender, Maya or whatever tool you (don't) like ;-) There is almost always a need to change something and then you have to learn at least the basic concepts or find someone who does this for you. As you have tagged this question with Android, you have to bear in mind that you are limited to low-poly characters (<= 1000 vertices, <= 30 bones)

Categories

Resources