thiagopnts / clappr-video360

360 video plugin for Clappr
https://thiago.me/clappr-360
MIT License
109 stars 22 forks source link

Is it possible to get the view angle? #25

Closed DanieleSuppo73 closed 4 years ago

DanieleSuppo73 commented 4 years ago

I'm sorry to post in the issue, but I don't know where I could post this: is it possible to get the camera view angle? Or at least the mouse/finger delta position? I'd like to create a minimap that should rotate with the view angle. Many thanks

thiagopnts commented 4 years ago

you can have access to all that by accessing the 360 viewer instance inside the plugin, you can do something like, player being you clappr player instance:

var plugin360 = player.core.containers[0].plugins.find(p => p.name == "Video360");
console.log(plugin360.viewer.controls.phi, plugin360.viewer.controls.theta);

with phi and theta you can control the camera and get the angle, I dont remember the formula now to get the angle but its easy to find online

DanieleSuppo73 commented 4 years ago

Many thanks!!! I'll try later