Ver código fonte

BREAKING CHANGE! Reverse sign of hot spot yaw so it makes sense.

pull/58/merge
Matthew Petroff 9 anos atrás
pai
commit
f8dfee9d63
3 arquivos alterados com 9 adições e 9 exclusões
  1. +2
    -2
      examples/example-cube.json
  2. +4
    -4
      examples/example-tour.json
  3. +3
    -3
      src/js/pannellum.js

+ 2
- 2
examples/example-cube.json Ver arquivo

@@ -19,13 +19,13 @@
"hotSpots": [
{
"pitch": -12,
"yaw": -170,
"yaw": 170,
"type": "info",
"text": "This is Jordan Pond, located in Acadia National Park."
},
{
"pitch": -10,
"yaw": 50,
"yaw": -50,
"type": "info",
"text": "This is a link.",
"URL": "https://github.com/mpetroff/pannellum"


+ 4
- 4
examples/example-tour.json Ver arquivo

@@ -20,20 +20,20 @@
"hotSpots": [
{
"pitch": -12,
"yaw": -170,
"yaw": 170,
"type": "info",
"text": "This is Jordan Pond, located in Acadia National Park."
},
{
"pitch": -10,
"yaw": 50,
"yaw": -50,
"type": "info",
"text": "This is a link.",
"URL": "https://github.com/mpetroff/pannellum"
},
{
"pitch": 0,
"yaw": 60,
"yaw": -60,
"type": "scene",
"text": "Pond",
"sceneId": "pond"
@@ -47,7 +47,7 @@
"hotSpots": [
{
"pitch": 0,
"yaw": -100,
"yaw": 100,
"type": "scene",
"text": "Pond (cube)",
"sceneId": "pondCube"


+ 3
- 3
src/js/pannellum.js Ver arquivo

@@ -1036,7 +1036,7 @@ function destroyHotSpots() {
function renderHotSpots() {
config.hotSpots.forEach(function(hs) {
var z = Math.sin(hs.pitch * Math.PI / 180) * Math.sin(config.pitch * Math.PI /
180) + Math.cos(hs.pitch * Math.PI / 180) * Math.cos((hs.yaw + config.yaw) *
180) + Math.cos(hs.pitch * Math.PI / 180) * Math.cos((-hs.yaw + config.yaw) *
Math.PI / 180) * Math.cos(config.pitch * Math.PI / 180);
if ((hs.yaw <= 90 && hs.yaw > -90 && z <= 0) ||
((hs.yaw > 90 || hs.yaw <= -90) && z <= 0)) {
@@ -1046,13 +1046,13 @@ function renderHotSpots() {
// Subpixel rendering doesn't work in Firefox
// https://bugzilla.mozilla.org/show_bug.cgi?id=739176
var transform = 'translate(' + (-renderer.canvas.width /
Math.tan(config.hfov * Math.PI / 360) * Math.sin((hs.yaw +
Math.tan(config.hfov * Math.PI / 360) * Math.sin((-hs.yaw +
config.yaw) * Math.PI / 180) * Math.cos(hs.pitch * Math.PI /
180) / z / 2 + renderer.canvas.width / 2 - 13) + 'px, ' +
(-renderer.canvas.width / Math.tan(config.hfov * Math.PI / 360) *
(Math.sin(hs.pitch * Math.PI / 180) * Math.cos(config.pitch *
Math.PI / 180) - Math.cos(hs.pitch * Math.PI / 180) *
Math.cos((hs.yaw + config.yaw) * Math.PI / 180) *
Math.cos((-hs.yaw + config.yaw) * Math.PI / 180) *
Math.sin(config.pitch * Math.PI / 180)) / z / 2 +
renderer.canvas.height / 2 - 13) + 'px) translateZ(1000000000px)';
hs.div.style.webkitTransform = transform;


Carregando…
Cancelar
Salvar