0

I am a beginner android programmer and developing a VR app by cardboard SDK and have used a switch-case and button for switch between photos but I know some apps use a central point and "focus on an icon" method to change view of a 360 photo to another photo. for example by 3second looking to that icon call an event to do a function.enter image description here

public void onClick(View v) {

    if (v.getId()==R.id.button1) {
        i = i + 1;
        switch (i) {
            case 2:
                panoImageName = "p1.jpg";
                loadPanoImage();
                mediaPlayer.start();
                panoWidgetView.addFocusables(Imgs[0],1,2);
                break;
            case 3:
               onPause();
                panoImageName = "logo.jpg";
                //loadPanoImage();
               // onResume();
                break;
            case 4:
                panoImageName = "p2.jpg";
                loadPanoImage();
                break;
            case 5:
                panoImageName = "logo.jpg";
                loadPanoImage();
                break;
             }
    }
}

do you have any idea for it?

Sample image of a VR app screen:

Sample image of a VR app screen

Guillaume Barré
  • 4,168
  • 2
  • 27
  • 50
makhco
  • 11
  • 3

1 Answers1

1

I'm new to Unity and working to create a VR photo viewer with UI buttons to change the photo. I am able to complete it through multiple resources as described here:

  1. I downloaded a unity project from the dropbox link given in this youtube video: https://www.youtube.com/watch?v=hYXj77CSDks&t=65s

  2. The above project can change the photos but by clicking the buttons.

  3. To control the next and previous buttons with focus (Gaze) I followed this post:how to add gaze input timer to trigger an action after gazing for 3secs?

This worked for me so far.

Community
  • 1
  • 1
M. Ahsan
  • 31
  • 1
  • 6