Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gesture-control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ExplorViz
explorviz-github-archive
gesture-control
Commits
2c3f9c4b
Commit
2c3f9c4b
authored
May 26, 2015
by
Alexander Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes of today's benchmark
parent
1235cc0a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
20 deletions
+47
-20
ExplorVizGestureControl.v12.suo
ExplorVizGestureControl.v12.suo
+0
-0
ExplorVizGestureControl/Gestures/ContinuousGestureDetector.cs
...orVizGestureControl/Gestures/ContinuousGestureDetector.cs
+47
-20
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
...orVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
+0
-0
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
...orVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
+0
-0
ExplorVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
...orVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
+0
-0
No files found.
ExplorVizGestureControl.v12.suo
View file @
2c3f9c4b
No preview for this file type
ExplorVizGestureControl/Gestures/ContinuousGestureDetector.cs
View file @
2c3f9c4b
...
...
@@ -50,8 +50,8 @@ namespace ExplorVizGestureControl.Gestures
dynamicValues
.
Add
(
"scrollAccelerationFactor"
,
2000
);
dynamicValues
.
Add
(
"scrollActivation"
,
0.05
);
dynamicValues
.
Add
(
"zoomVelocity"
,
250
);
dynamicValues
.
Add
(
"rotationVelocityX"
,
1
000
);
dynamicValues
.
Add
(
"rotationVelocityY"
,
5
00
);
dynamicValues
.
Add
(
"rotationVelocityX"
,
2
000
);
dynamicValues
.
Add
(
"rotationVelocityY"
,
10
00
);
dynamicValues
.
Add
(
"rotationYActivation"
,
0.12
);
scrollTimer
=
new
GestureTimer
(
dynamicValues
[
"zoomVelocity"
]);
...
...
@@ -91,14 +91,18 @@ namespace ExplorVizGestureControl.Gestures
if
(
key
.
Equals
(
"zoomVelocity"
))
scrollTimer
.
changeTimerCycle
(
value
);
}
float
oldZZ
;
float
oldYY
;
private
void
HandleRotation
()
{
if
(
gripActive
)
return
;
//
if (gripActive) return;
if
(!
rotationActive
)
{
if
(
GestureDatabase
.
ActivateRotation
(
2.0f
))
//if (GestureDatabase.ActivateRotation(2.0f))
if
(
GestureDatabase
.
HandsAboveSpineBase
(
1
))
{
mouse_event
(
MOUSEEVENTF_RIGHTDOWN
,
0
,
0
,
0
,
0
);
rotationActive
=
true
;
...
...
@@ -106,21 +110,20 @@ namespace ExplorVizGestureControl.Gestures
else
{
return
;
}
}
if
(!
GestureDatabase
.
LeftHandClosed
()
&&
!
GestureDatabase
.
HandsCrossed
())
if
(
GestureDatabase
.
LeftHandClosed
())
{
if
(
rotationActive
&&
!
GestureDatabase
.
HandsAboveSpineBase
(
1
,
0.1f
))
/*
if (rotationActive && !GestureDatabase.HandsAboveSpineBase(1, 0.1f))
{
rotationActive = false;
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
return;
}
}
*/
double
distanceZ
=
0
;
double
distanceY
=
0
;
double
distanceZHands
=
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandLeft
].
Z
-
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandRight
].
Z
;
/*
double distanceZHands = GestureDatabase.Joints[(int)JointType.HandLeft].Z - GestureDatabase.Joints[(int)JointType.HandRight].Z;
double distanceYHands = GestureDatabase.Joints[(int)JointType.HandLeft].Y - GestureDatabase.Joints[(int)JointType.HandRight].Y;
int yDetection = 0;
...
...
@@ -132,9 +135,31 @@ namespace ExplorVizGestureControl.Gestures
distanceY = distanceYHands - (GestureDatabase.PreviousFrameJoints[(int)JointType.HandLeft].Y - GestureDatabase.PreviousFrameJoints[(int)JointType.HandRight].Y);
int moveX = (int)(distanceZ * dynamicValues["rotationVelocityX"]);
int
moveY
=
(
int
)(
distanceY
*
yDetection
);
int moveY = (int)(distanceY * yDetection);*/
float
distanceZHands
=
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandLeft
].
X
-
GestureDatabase
.
PreviousFrameJoints
[(
int
)
JointType
.
HandLeft
].
X
;
float
distanceYHands
=
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandLeft
].
Y
-
GestureDatabase
.
PreviousFrameJoints
[(
int
)
JointType
.
HandLeft
].
Y
;
int
yDetection
=
0
;
//float handsAbsDistanceY = Math.Abs(Math.Abs(GestureDatabase.Joints[(int)JointType.HandLeft].Y) - Math.Abs(GestureDatabase.Joints[(int)JointType.HandRight].Y));
//if (handsAbsDistanceY > dynamicValues["rotationYActivation"]) yDetection = (int)dynamicValues["rotationVelocityY"];
yDetection
=
(
int
)
dynamicValues
[
"rotationVelocityY"
];
Cursor
.
Position
=
new
Point
(
Cursor
.
Position
.
X
,
Cursor
.
Position
.
Y
)
+
new
Size
(
moveX
,
moveY
);
//distanceZ = distanceZHands - (GestureDatabase.PreviousFrameJoints[(int)JointType.HandLeft].Z - GestureDatabase.PreviousFrameJoints[(int)JointType.HandRight].Z);
//distanceY = distanceYHands - (GestureDatabase.PreviousFrameJoints[(int)JointType.HandLeft].Y - GestureDatabase.PreviousFrameJoints[(int)JointType.HandRight].Y);
//distanceZ = distanceZHands;
// distanceY = distanceYHands;
//oldZZ = distanceZHands;
//oldYY = distanceYHands;
int
moveX
=
(
int
)(
distanceZHands
*
dynamicValues
[
"rotationVelocityX"
]);
int
moveY
=
(
int
)(
distanceYHands
*
yDetection
);
Cursor
.
Position
=
new
Point
(
Cursor
.
Position
.
X
,
Cursor
.
Position
.
Y
)
+
new
Size
(
moveX
,
-
moveY
);
}
else
if
(
rotationActive
)
{
...
...
@@ -165,7 +190,7 @@ namespace ExplorVizGestureControl.Gestures
private
void
HandleGripAndSelection
()
{
if
(
rotationActive
)
return
;
//
if (rotationActive) return;
if
(!
GestureDatabase
.
DragObject
()
&&
selectionStatus
==
1
)
{
...
...
@@ -173,17 +198,19 @@ namespace ExplorVizGestureControl.Gestures
selectionTimer
.
startTimer
();
}
if
(!
GestureDatabase
.
DragObject
()
&&
selectionStatus
==
2
&&
!
selectionTimer
.
busy
)
//if (!GestureDatabase.DragObject() && selectionStatus == 2 && !selectionTimer.busy)
if
(!
GestureDatabase
.
DragObject
()
&&
selectionStatus
==
2
)
{
mouse_event
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
selectionStatus
=
0
;
}
if
(!
GestureDatabase
.
DragObject
()
&&
selectionStatus
==
3
&&
selectionTimer
.
busy
)
//if (!GestureDatabase.DragObject() && selectionStatus == 3 && selectionTimer.busy)
if
(!
GestureDatabase
.
DragObject
()
&&
selectionStatus
==
3
)
{
mouse_event
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
Thread
.
Sleep
(
150
);
mouse_event
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_LEFTUP
,
0
,
0
,
0
,
0
);
//
Thread.Sleep(150);
//
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
selectionStatus
=
0
;
}
...
...
@@ -198,7 +225,7 @@ namespace ExplorVizGestureControl.Gestures
float
vLength
=
GestureDatabase
.
CalculateVectorLength
(
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandRight
]);
if
(
selectionStatus
==
2
&&
selectionTimer
.
busy
)
selectionStatus
=
3
;
if
(
selectionStatus
==
2
)
selectionStatus
=
3
;
// If hand position didn't change 1 cm, do no more processing for this frame
if
(
Math
.
Abs
(
rightHandAnchorLength
-
vLength
)
<
0.01f
)
return
;
...
...
@@ -216,8 +243,8 @@ namespace ExplorVizGestureControl.Gestures
double
distanceY
=
GestureDatabase
.
Joints
[(
int
)
JointType
.
HandRight
].
Y
-
GestureDatabase
.
PreviousFrameJoints
[(
int
)
JointType
.
HandRight
].
Y
;
int
moveX
=
(
int
)(
distanceX
*
1
000
);
int
moveY
=
(
int
)(
distanceY
*
1
000
);
int
moveX
=
(
int
)(
distanceX
*
3
000
);
int
moveY
=
(
int
)(
distanceY
*
3
000
);
Cursor
.
Position
=
new
Point
(
Cursor
.
Position
.
X
,
Cursor
.
Position
.
Y
)
+
new
Size
(
moveX
,
-
moveY
);
}
...
...
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.exe
View file @
2c3f9c4b
No preview for this file type
ExplorVizGestureControl/bin/Debug/ExplorVizGestureControl.pdb
View file @
2c3f9c4b
No preview for this file type
ExplorVizGestureControl/obj/Debug/ExplorVizGestureControl.exe
View file @
2c3f9c4b
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment