4

Is there any solution for panning images using head motion? i.e. the 'Meet the Team' easter egg. Works very well on the easter egg!

Would be great to have this in the GDK (hint hint Google). I have found this library which works for horizontal panning and I will likely just adapt this if there is not another solution out there.

Zach Johnson
  • 23,678
  • 6
  • 69
  • 86
Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141
  • I'm in need of implementing the same use case for panning an image left and right. I tried the one below suggested Tony Allevato solution, i couldn't achieve the image panning while moving my head towards left or right on google glass. Let me suggest the solution to achieve the image panning on head motion. – Senthil Mg Apr 14 '14 at 13:17

2 Answers2

5

Any solution right now would involve listening to the sensors manually and then translating the visible region of the view based on those values. It sounds like the component you linked does most, if not all, of what you need.

If you would like to see such a feature included as a public GDK API, feel free to file a feature request in our issue tracker!

Tony Allevato
  • 6,429
  • 1
  • 29
  • 34
  • Think there may be a lot of apps using this type of function. Would be nice to have a solid implemenation out of the box in the GDK. – Patrick Jackson Jan 24 '14 at 19:42
  • 2
    Feature request here - star if you want this! https://code.google.com/p/google-glass-api/issues/detail?id=379&thanks=379&ts=1390680867 – Patrick Jackson Jan 25 '14 at 21:28
4

I implemented something like this. Maybe you want to test it: https://github.com/pscholl/glass_snippets/tree/master/Head%20Image%20View

pscholl
  • 522
  • 4
  • 6
  • thanks for the link I will try it out. FYI the issue has been accepted by GDK so there will be an official implementation at some point. – Patrick Jackson Feb 10 '14 at 17:20
  • @pscholl I'm trying to use your implementation, but when I am using it with image of the same size you have it scales down to size of the screen so no panning when I move my head. – vittore Feb 17 '14 at 04:26
  • it defaults to a scale factor of 1, so no zoom at all. At some point you need to call the setScaleFactor() with something larger than that. Or change the default value at HeadImageView.java:17. – pscholl Feb 17 '14 at 09:33
  • @pscholl yes that made it. – vittore Feb 17 '14 at 20:37
  • @pscholl , i tried the code you suggested, i couldn't noticed the image panning on head motion while moving left or right.the image i provided completely fitted on my screen.let me suggest an solution to make the image panning on head motion. – Senthil Mg Apr 14 '14 at 13:00
  • you need to call setScaleFactor() with something larger than 1., otherwise the image will just be scaled to fit the screen. – pscholl Apr 14 '14 at 14:19