Commit cd2a4223 authored by Alexander Krause's avatar Alexander Krause

added dynamic value for rotation velocity

parent 076c726c
......@@ -51,6 +51,8 @@ namespace ExplorVizGestureControl.Gestures
dynamicValues.Add("scrollForwardFactor", 0.05);
dynamicValues.Add("scrollBackwardFactor", 0.05);
dynamicValues.Add("zoomVelocity", 250);
dynamicValues.Add("rotationVelocityX", 1000);
dynamicValues.Add("rotationVelocityY", 500);
scrollTimer = new GestureTimer(dynamicValues["zoomVelocity"]);
delayTimer = new GestureTimer(2000);
......@@ -124,14 +126,14 @@ namespace ExplorVizGestureControl.Gestures
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 > 0.12f) yDetection = 500;
if (handsAbsDistanceY > 0.12f) yDetection = dynamicValues["rotationVelocityY"];
Console.WriteLine(handsAbsDistanceY);
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);
int moveX = (int)(distanceZ * 1000);
int moveX = (int)(distanceZ * dynamicValues["rotationVelocityX"]);
int moveY = (int)(distanceY * yDetection);
Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y) + new Size(moveX, moveY);
......
......@@ -117,6 +117,36 @@
</TextBox.ToolTip>
</TextBox>
<TextBox
Style="{StaticResource DynamicValues}"
Name="rotationVelocityX"
Text="1000"
KeyDown="OnKeyDownHandler">
<TextBox.ToolTip>
<ToolTip>
<StackPanel>
<Label FontWeight="Bold" Content="Velocity for rotation (x-axis)"/>
<Label Content="Standard value: 1000"/>
</StackPanel>
</ToolTip>
</TextBox.ToolTip>
</TextBox>
<TextBox
Style="{StaticResource DynamicValues}"
Name="rotationVelocityY"
Text="500"
KeyDown="OnKeyDownHandler">
<TextBox.ToolTip>
<ToolTip>
<StackPanel>
<Label FontWeight="Bold" Content="Velocity for rotation (y-axis)"/>
<Label Content="Standard value: 500"/>
</StackPanel>
</ToolTip>
</TextBox.ToolTip>
</TextBox>
</StackPanel>
</Grid>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment