Cardboard view is upside down

Hi all, I’m in the middle of dabbling with Cardboard, and the only problem I have is that the view is upside down. I started with a fork of GitHub - nordfalk/gvr-android-jme: JMonkeyEngine integration with Google VR SDK . Is there a more up-to-date codebase for starting work on Cardboard?

The issue is mentioned in this thread: Google Cardboard support - #65 by ScienceOfficer but I couldn’t discern if there was a solution, since the thread covers a multitude of issues and fixes to do with VR (one reason why I started this new thread).

Any help much appreciated. Thanks!

You can always just set the Y scale of the JmeHarnessFragment to -1 in order to flip it. Should probably work.

Thanks for the reply. Unfortunately, the project doesn’t have a JmeHarnessFragment (that I could see). My project is based off the StarTravel project. Do you mean AndroidGvrHarness?

I just tried adding the following line in AndroidGvrHarness:-

public void setGvrView(GvrView gvrView, boolean enableVrModeFallbacks) {
    // Need to get hold on a view to let AndroidLocator load its assets
    gvrView.setScaleY(-1); // <-- Added this line
    super.setGvrView(gvrView, enableVrModeFallbacks);

… but unfortunately, that just meant I had to hold my phone upside down to get Cardboard to start (and the text “Please place your phone…” was backwards); the view was the same.

Then I can’t help you, sorry :confused:

Thanks anyway.

I did also try setting “up” to be “down” with this hack:-

    Vector3f.UNIT_Y.y = -1;
    cam.lookAt([...], new Vector3f(0, -1, 0));

…but this didn’t seem to change anything.

Does anyone know if this is a known issue with JME/Cardboard or is it just me? And/or are there any open-source JME projects that anyone knows about that might have solved this problem? Thanks!

This integration looks pretty buggy.

They are updating the game twice, once for each eye. So one eye would show the scene at a slightly time than the other eye. I wouldn’t use something that has such major bugs:

Do you have any recommendations for what source I should be using as a good base for a “JME cardboard” app?

Probably you will need to write your own integration. Apparently the VR SDK was changed / upgraded recently and the current integrations were not updated (?)