KIDdAe KIDdAe - 7 months ago 51
iOS Question

Using PanGesture with GoogleVR Panorama

I need to display 360 images on iOS devices.
I chose

to do this ( and I'm using the
. (

_panoView = [[GVRPanoramaView alloc] initWithFrame:self.view.bounds];
[_panoView loadImage:[UIImage imageNamed:@"VRTest.jpg"]];
[self.view addSubview:_panoView];

It works well, the image is displayed and I'm able to see all around using the device gyroscope.

I'd like to be able to move across the image using pan gesture but I can't find a way to achieve this using the given SDK.

Is it even possible ? I did not find anything in the documentation saying it's not ... but didn't find any solution either ...


In the end I used the web version of the same framework ... that handle both gyroscope and pan gesture (but only around y axis) ...

I embedded the framework in my app to have it local (I want to be able to load offline image)

Then I used a simple webview :

UIWebView *webview = [[UIWebView alloc] initWithFrame:self.view.bounds];

// Path depends of your bundle
NSString *indexPath = [[NSBundle mainBundle] pathForResource:@"vrview/index" ofType:@"html"];
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"VRTest" ofType:@"jpg"];

// load the local framework with the local image 
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?image=%@&is_stereo=false", indexPath, imagePath]]]];

// Disable scroll because of collision with pan gesture
webview.scrollView.scrollEnabled = NO;

[self.view addSubview:webview];