Rendering exported 3D objects on Android using min3D - android

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?

Related

Tensorflow SSD300 for Android

I'm a college student who studies machine leraning in Japan.
I'm not good at using English, but I will make efforts to convey my situation in English.
I'm now trying to use the object detection model for android.
I used SSD300_mobile_net for training and then I got .hdf5 file which has model's weights.
Next, I convert this .hdf5file into .pb file which is fit for tensorflow.
At last, I want to use this .pb file for tensorflow android .(https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android)
But I got an error on Android Studio as below while debugging the application by using my device
This is the error capture
I want to know how to solve this problem.
I sense that it's an issue with your hardware. Generally the hdf5 files are very big and even bigger is the computation that is being done on it. Since your system is giving OOM exception, I believe you are getting this error while loading weights into the model.

Adding external 3D(.OBJ & .MTL) Objects to ARToolkit

I have been working on the ARToolkit sdk for android since some time.
In the ARToolkit SDK, I have worked on ARBaseLib and ARSimpleNativeCarsProj and implemented successfully. But I am trying to add external 3d Objects(.obj and .mtl) and I am unable to render the new object files.
I have also looked into the source code provided in this link,
https://github.com/kosiara/artoolkit-android-studio-example
but the problem here is the 3D object(Cube) has been created in using the draw(), openGL libraries function, instead i would want to add an external 3D Object.
More Explanation:
Okey, SimpleNativeCarsProj comes along with two 3D Objects(.OBJ and .MTL) in the assets/Data folder. CASE1 I tried replacing the existing 3Dobject with another 3D Objects, App Crashes on the launch CASE2 As I worked around a little, these files are pushed to the cache folder on the app load, I invalidated the caches and restarted android studio, rebuilt and ran the app, still the app crashes on the launch. Technically I am unable to Replace/Delete/Add another 3D Object files to SimpleNativeCarsProject
Any headsup would be appreciated.
Convert your FBX files
The Encoder works wit FBX (.fbx) files. We recommend using FBX wherever possible as tools support for FBX is widely available.
http://www.wikitude.com/products/wikitude-sdk-features/wikitude-3d-encoder/
Give ArToolKitJpctBaseLib a try. It is a wrapper on ArToolKit + jPCT-AE (a 3d Engine on Android) aims to simplify creation of AR apps for Android.

Download and injecting unity scene in runtime

It's possible that we start an android project in which it's necessary after recognising an image by camera to visualise a content generated in unity.
The easy part would be to use webGL to display it, but there is the problem of devices that do not support it directly. My question is if from android (and later iOs). It's possible to download a content of unity, load and visualise it in runtime?.
Is possible that I had to direct all the effort to generate that content in a .jar and then use something like dependency injection to load it?
I have already a unity scene in an activity but of course in project definition not in run time.
Any help or guidance would be welcome.
Unity builds levels into the final runtime executable, so adding a downloaded 'scene' directly is not possible. The best way around this is to create a 'generator' scene which can accept input from a downloaded text file, such as JSON, and use that to render the level.
However, this method does assume that all the possible objects that can be rendered are in your game as prefabs. If you're wanting to pull images from the net to be loaded into textures, the WWW class might get you started down the right path:
https://docs.unity3d.com/ScriptReference/WWW.LoadImageIntoTexture.html

Make Vertes,TexCoords,Norms and Indices vuforia

I use of Vuforia sdk for AR in android.
I make 3d file with jpct(obj file,mtl file and png file),i add these file on my project,how can i make my object 3d object file(like teapot class) for set Vertes,TexCoords,Norms and Indices in vuforia.
Thanks
This has nothing to do with vuforia, per se.
Qualcomm uses a simple renderer for their demos, for convenience and so they can have something to display. There are many possible ways to render an obj file, but there is nothing special about their approach. I do not recommend using that approach in your code: rather, a quick search will show you a variety of much more capable 3d model loader/renderers for android. You should use one of those, it will be better for you in the long run.
If you you are dead-set on using their code, look at the code that renders the teapot, it should be obvious how the data in the teapot class is used.

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

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.

Categories

Resources