scihant / CTPanoramaView

A library that displays spherical or cylindrical panoramas with touch or motion based controls.
MIT License
1.04k stars 89 forks source link

Start angle for motion-based panoramas #26

Closed Sega-Zero closed 6 years ago

Sega-Zero commented 6 years ago

This PR provides ability to specify start angle for motion based panoramas as well as touch based. I also would like to apply start angle to sphere panoramas too, but couldn't figure out where should I apply it.

scihant commented 6 years ago

Thanks for the PR. Applying the starting angle in the spherical case is much harder because you need to calculate a new quaternion that has only one of its axes modified.

I'm merging this one for now but I think that modifying the texture coordinates of the geometry could be a better solution for this because it could work both in cylindrical and spherical cases. I'll experiment with the idea when I find the time. Feel free to try it yourself to see whether it would work.

Sega-Zero commented 6 years ago

I was hoping the same y-axis patch will work (and it's actually what I really need now), but couldn't get it working :) Unfortunately, I don't have enough knowledge in this area, so I would be very appreciated of you point me to the right direction :) I need to start a panorama at specified y-axis location and then rotate it when user moves a phone.