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.
Related
I am trying to find approaches on stamping multiple textures on an object (3D .obj) Android. But, I am unable to do so, I have tried min3d but not sure if it is the right way to do it?
Is there anything available around which is similar to this? Or How Should I approach this UI? Below is the UI of model and how I want to stamp an "image"/texture on it, in addition I want to change the color of the model / add text on it.
In addition, I am planning to give touches on it, by stamping username/label/textview at the back of the model by using rotation through touches.
Please guide, which SDK should I use on Android, what is the best approach to do it.
What you want is basically just rendering textures on a given 3D mesh, as far as I can see. You could take multiple approaches for this: The simplest being just texturing the actual object, but a more complicated approach could involve rendering the object and "stamp"&text textures separately, giving the illusion of being overlayed (Not preferable though, as this will be difficult to manage correctly).
For texturing, you can either attempt rendering different textures after each other (First the background, then the stamp, then the text), or combining the different elements into one texture (pre-processing) before rendering.
I recommend having a look at the following posts and articles:
OpenGL ES (which can do everything you want to do, but has a decently steep learning curve)
Switch to a different 3D rendering engine if you find it too difficult to use your current one (Many options, although most are fullblown game engines)
Loading 3D objects and textures for OpenGL ES rendering
Check out the following git snippets and articles on texturing in min3d: this, this article, this article on object loading
You did not provide any code displaying your current attempts, so it is difficult to say what exactly your problem is, and how to solve it. If you edit your question you might receive more concrete solutions besides just links to potentially helpful resources.
Perhaps working with the OpenGL ES 2.0 api might be an option. Take a look this repo here called the Android 3D Model Viewer which makes use of it, it might help you out.
I'm asked to do an app with a 3D object mapped on a tag on the camera preview. The user should be able to rotate the 3D object on swipes, and to click on different area of the 3D object.
I'm investigating the different way to do it.
So far the best option I've found seems to be https://developer.vuforia.com/resources/sdk/unity, but I can't find whether it's possible to interact with the 3d model (rotate on swipe, define clickable areas).
Has anyone any experience with that?
I guess I can do it with some OpenGL, but I have no experience with it and it seems quite complex to start off with.
Is there any other library I should consider?
I would use OpenGL and start by the training tutorials on http://developer.android.com/training/graphics/opengl/index.html. Hope this helps! If you follow these tutorials you will be able to do what you want. ive tried unity and it is a really good engine too. and of course you can make an object clickable with unity! maybe using unity would be easier but the documentation on opengl is huge and is not that difficult to implement at least with first steps. hope this helps
The Metaio SDK can do all of that but I am not sure if it automatically provides the area of the model tapped, but you could ask here.
I'm looking for a 'basic' AR SDK that allows me to draw images and 3D shapes around the user (no matter where he is). It would be even better if the SDK includes a simple way to detect interaction with the shapes (something like onClick).
I made a project from scratch on Android but there's still a lot of work to do and I'll need to do the same on iOS after... So that's why I'm looking for an SDK or a similar project (no matter what platform).
I tested Metaio but it's quite expensive and maybe overkill for my purpose because it uses LLA coordinates.
I tested DroidAR on Android but it's only for Android and it looks heavy too (don't need the GPS).
How about Qualcomm's Vuforia? I was able to quickly get a sample project running on it.
EDIT Looks like I was wrong about what it could do. According to this (which is slightly dated, so who knows) Metaio might be your only choice.
i really don't sure what you really want to do ..but if you simply show images or 3d models on camera without any detection you can achieve this very easily i am explaining for Android and you can extend it to ios on same logic.
first approach:
you have to use custom camera of Android in your app,then use any game engine as per your need..i will suggest Jpct-ae or Rajawali
they are very simple to integrate and can be used for 2d images and 3d models.
this tutorial will explains a lot
keep the gl-surafce transparent and you can have model floating in space ...
second approach :
to add some more effect to your AR app you can use sensor values to move model in 3d space as per movement of device..it gives a cool effect.
use first approach and additionally collect sensor values and apply that matrix to gl camera of your game engine..for sensor values follow here
good tutorial here..
i hope this may help you..i done these a long time ago but try to help if you want..
I'm trying my hand at making a platform game and have been thinking about what I would use to design levels.
I was thinking of using a tile palette that would contain the graphic tiles and their properties. And a similar palette that would contain sprites.
This way I could drag and drop tiles/sprites onto a grid and specify property values. This could all be saved to some kind of file that would be read by the game.
Without getting too into the details, is this a sound overall strategy? Is there anything major that I'm forgetting? Or perhaps there's a better method?
This is a rather open-ended question, but I don't think there is anything wrong with your approach. You might have to try a few things to find out what works for you.
When I make platform games I find it useful to be able to edit levels while I'm playing them, by adding in code to the game which allows me to select a graphic tile from a palette and paint it onto the screen. The behaviour is usually linked to the graphic for my games but you could paint behaviour as well. You then need code for your game to save levels as well as load them. Obviously, you would probably want to remove the editor before releasing the game.
I don't know how much experience you have with game dev, but if you're thinking about making a tile-based platform game then your best bet is leveraging existing libraries/tools to avoid "re-inventing the wheel". I highly suggest looking into open source libraries/tools because you can modify them to your liking. I've had some good experience with libgdx and AndEngine in which case both have TMX support which is a file format that can be used in conjunction with Tiled map editor. I personally like libgdx because it has javadoc and very actively developed, and also that it's a framework rather than engine which gives you more flexibility (although more coding in some aspects).
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.