Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we have gltf renderer for Android? #1218

Closed
ravip opened this issue Jan 23, 2018 · 5 comments
Closed

Can we have gltf renderer for Android? #1218

ravip opened this issue Jan 23, 2018 · 5 comments

Comments

@ravip
Copy link

ravip commented Jan 23, 2018

Thanks to KhronosGroup for nice specifications of GLTF, a runtime 3D format.

I can see GLTFSceneKit plugin is available for iOS but there is no extensiion available to support gltf on Andorid. I have seen many people are looking out for good plugin / extension to support gltf on Android, a widely used mobile operating system.

Can we get plugin / extension for 3D rendering of gltf for Android?

@javagl
Copy link
Contributor

javagl commented Jan 23, 2018

There are libraries like jMonkeyEngine that should work on Android ( https://jmonkeyengine.github.io/wiki/jme3/android.html ) and they recently announced that they support glTF ( #1202 ).

(Internally, I started working on a jgltf-viewer-android based on https://github.com/javagl/JglTF , but this will still take some time....)

@nishantdande
Copy link

Hi,

We have tried extending https://github.com/javagl/JglTF for android. So, below is our findings -

In Android, I have used all required library which are required to render gltf model. Library as below -
jgltf-impl-v1-2.0.0-SNAPSHOT.jar
jgltf-impl-v2-2.0.0-SNAPSHOT.jar
jgltf-model-2.0.0-SNAPSHOT.jar
jgltf-obj-2.0.0-SNAPSHOT.jar
jgltf-viewer-2.0.0-SNAPSHOT.jar
jgltf-viewer-jogl-2.0.0-SNAPSHOT.jar

After successfully gradle sync, I used AbstractGltfViewer class for android compatibility. But unfortunately I am getting build error as below -
Error:java.lang.ClassNotFoundException: Class de.javagl.obj.ReadableObj not found
Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\4.jar --input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\10.jar --input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\9.jar --input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\3.jar --input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\17.jar --input C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\classes\debug --output C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\desugar\debug\0 --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\classes\debug --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\17.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\19.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\20.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\21.jar --classpath_entry C:\Users\Nishant Dande\Desktop\GLTFModel\app\build\intermediates\transforms\stackFramesFixer\debug\22.jar --bootclasspath_entry D:\nishant\tools\android-sdk_r24.4.1-windows\android-sdk-windows\platforms\android-26\android.jar --bootclasspath_entry D:\nishant\tools\android-sdk_r24.4.1-windows\android-sdk-windows\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 15 --desugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
Information:BUILD FAILED in 5s
Information:2 errors
Information:0 warnings
Information:See complete output in console

Please share your view on above error and please let me know how to use Jgltf Java Library in Android?

@javagl
Copy link
Contributor

javagl commented Jan 24, 2018

Note that JglTF is not yet supposed to work "perfectly" with Android. During the update from glTF 1.0 to glTF 2.0 I tried to address some of the issues mentioned in javagl/JglTF#4 , but there may still be some incompatibilites. I'm still working on all this.

However, in this case, the message

Error:java.lang.ClassNotFoundException: Class de.javagl.obj.ReadableObj not found

indicates that it dos not seem to find the OBJ loader. This is one of my other projects, available at https://github.com/javagl/Obj and in Maven Central, and declared as a dependency in the POM at https://github.com/javagl/JglTF/blob/master/jgltf-obj/pom.xml#L39

However, for the viewer itself, you should not need the jgltf-obj library. So for the first tests, you could just omit jgltf-obj.

(I'll try to allocate some more time for getting all this up and running on Android. There really seems to be some demand for that...)

@nishantdande
Copy link

Thank you very much. If you have any glTF repo for android, please share with me. So that I will also try to contribute for Android glTF project.

@donmccurdy
Copy link
Contributor

Going to mark this as closed, as we're currently not tracking implementations closely on this repo, but would be excited to hear about progress on Android as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants