sjbowen / layers

layers interactive
0 stars 0 forks source link

Code for creating interactive spherical panoramas based on Marzipano (v0.3.0)

This version by Simon Bowen May 2017, minor updates December 2023. [www.simon-bowen.com] ([www.simon-bowen.com])

Modified Marzipano

Uses the code created by Marzipano tools as a starting point: [http://www.marzipano.net/tool/] (http://www.marzipano.net/tool/)

I have modified the contents of index.js, style.css and index.html and extended the format of data.js

index.js modifications:

Audio Integration

Using [howler.js] (https://github.com/goldfire/howler.js)

style.css modifications:

index.html modifications:

data.js modifications:

Modified data.js file produced by marzipano web-based tool to include additional data for:

Variables within embedHotspots, gazeSpots:

embedHotspot specific variables:

Tip: to place rectangle vertically, rotate X equivalent to pitch of embeddedHotspot.

Tip: to place rectangle horizontally, rotate X equivalent to PI/2 - pitch of embeddedHotspot.

Tip: to rotate rectangle so that it is appears parallel with walls, rotate Y equivalent to difference between embeddedHotspot yaw and yaw when looking directly at wall.

gazeSpot specific variables:

manySpotSwitch specific variables:

script object variables:

Time is cummulative, so to execute every second use time = 1000, 2000, 3000 etc.

For rotate parameters, see Marzipano documentation:

yawSpeed, pitchSpeed, fovSpeed
yawAccel, pitchAccel, fovAccel
targetPitch, targetFov

To prevent movement stopping between rotate events, set accelerations to Infinity.

Adding New Panoramas

Begin with the web root folder containing the following folders/contents from the repository:

/css
/img
/js
/sounds
/vector
/template
index.js
  1. Use the Marzipano Tool to upload rectilinear image and create files for a web application.
  2. Duplicate the /template folder and rename with panorama title
  3. Copy the /tiles folder from the exported web application into new panorama folder
  4. Cut and paste ‘scenes’ data objects from the exported data.js into panorama folder data.js (and add embedhotspots, gazeSpots and script data objects if using)