Multiplatform 3D graphics library

There is a new interesting development in 3D rendering. Lars Ivar Hatledal just announced full kotlin-jvm port of three-js library: https://github.com/markaren/three.kt. It is not JS wrapper, but a complete port to desktop OpenGL. We had a small discussion about it and it seems to be possible to create a full multi-platform support for this effort including wrapper for JS, stand-alone implementation for JVM (I hope to also add JavaFX back-end) and in future native wrapper of native OpenGL.

The problem is that project is too large for two of us because it is not primary concern for both (I am OK with web version for now and Lars needs only desktop-JVM). So the question is how much interest does this project rise and are there people willing to work on it.

7 Likes

The ongoing discussion is here: https://gitter.im/markaren/three.kt

I had vague plans to do start almost exactly that project in the future, and would be willing to work on this instead, but I might have to put off some other things to find time to work on this in the near future. The idea of a comprehensive 3D rendering library which is portable between Android, web and other is very appealing.

A few years ago there was a similar project, but rewritten in Java rather than Kotlin, called Parallax 3D, and I started porting it to Android. I never finished it, but I did do enough to get several of the demos working. But upstream is no longer under development, and Kotlin happened.

Most of the difficulty in making Three cross-platform is coping with the different OpenGL/ES/WebGL APIs so what I was planning to do this time was write wrapper libraries to provide the WebGL API to Kotlin on native and JVM platforms. Much of the process can be scripted. I think that should make maintenance of the rest of the library simpler. Would that be helpful for three.kt?

You should join gitter discussion and see what is happening there. My opinion is that one good library is better than several average ones.

Maybe Translate JMonkeyEngine from Java to Kotlin is better.

Personally, I do not need Game engine, I need a 3D visualization library. Also I am not sure that it will be possible to create a multiplatform from it. Three already has web.

Jmonkey is perfectly usable from Kotlin so that would be a waste of time unless you want multiplatform, which is probably impossible.

Anyway, the three.js API, features, easy of use, community etc are superior to existing Java 3D libraries, which is why Im doing this.

Why would you prefer a JMonkey API over a Three.js API? Honest question. IMO, three.js is much simpler, supports more 3D formats, looks better with less work, has better examples and documentation and a bigger and more active community.

My previous comment was sponsored by beer (I thought your “impossible” was about three in multiplatform). I re-read your comment and now i see what did you mean. I like idea of multiplatform three.