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

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.

Related

How to hide a sub-mesh from SFB file in ArCore Android

I'm rendering a SFB file which I generated from an FBX file using ArCore's sceneform in Android.
Now, I want to hide a part of this 3D model at runtime programmatically. How can I achieve this in Android?
So far, I didn't find any way till ArCore v1.9 to hide a part of SFB file.
So, I'm using two model files (fbx/obj) and then at first, I rendered generated two SFB files in a separate Nodes and then added these two Node objects into a single Node. This is working seamless.

Unity3D Android - Download assets from an API and import on device?

Questions are first then some description which helps explain the questions:
Questions:
Will Unity be able to easily import downloaded assets from our API if we save them in a specified directory with our core Android app?
Can we pre-serialize the 3d model assets before uploading them to our API so that they do not need to be serialized by Unity on device? This is so that they load faster
Description
I'm not a Unity/3D developer or an Android developer so apologies if this question doesn't meet community guidelines (I built the API in this scenario). This is also probably very long for what should be simple questions.
We've built an API which serves 3D model files in Collada 1.4 (.dae) format to iOS and Android client applications. File sizes can be quite large (upwards of 80-90mb in some instances) although the majority are in the 4-15mb region.
On iOS we've been having the application download the models from the API and then render them onto the screen via SceneKit which has been relatively simple to achieve. We put the Collada files through a preprocessing step before serving them which converts them into a proprietary format used by SceneKit.
In Android we've encountered any number of problems. We initially experimented with converting models to OBJ instead of Collada and using Rajawali, jPCT and a few other loaders for Open GL ES2.0 but due to our file sizes the time to read and load the models was far too long. We've now decided Unity is probably where we need to go on Android as a rendering engine.
The Android app will consist of two parts, a core app which has an interface for viewing images of the models and downloading the model files and a Unity app which is loaded via an activity from the core Android app to actually render the models.

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

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