Use .obj and .max files in AndEngine for Android games - android

I am working in a game which is using AndEngine to develop.I successfully use .jpg and .png files in this.But I face too much problems when I trying to use Maya Animated files (which are in .max extension) and also .obj files. Can anyone please suggest me how can I use .max files. Or at least .obj files in my programs.Hope everyone understand my problem clearly. Thanks in Advance

I am not entirely sure: But AndEngine is a 2D game-engine while .max and .obj files usually describe 3D object/animations. For example obj files can contain vertexes, while AndEngine is not capable of using vertexes directly (although, some extensions might).
What I am sure of: you can always make little screenshots of your Maya animation and put them all in a row in a png file and use the png image instead.

Related

How can we add animated/simple image as a top layer to video and export it as a single video in Android?

I need to merge images to video as an overlay and export it. I have found ways to create video from images using javacv but didn't find any jar or library which do add images as an overlay to existing video, some of the links suggest to use FFMPEG and JNI to achieve this but sadly i don't have any knowledge of JNI. They use avfoundation framework in IOS to achieve the same.
The above image is replica of my requirements, if any one can guide me in right direction and provide me some useful stuff to start with would be appreciated.
What i have achieved so far is:
1) Compiled FFMPEG.
2) Generated .so files
3) Compiled and able to run Hello Jni project.
What i am searching for is:
1) Splitting video into frames.
2) Merging my overlay images with video frames
3) Recreating the video with audio.
and i know JNI is the only way to achieve this so searched a lot but didn't find any good JNI stuff to start with. I am not asking for the whole code but if some one can point me out with some good tutorial or blog would be great help.
Thanks!!
The way to accomplish this is like you said - incorporate a video codec and use it to re-compose the video.
Decode the original video
Draw your overlay over the original video frames
Encode the frames again.
Using FFMPEG with JNI is the obvious solution, but if you find any other codec library that can accomplish the same with pure Java, it will work too.
No knowledge of JNI? That's about time to learn it =)
References for learning:
NDK docs on your file system: http://developer.android.com/tools/sdk/ndk/index.html#Docs
JNI - http://192.9.162.55/docs/books/jni/html/jniTOC.html
FFMPEG for Android - there are many tutorials out there and many source trees that contain a ready build environment.
You can either follow them or just do it on your own - provided that you understand the NDK environment and can read makefiles.
This is an example: http://vec.io/posts/how-to-build-ffmpeg-with-android-ndk
Using FFMpeg to encode\decode frames - sadly, no good up-to-date tutorials here, there is the API documentation: http://ffmpeg.org/doxygen/trunk/index.html
Blending bitmaps - use Android's Canvas infrastructure, or just manually copy pixels over each other and blend according to alpha values.
Warning - this is a complex library to build and you'd better experiment with easier NDK projects before attempting this one.

Displaying SVG files in Android

I want to create an app that will display position on some floor plan. Navigation is implementing via WiFi in certain way, I've done it and so now I have a problem of displaying floor plan.
It might be in some vector format, after surfing internet for some time I've decided that it must be svg file.
I found some solutions, but it isn't working for me!
Library svg-android
There is opportunity to display .svg files, but only "simple" files. It works fine only for file in tutorial, but not for any other .svg file (for example, some other file, that you'll create with Inkscape).
So, I decided, that I'll parse .svg file, make DOM from it, somehow get objects and attributes and draw it via OpenGL ES.
Apache Batik
At first glance, very good solution, but there is a problem. Android has some "native" apache libraries and when I try to do something with batik, it throws NoClassDefFoundError, because it's searching not in batik libraries, but in "native" libraries.
Of course, we can add source code in our project, take only batik parser for .svg files and edit it in some way, but there is a lot of work, with same success we can write our own parser.
Tiny Line
There is no trial version, but if we'll see description of how it works for svg files and android, we'll see that there is only rasterization of such files and that's all.
Is there any solution better than writing own parser?
Did anyone come across this problem?
I would suggest using #1. Don't write your own parser. It's just going to be a huge headache.
How detailed does your floor plan have to be? android-svg supports SVG fairly well. It just doesn't have great support for filters or light sources. Your SVG isn't going to have those in them (I hope).
If you don't want to do that, look into quad trees. You can render out a huge image and break that down into a quadtree like format then only load the quads you require.
I have authored an SVG libaray for android the website is
http://www.vectoroid.com
the main thing missing is SVG arc support this is currently fixed and will be in a release in the near future.
I am looking for feedback on it, as i have been working on it for about a year. So if you have any please do tell ...
I've using yet another SVG for Android; seems it is relatively new.
GPLv3, CSS2 support, fonts, texts and spans, linear and radial gradients, SVG and SVGZ, initial filtering support, images from assets, from web and inline base64-encoded images. Fastest from all I've tried.
Of course filters support might be better, but except this it works well and even displays 20-megabytes SVG files.
Successfully tested these 2 libraries:
https://github.com/BigBadaboom/androidsvg - Apache License 2.0
https://scand.com/products/svgkit-android/ - needed tweaking to compile with modern SDK (suppress warnings, update gradle file); LGPL / commercial
androidsvg looks better so far.

How to render .mtl file in .obj in libgdx android

I've a face.obj and face.mtl file. But libgdx doesn't allow me to render face.mtl it just takes face.mtl that's why I'm not able show texture on it. So how should I load face.mtl in directly face.obj file.
Thanks.
Indeed, LibGDX was not loading .MTL files before, and you were expected to manually load texture assets for your .OBJ model.
Now (Oct. 2012) it does. (As seen here https://github.com/libgdx/libgdx/pull/71)

Rendering exported 3D objects on Android using min3D

I'm creating a bike racing game for Android. I am planning to create models in Blender, export them to .obj format and then render them on the device. I'm using the min3D framework to do the obj parsing and rendering. I followed the tutorial in this page for parsing the obj file and to render it on the screen. When I tried simple object like a cube, everything works fine and it is rendered perfectly on the screen. But when I tried to load a simple bike model I downloaded from the web, it doesn't work. The app crashes and I force stop it. When I saw LogCat, it was either a java.lang.NumberFormatException, or java.lang.NullPointerException or a resource not found exception inside the parse() method. I have no clue why this happens.
I have the following doubts about where it possibly could have gone wrong:
1) According to the given tutorial, I changed the file names from .obj and .mtl to _obj and _mtl. But there was a line in the obj file that has the name of the .mtl file. I changed it to _mtl. Still it dint work. Is there something similar I need to do anywhere else? Do I need to modify any of the files in any way?
2) Sometimes I find that models created in Blender 2.49 are parsed and rendered but the models created in Blender 2.6 are causing this trouble. Also min3D was created during the older versions of Blender. So should I use only Blender 2.49 for creating the models and rendering them?
P.S: I'm completely new to graphics so I'm fighting a lot with this without giving up. Any help would be greatly appreciated. :)
I believe this is because of missing Texture. Did you copy the texture image into res/drawable folder?

How to use blender on Android

I want to develop a small game in Android. But for this I need to get animation into my Android project. Can I use blender to create animations and then port it into Android. If not then what other software can I use to create animation on Android. Are there any tutorials for this on the net.
With blender you can export your mesh/animation to a number of file formats. Your Android application must now be able to read the file format you have exported the animation with. A common file format blender is capable of to export is .obj. This article describes the implementation of an .obj file loader.
This is an excellent example for an mesh loader.
Here you can find some other links.
HTH
You can play with blender animations in Unity3D which runs on Android
I wanted to do the same : animate in blender and be able to do a 3D app for Android.
I ended up choosing Unity3D which is really great : you build your animation in Blender and you export it to Unity. Then in Unity you can code your application and export a .apk :)
Cheers,
bRo

Categories

Resources