Skip to content

zebrajaeger/jsphere2cube

Repository files navigation

cube2sphere

Converts a spherical panorama image into a cube map faces/tile tree and creates .html file to render it within browsers.

Directly supported viewers (html generation):

clone this repo

Preconditions

Compile / install application

  • Clone the project with git (or download as archive and extract).

  • Execute in this directory (this means: the directory of this readme file):

    mvn clean install

Run application:

jar (single)

From core/target directory take the jar and make it available in your path. Then run (version number may different):

java -jar sphere2cube-java-core-0.0.1-SNAPSHOT-exec.jar [parameters]

Config file

Default name is "sphere2cube.json"

Example (at least change source.path for input file, everything else may be ok):

{
  "debug": false,
  "source": {
    "path": "/home/l/prj/panos/IMG_1766_S(168.00x25.63(8.99)).psb"
  },
  "target": "./target",
  "preview": {
    "cubemap": {
      "enabled": true,
      "edge": 200,
      "target": "preview_cube.jpg"
    },
    "equirectangular": {
      "enabled": true,
      "edge": 800,
      "target": "preview_equirectangular.jpg"
    },
    "scaled": {
      "enabled": true,
      "edge": 800,
      "target": "preview_scaled.jpg"
    }
  },
  "cubemap": {
    "tiles": {
      "enabled": true,
      "tileEdge": 512,
      "target": "{{levelCount}}/{{faceNameShortLowerCase}}{{xIndex}}_{{yIndex}}.png"
    },
    "faces": {
      "enabled": false,
      "target": "{{faceNameLowerCase}}_{{levelCount}}.png"
    }
  },
  "viewer": {
    "pannellum": {
      "enabled": true,
      "title": "cube2sphere - Pannellum",
      "target": "index.p.html",
      "js": [
        "https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.js"
      ],
      "css": [
        "https://cdn.jsdelivr.net/npm/pannellum@2.5.6/build/pannellum.css"
      ]
    },
    "marzipano": {
      "enabled": true,
      "title": "cube2sphere - Marzipano",
      "target": "index.m.html",
      "js": [
        "https://cdn.jsdelivr.net/npm/marzipano@0.9.1/dist/marzipano.min.js"
      ],
      "css": [
        "https://www.marzipano.net/demos/sample-tour/style.css"
      ]
    }
  },
  "archive": {
    "enabled": true,
    "target": "pano.zip"
  }
}

Links

TODO

HIGH (required)

  • More differentiated logging
  • Progress bar
  • Timer
  • Marzipano viewer
  • read embedded xml of Autopano Giga
  • restrict view angle dependent from source image bounds
  • Add css and js from viewers instead link to CDN
  • zip file packing (multithreaded)
  • simple drop-target UI
  • Add configuration options to UI

MID (nice to have)

  • maven plugin that doesn't make too much sense
  • self containing application
  • Populate README
  • Panorama description file

LOW (later or never...)

  • output image paging for images that are too big to fit in memory
  • input image paging for images that are too big to fit in memory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published