Skip to content

Commit 117fffc

Browse files
committed
added a Unity Web demo
1 parent b4dbed6 commit 117fffc

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Library
88
*.userprefs
99
*.unityproj
1010
InspectorExpandedItems.asset
11-
EditorUserBuildSettings.asset
11+
EditorUserBuildSettings.asset
12+
Web/

Assets/Scripts/CapturePoints.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ void OnGUI() {
120120
if (GUI.Button(new Rect(Screen.width - 50, 150, 50, 30), "Add") && points.Count > 0 && newGestureName != "") {
121121

122122
string fileName = String.Format("{0}/{1}-{2}.xml", Application.persistentDataPath, newGestureName, DateTime.Now.ToFileTime());
123-
GestureIO.WriteGesture(points.ToArray(), newGestureName, fileName);
123+
124+
#if !UNITY_WEBPLAYER
125+
GestureIO.WriteGesture(points.ToArray(), newGestureName, fileName);
126+
#endif
124127

125128
trainingSet.Add(new Gesture(points.ToArray(), newGestureName));
126129

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
$P Point-Cloud Recognizer
22
=========================
3-
[Web demo](http://depts.washington.edu/aimgroup/proj/dollar/pdollar.html).
3+
[Original article](http://depts.washington.edu/aimgroup/proj/dollar/pdollar.html). [Unity Web demo](http://aymericlamboley.fr/blog/wp-content/uploads/2014/07/index.html).
4+
5+
This is an adaptation of the original C# code for working with Unity.
46

57
In the demo, only one point-cloud template is loaded for each of the 16 gesture types. You can add additional templates as you wish, and even define your own custom gesture templates.
68

0 commit comments

Comments
 (0)