Use different limits for yaw and pitch in different Marzipano scenes - Solved

124 views
Skip to first unread message

Carlos Ribeiro

unread,
Jul 23, 2020, 3:36:59 PM7/23/20
to marzipano
After breaking some stones and read some topics and foruns i leave here a solution for using different values of yaw and pitch limits in different scenes.


In file data.js
In this example i have two scenes that are referenced in the data.js file as 0-outdoor and 1-indoor

In file index.js

Step oneFind the line of code below and comment it
var limiter = Marzipano.RectilinearView.limit.traditional(data.faceSize, 100*Math.PI/180, 120*Math.PI/180);

Step two - Replace with the code below

var limiter;
    if (data.id == '0-outdoor') {
      limiter = Marzipano.util.compose(
        Marzipano.RectilinearView.limit.traditional(data.faceSize, 100*Math.PI/180, 120*Math.PI/180),
        Marzipano.RectilinearView.limit.yaw(-0.2, 0.2),
        Marzipano.RectilinearView.limit.pitch(-0.1, 0.1),
      );
    }
    else if (data.id == '1-indoor') {
      limiter = Marzipano.util.compose(
        Marzipano.RectilinearView.limit.traditional(data.faceSize, 100*Math.PI/180, 120*Math.PI/180),
        Marzipano.RectilinearView.limit.yaw(-1.5, 1.5),
        Marzipano.RectilinearView.limit.pitch(-0.9, 0.9),
      );
    }
     else {
      limiter = Marzipano.RectilinearView.limit.traditional(data.faceSize, 100*Math.PI/180, 120*Math.PI/180);
    }

/* Hope this helps */

Kris

unread,
Jul 25, 2020, 9:07:33 AM7/25/20
to marzipano
I haven't tested it yet, but this is something that I have been looking for.

Thanks

Kris

unread,
Jul 25, 2020, 1:48:39 PM7/25/20
to marzipano
Now tested and working well.  

Thanks very much.

Altus Nix

unread,
Aug 20, 2020, 11:33:38 AM8/20/20
to marzipano
This works fantastic thank you!
Reply all
Reply to author
Forward
0 new messages