Example #1
0
  public void setup() {
    // size(1024, 768);
    /// size(1024, 768, P2D);
    size(1024, 768, OPENGL);
    // size(1440, 900, OPENGL);
    // size(screenWidth, screenHeight, OPENGL); /// have to hard code it if running a standalone

    smooth();

    // load earth texture image
    // earthTex = loadImage("../data/earth_4096.jpg");
    earthTex = loadImage("../data/earth_4096_blue.jpg"); // ../data/earth_outlines.jpg"); //
    // earthTex = loadImage("../data/earth_outlines.png");
    // bgImage = loadImage(bgPathImagePath);

    // build a sphere mesh with texture coordinates
    // sphere resolution set to 36 vertices
    globe = new SurfaceMeshBuilder(new SphereFunction()).createMesh(null, 36, EARTH_RADIUS);
    // compute surface orientation vectors for each mesh vertex
    // this is important for lighting calculations when rendering the mesh
    globe.computeVertexNormals();

    // setup helper class (assign to work with this applet)
    gfx = new ToxiclibsSupport(this);

    /// add the OSC listener object
    oscP5 = new OscP5(this, 8000);

    // initPoly();

    // init our instance of the data profile
    dataProfile = DataProfile.getInstance();
    // set the papplet so we can get to it from any class
    // instead of passing it back and forth like a potato
    dataProfile.pApp = this;

    /// init the popup object
    /// wait to parse the XML
    /// before initializing the video
    thePopUp = new PopupObject();

    //// LOAD XML ///////
    loadXML();
  }