mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.28k stars 726 forks source link

How to use (omega, phi, kappa) or rotation matrices as input to pannellum for default orientation #1124

Open FareedKhanP opened 2 years ago

FareedKhanP commented 2 years ago

@mpetroff I want to understand a way to orient the 360 panoramas in pannellum with the input as omega, phi, kappa rotation angles from another system. I'm aware of the rotations applied in the euler order in pannellum. Please help, as I'm not able to visualise rotations

mpetroff commented 2 years ago

The rotation order is yaw, pitch, roll. There's some discussion of this in the context of three.js in #1114.

Do you have a question? I don't see one in your comment. Also, you need to define your variables, particularly since I've never seen ω and κ used as variables for Euler angles or spherical coordinates.

FareedKhanP commented 2 years ago

I get rotation details of each image in a local coordinate system as omega, phi, kappa ( rotations around X, Y, Z ) respectively from a photogrammetric system. Can I use these as input to pannellum directly ? if yes do I have to populate the values of yaw pitch and roll by default with the above values ?

mpetroff commented 2 years ago

You need your Euler angles in the correct order (and in degrees). I don't know what your coordinate system is, so I have no way of knowing if they're in the correct order. As an alternative to passing the specifically passing the values to Pannellum, you can also add Photosphere XMP data to your images.

FareedKhanP commented 2 years ago

I have managed to convert my omega, phi and theta rotation angles into yaw, pitch and roll from the external system. Is roll an important value to input ?, i'm confused

mpetroff commented 2 years ago

If your panorama has non-zero roll, then, yes, it's important. On the other hand, if your panorama has a level horizon, then none of the parameters are important for display; however, yaw would still be important if you need to align the heading to external data.