News for hackers. Stuff that matters.
Re:Show HN: Swip.js, a library to create multi device experi... by rawnlq on Tuesday October 18, 2016 @12:59PM (#12736444)
Using the devices as planes for the golf demo is incredibly creative!

https://www.youtube.com/watch?v=ZE0gxa-p8HY

I know you can use HTML5 DeviceOrientation for angle and the "swip" for relative positioning. But how did you get the physical size of the screen of each device?

Re:Show HN: Swip.js, a library to create multi device experi... by brackcurly on Tuesday October 18, 2016 @01:15PM (#12736625)
We haven't figured out a way to do this automatically. Currently we prompt the user to enter the size of the device when the app is opened for the first time.
Re:Show HN: Swip.js, a library to create multi device experi... by anotheryou on Tuesday October 18, 2016 @05:18PM (#12738812)
Why not two swips (maybe even single, two-finger swips)? that's enough for relative sizing
Re:Show HN: Swip.js, a library to create multi device experi... by WhitneyLand on Tuesday October 18, 2016 @04:05PM (#12738154)
I don't think it's possible unless you add an app.

One solution would be create a companion app that determines the physical screen size, then makes that available to your network via web sockets.

There our a few steps I left out here but it's possible.

The app could be optional - if its installed that device will have fully automatic configuration. If it's not installed, you just fall back to your user prompt.

Re:Show HN: Swip.js, a library to create multi device experi... by BonoboBoner on Wednesday October 19, 2016 @01:05AM (#12741224)
How do you know which device is positioned higher than the other (on a bunch of books)?
Re:Show HN: Swip.js, a library to create multi device experi... by asher_ on Wednesday October 19, 2016 @01:55AM (#12741414)
Based on the demo they showed, this isn't needed. As long as they know the orientation of the device relative to a flat plane they can move the virtual items within the bounds of that device's screen. When it crosses over on to another device, it only needs to calculate movement based on it's relative orientation.
Re:Show HN: Swip.js, a library to create multi device experi... by timgrossmann on Wednesday October 19, 2016 @02:24AM (#12741542)
Yes, exactly. If it enters the space of a tilted device, a force (depending on the rotation of the device) is applied to ball.
Re:Show HN: Swip.js, a library to create multi device experi... by morgante on Tuesday October 18, 2016 @07:07PM (#12739546)
This is an amazing demo and a great reminder of the sheer cool factor of having tiny computers in our pockets.
Re:Show HN: Swip.js, a library to create multi device experi... by anotheryou on Tuesday October 18, 2016 @05:02PM (#12738687)
Does anyone know how well you can time via an app?

I wonder how it sounds to play sound across devices. Streaming and clock syncing can happen beforehand, just the playback has to be very sync to an absolute timing.

Maybe one can do something crude sound propagation synthesis by playing with timing, sound runtime, gps and a crowd. If you synthesize the sound the app even stays very small. You could e.g. make an ocean wave roll through the audience (when every device knows where it is and knows the exact time of when the wave will hit that position).

Same could work with devices as pixels, but I don't find it that interesting.

Re:Show HN: Swip.js, a library to create multi device experi... by asenna on Tuesday October 18, 2016 @07:27PM (#12739653)
I'd gone to a hackathon a few years back (I think it was Michigan's MHack), and one of the teams did exactly that. It was actually really cool.

They split the room into 3 sections, and then controlled each section to play it's own tune.

Re:Show HN: Swip.js, a library to create multi device experi... by Normal_gaussian on Tuesday October 18, 2016 @05:40PM (#12738985)
If you are playing sound you can use the microphone for synchronisation.
Re:Show HN: Swip.js, a library to create multi device experi... by anotheryou on Thursday October 20, 2016 @09:33AM (#12752008)
hehe, right, but it will get messy in a crowd. Maybe fun though, if the phones first try to agree on a timing.
Re:Show HN: Swip.js, a library to create multi device experi... by mcs_ on Tuesday October 18, 2016 @03:14PM (#12737736)
I don't have a use case for this (yet) but ... the demo is absolutely incredible. Very nice work
Re:Show HN: Swip.js, a library to create multi device experi... by elwell on Tuesday October 18, 2016 @03:23PM (#12737813)
I agree, but could go without the royalty free bg music.
Re:Show HN: Swip.js, a library to create multi device experi... by addedlovely on Tuesday October 18, 2016 @07:11PM (#12739575)
Wow, great work. I assume the pinch gesture calibrates the positioning and is always center of the screen? The bounce off the screen edge on pong is satisfying.
Re:Show HN: Swip.js, a library to create multi device experi... by brackcurly on Wednesday October 19, 2016 @07:28AM (#12742839)
You're right, when the server receives two swipe events at the same time in opposite directions we assume that both devices are aligned at this point. It doesn't matter though where on the screen you pinch them together,.
Re:Show HN: Swip.js, a library to create multi device experi... by Lxr on Wednesday October 19, 2016 @01:50AM (#12741390)
That golf game has a lot of potential even as a native app, nice!