Giter Site home page Giter Site logo

panoramagl's Introduction

PanoramaGL Android

PanoramaGL library was the first open source library in the world to see panoramic views on Android. This is a gradle build adaptation, along with other changes and updates. I am evolving the library to something easy to use any help is welcome.

The supported features are:

  • SDK 2.0 to 5.+.
  • OpenGL ES 1.0 and 1.1.
  • Support for spherical, cubic and cylindrical panoramic images.
  • Scrolling and continuous scrolling.
  • Inertia to stop continuous scrolling.
  • Zoom in and zoom out (moving two fingers on the screen).
  • Reset (placing three fingers on the screen or shaking the device).
  • Scrolling left to right and from top to bottom using the accelerometer.
  • Sensorial rotation (Only compatible for devices with Gyroscope or Accelerometer and Magnetometer).
  • Full control of camera including field of view, zoom, rotation, rotation range, animations, etc.
  • Hotspots with commands.
  • Simple JSON protocol.
  • Creation of virtual tours using the JSON protocol or with programming.
  • Transitions between panoramas.
  • Support for events.

Usage

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.hannesa2:panoramagl:$latestVersion'
}

Create a PLManagerobject and add the bindings to the activity lifecycle methods:

    private PLManager plManager;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        plManager = new PLManager(this);
        plManager.onCreate();
    }

    @Override
    protected void onResume() {
        super.onResume();
        plManager.onResume();
    }

    @Override
    protected void onPause() {
        plManager.onPause();
        super.onPause();
    }
    @Override
    protected void onDestroy() {
        plManager.onDestroy();
        super.onDestroy();
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return plManager.onTouchEvent(event);
    }

Next set the view, before calling plManager.onCreate:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        plManager = new PLManager(this);
        plManager.setContentView(R.layout.activity_main);
        plManager.onCreate();
    }

Finally add the panorama you want, for example;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        plManager = new PLManager(this);
        plManager.setContentView(R.layout.activity_main);
        plManager.onCreate();

        PLSphericalPanorama panorama = new PLSphericalPanorama();
        panorama.getCamera().lookAt(30.0f, 90.0f);

        panorama.setImage(new PLImage(PLUtils.getBitmap(this, R.raw.sighisoara_sphere), false));
        plManager.setPanorama(panorama);
    }

ToDo

  • Separate View, ViewController, TouchController and SensorController

panoramagl's People

Contributors

hannesa2 avatar harshsharma94 avatar lespinsideg avatar marianmoldovan avatar tommyteavee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.