# How can I port my Gear VR app (Java, OpenGL ES) to Unity?

I want to port my Gear VR app (created in Java using the official framework) to Unity, so I can also support Microsoft's new-ish VR headsets (not talking about the Hololens!).

In my current app I'm using OpenGL ES to draw everything I need (the app reads coordinates and additional information about what it has to draw from a .txt file), which is:

1. GL_LINE_STRIP: The .txt file gives it a bunch of coordinate triples (x, y and z, so single vertices), it then has to automatically connects them (usually without loops)

2. Kind of plane: Either display a rectangular plane with a texture (using the Gear VR framework's "GVRSceneObject") OR create an outline (usually first point = last point) that then gets filled in a specific color (GL_TRIANGLE_FAN) AND that is a little bit transparent - if it includes concave areas, it's using GL_TRIANGLES and the .txt file has coordinates for single triangles that have to be displayed at the same time and filled (it's still a single object/mesh!)

What I need Unity to do (with 1. and 2.):

• Display a couple of 1. (could be up to 50 or more) and 1 of 2. at the same time (there'll never be more than 1 of type 2.!)

• Remove all of 1. (that are displayed at the same time) or 2. from the scene and/or replace them with a couple of different 1. or another 2.

• Group a couple of 1. together, so you can remove them at the same time (which would make stuff a lot easier)

• Read .obj files (including their texture) from internal storage (Android) or the HDD (Windows) and display it/them instead of 2. (the .txt file includes the path to the file and texture)

Everything has to happen at runtime, since the app doesn't come with any .txt files or pre-imported .obj scenes/objects!

My question is:

How can I do this with Unity, targeting Windows and Android?

• Please note that questions asking if something is doable with a piece of software is considered off-topic here. I reworded the question so that it fits within our scope. – Vaillancourt Feb 6 '18 at 14:57
• Asking for libraries is off-topic for this site (see the help), please don't ask for it again. – Vaillancourt Feb 6 '18 at 15:29
• Then where can I ask for one, since Unity doesn't seem to fully support everything I need? So many restrictions that don't make any sense... I don't even want to know HOW to do what my thread now asks (I'll try and look that up myself if it can, once I actually understand how Unity works), I just want to know if there's even a point to get into Unity on its own! Btw, I checked your help, I'm not asking what technology to use for my "game" idea but what "technology" can do what I need, if I'll then use it, that's a different question, so no, it's not off-topic. ;) – Neph Feb 7 '18 at 9:27

You can generate procedural meshes in Unity. So you just need to write some code which takes your coordinates and uses them to build a Mesh component. You can then assign these meshes to game objects, set the right material on their renderer and you should be good to go.