implement a "reset"-gesture for a kinect controlled application - actionscript-3

i am working on an application ( game sorta ) which uses the kinect as an input device.
i need a "moderator" to be able to reset the application once new users are interested.
i was thinking that covering the sensor with a hand for some seconds could do the trick.
however the only way to achieve that would be to analyze the rgb camera output all the time for "all black".
any thoughts on this?
thanks a lot.
p.s.: i am using the openni sdk on mac and the game is developed in as3 using the airkinect framework.

What you mentioned sounds like a fair solution. On similar lines you could even use the depth sensor and detect the depth as (approx) 0 to trigger the reset.
However, I can come up with cases where using either one solution may be a false positive. Keeping it simple for the user, you might even want to use a combination of zero depth and all black for this.
Making it complex and accurate you could use a QR code or a RED Paper to indicate (STOP). A GREEN (for GO), etc.
(Kindly mark this solution as accepted if you find it sufficient. Awaiting your comments, if any.)

My first thought would be using voice recognition instead. It seems like a more natural interaction than covering the sensor. If you keep the voice commands limited it works very well.
I've used voice recognition in the past to determine the leftmost and rightmost edge of a "playfield" by holding my hand on one of the edges and saying "calibrate", "left", "right", and "Okay" to confirm. It worked very well. If you have a lot of people talking, you could listen for a keyphrase first. So "Kinect: calibrate" and "Kinect: left" to filter out the false positives.

You should first answer the question of how the user and moderator will be interacting with the application and the active interaction space. If a moderator has to approach the Kinect sensor and cover up the camera in order to reset the instance, why not just give them a wireless keyboard or mouse to hold? A mouse click or a keystroke can reset the scene in this case -- and a keyboard would offer many other keys to jump between multiple scenes, or configuration settings.
If you are truly needing a "hands free" solution for the moderator, I would look into gestures or speech recognition. I'm not as familiar with OpenNI, so links below will reference Microsoft SDKs but can be used for reference and ideas...
In the case of speech recognition, an "activation" keyword can be used (e.g., "Kinect" or "Computer") followed by an action request (e.g., "Destruct sequence 3, code 1 B-2B-3", or just "reset" if you want to be boring). You can read more about speech recognition using Microsoft libraries here: http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx
For gestures, you can use a static gesture to reset the scene -- for example, on the XBox holding one arm at your side and the other a 45-degree angle will send you back to the main menu. You can always assume the moderator will be on a certain side, or will always be the second player to enter the scene. You could just not care and let users reset the scene if need be. You could also mix it up and have the moderator give a "control" gesture or voice command first, so the system knows they are the moderator, and then give the reset (or other) gesture.
Two gesture libraries that could help in this are here:
http://kinecttoolbox.codeplex.com/
https://github.com/EvilClosetMonkey/Fizbin.Kinect.Gestures

Related

Is there a way to flag that a progressive web app requires a hardware keyboard?

I know that the whole concept of PWA is for a app to scale across all screen sizes I have written an IDE-like application (in a PWA), that is information dense, and I want my PWA to be portable across desktop OSs (mouse + keyboard), and tablets (touch + hardware keyboard).
My app is not really meant for mobile OSs. There are many keyboard short cuts, and whilst I could add UI elements to simulate these key presses, the screen is already action packed enough. The app simply doesn't belong on any platform without a hardware keyboard. But PWAs (with the hardware keyboard filter) are the perfect method of distribution for desktop OSs with modern browsers, so I'm in a bit of a pickle.
So, my question is - is there a way for a progressive web app (via the manifest or otherwise) to signal requires (or works best) with a hardware keyboard?
Short answer - No Explicit way to find the availability of physical keyboard programmatically or to restrict your app to keyboard only devices by requesting browsers/search engines to make that restriction with any kind of meta data/scripts. Said that, you can't restrict the user by putting in the URL or your PWA web page in the address bar and requesting for it. All you can do is, on loading, you can do some checks like in the "alternate solution" and show a message to the user to use a computer with keyboard attached. If the soft keyboard is good enough to handle your checks, you are left with no luck!
There are some tricky solutions developers have experimented.
Alternate solution: Unfortunately, nothing you can rely on, without asking the user itself.
On loading your app(or when ever you think it is appropriate to), prompt the user to press one of the shortcut, which you think its more appropriate for a user with physical keyboard. Wait for the even listener of that key combination. If the event is caught, then you can assume, user's keyboard is good with your shortcut solutions. Also give a button "Shortcut pressed" and another button "Not available in my keyboard" and on pressing, you can let the user know the app id not for them or even you can let them use it with mouse and menu option(which is more appropriate).

Interpolation with consistent speed

I'm making an multiplayer game and I bumped into a problem, I want to interpolate player position so it would not look jittery when player is having bigger ping/latency, I'm using vector2 interpolation but every single of the interpolation formula is decreasing/increasing speed in the middle/beginning/middle and I need so that interpolation speed would always be the same (so it would look like player is moving not floating)
The thing you want is the dead reckoning alghoritm which is unfortunately not supported by Libgdx by default. There are many ways to implement this basing on what kind of game you are creating.
There is no one good answer for your question but let say you are making a simple runner where players are going forward and they can jump. The naive implementation for multiplayer like this would be to change opponent's position due to notification he is sending. Now you are interpolating the position between notifications however you should rather assume that the opponent is still runing and when get notification that he jumps then correct position and perform jump an so on...
There are dozens of articles about dead reckoning in the internet. You can start with this one.

How to connect two UI Elements by swiping? WP8.1

Actually I'm developing a simple game. In my game, I need to connect multiple buttons by swiping. But I don't know which events should I use to do that. What I want is kind of similar to Candy Crush game.
Please help me out guys!
Take a look at Handling pointer input on MSDN, specifically the PointerPressed, PointerMoved, and PointerReleased events. You can keep track of the pointer information by making use of the PointerRoutedEventArgs argument passed in those events, including checking whether the pointer belongs to a mouse or if it is brought about by touching the screen. There are some good examples in each article.

How to get a car spinning with AS3? A 360 degree view

first post on here so be gentle!
I am currently designing an ad banner for my college assignment, the main feature i have is a car spinning, like a full 360 degree view.
Now I have took all of the media I needed and photoshopped them to how they need to look I just need some diction of where to go next.
I did want it where you can click and drag anywhere on the screen and it pulls the car around to where you want it, but I don't even know where to start with that! (please help if you can)
So I thought I would instead have it as a sort of image gallery with a next and previous button to select the next frame you want. But I don't like the way it looks so I was wondering if there was a way with action script where I could click on a button(next/previous) and the car would spin until I un-click? Rather than me having to keep clicking to load the next frame.
Also if I could I wanted a left to right scroll bar what could control the images, do you know any way of doing that?
Many Thanks in advance for ANY help!
Jordan.
If you want a commercial solution:
Krpano -> very advanced, excellent support, highly recommended for panoramas, 2D object is a bit lacking tho. Examples of 2D object
Object2VR -> very easy to use, not that great support, lacking API.
I would go personally for krpano because it is simply a superior tool. Great for panos, tons of possibilities. If you want it easy, go for Object2VR.
Now if you want to program it, and you need to program it, there are many options how you can do it. First of all, you need to load all the images into your app. Even if you don't maintain them in memory (that would be prefered, tho), you should load them so they are cached and can be reloaded fast. Your rotation can be achieved by "re-loading" the next image, or if you keep them in memory by simply referencing the next index of the array/vector. You always keep a reference index and upon click you simple increase the index and load the image. You than swap the images. It is too broad to explain, you will simply have to begin and ask for advice with some specific code.

HTML5 Drag and Drop with multiple different drop targets, dropEffect, multiselect, etc

I'm currently experimenting with HTML5 Drag and Drop API. Now I've got several questions:
1.
Am I right, that it's not possible to connect draggable elements with drop-areas?
Example: You have 2 different kinds of elements you want to be able to drag and drop: Files and Text-Labels. Now if I give some div an DragOver-Handler and a Drop-Handler it will respond to both, files and text-labels. I'm looking for a simple possibility to only respond to a specific type of draggable items.
A connected problem is the dropEffect cursor-style: At the moment I enable all possible drop-targets in the DragStart-Handler and disable all of them in the DragEnd-Handler (with "disable" I mean, that I remove all DragOver- and Drop-Handlers). If I wouldn't do so, it'll look like if you could drop a file on an element that should only react to text-labels.
2.
The dropEffect cursor-style is a mess. In Firefox I don't get them at all, in Chrome it will give me a big "plus"-icon (even if I have removed the DragOver- and Drop-Handlers from an element)
3.
Last feature I am looking for is multi-select: Select multiple Text-Labels and then drag all of them at a time. Is this possible? My first idea was to create a new div and move all selected elements inside this div and then drag the newly created div. Seems pretty hackish and looks quite ugly ;-)
I hope you guys have some answers for me. Thanks!
I don't think that HTML5 drag and drop (and friends) are supposed to be replacements for commonly used "drag and drop" Javascript libraries (although it COULD be used instead of them in some cases). The name is misleading.
Modern operating systems include APIs that allow cross-application communication: clipboard and drag-and-drop. Both APIs are quite similar and need to be quite low-level because of specific challenges:
the data must be sent across processes, so it must be somehow serialized,
the sender must have a way way of offering the data in many formats (eg. text/plain and text/html) and the receiver the ability to pick one that it likes best,
the sender and receiver may live in different processes, so they can never find out about each other (they might even be entities coming from different platforms, GUI frameworks, programming languages etc.), the only channel of communication is the data itself,
Current HTML5 APIS, as opposed to - say - JQueryUI draggables - are not meant to give programmer strict control of the look and feel of the dragging process, but rather enable tight integration with the native, system-wide mechanisms. Which may or may not be what the programmer needs.
So to answer the questions:
you cannot "connect draggable elements with drop-areas", because your draggable elements can even come from outside the browser. But you can make an area that rejects certain types of data (which is what user expects from native drag and drop).
"div" and "multiselect" are not things that operating system understands (we don't have native multi-cliboards or multiple-text-selections). You CAN implement such functionality if you make a with inner divs that can be toggled (eg. by clicking while holding shift). When someone tries to drag the outer dive, make a transfer object that says which inner divs were selected (you could even create an image that shows them).
If the above solutions sound a bit low-level, well - that's because they are. When you develop a desktop game or tool, you do not rely on native drag and drop for moving pieces across the chessboard or moving sliders in the GUI. I think it will be the same with JavaScript. JQueryUI Draggables are not going anywhere.