User Tools

Site Tools


customizing_gesture_dimensions

Customizing Gesture Dimensions

A gesture dimension is a dynamically defined fundamental property of a gesture object. Each gesture dimension can be treated independently such that it can be considered orthogonal system of properties. A gesture dimension must be uniquely defined locally so that no other dimension in the gesture object can share the same property “id”. A gesture object must have at least one dimension. A gesture dimension can be used to manage a tracked property that needs to be monitored of individually manipulated through the gesture pipeline. Each gesture dimension has a separate path trough the gesture pipeline and is subject to separate limits and controls.

The following “n-drag” gesture object has two dimensions “dx” and “dy”.In this example “dx” and “dy” represent calculated values for the change in position in the x direction and y direction respectively. This change is captured over a single frame and so can be considered a measure of velocity in each spacial dimension.

<Gesture id="n-drag" type="drag">
    <match>
        <action>
            <initial>
                <cluster point_number="0" point_number_min="1" point_number_max="10"/>
            </initial>
        </action>
    </match>       
    <analysis>
        <algorithm class="kinemetric" type="continuous">
            <library module="drag"/>
            <returns>
                <property id="dx" result="dx"/>
                <property id="dy" result="dy"/>
            </returns>
        </algorithm>
    </analysis>    
    <mapping>
        <update dispatch_type="continuous">
            <gesture_event type="drag">
                <property ref="dx" target="x"/>
                <property ref="dy" target="y"/>
            </gesture_event>
        </update>
    </mapping>
</Gesture>

The following “n-manipulate” gesture has five gesture dimensions “dx”,“dy”,“dsx”,“dsy” and “dtheta”. These dimensions each manage a fundamental property of the manipulate gesture:

“dx” is the velocity in the x direction,
“dy” is the velocity in the y direction,
“dsx” is change in the separation in the x direction,
“dsy” is the change in separation in the y direction,
“dtheta” is the change in rotation on the x axis

Each dimension has in own thread or path through the processing pipeline.

<Gesture id="n-manipulate" type="manipulate">
    <match>
        <action>
            <initial>
                <cluster point_number="0" point_number_min="1" point_number_max="10"/>
            </initial>
        </action>
    </match>       
    <analysis>
        <algorithm class="kinemetric" type="continuous">
            <library module="manipulate"/>
            <returns>
                <property id="dx" result="dx"/>
                <property id="dy" result="dy"/>
                <property id="dsx" result="ds"/>
                <property id="dsy" result="ds"/>
                <property id="dtheta" result="dtheta"/>
            </returns>
        </algorithm>
    </analysis>    
    <mapping>
        <update dispatch_type="continuous">
            <gesture_event type="manipulate">
                <property ref="dx" target="x"/>
                <property ref="dy" target="y"/>
                <property ref="dsx" target="scaleX"/>
                <property ref="dsy" target="scaleY"/>
                <property ref="dtheta" target="rotation"/>
            </gesture_event>
        </update>
    </mapping>
</Gesture>

If the values stored in a dimension are set to zero the dimension is automatically set to inactive. If all dimensions on a gesture object are inactive then the gesture is set to inactive.

customizing_gesture_dimensions.txt · Last modified: 2015/09/15 13:39 by glass