<?xml version="1.0" encoding="ISO-8859-15"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta name="dc:creator" content="J&ouml;rn Nettingsmeier &lt;nettings@folkwang-hochschule.de&gt;"/>
<meta name="dc:publisher" content="University of Duisburg-Essen, Dept. of Computer Science"/>
<meta name="dc:subject" content="Input devices for 3d virtual environments - the Spaceball under Linux"/>
<meta name="dc:description" content="Course presentation on VR concepts, spaceball hardware, installation and Linux software"/>
<meta name="dc:date" content="2003-09-24"/>
<meta name="dc:format" content="text/xml"/>
<meta name="dc:identifier" content="http://spunk.dnsalias.org/Model3D/term_paper.xml"/>
<meta name="dc:language" content="en"/>
<meta name="dc:rights" content="(c) 2003 J&ouml;rn Nettingsmeier - may be freely redistributed and modified. Credit is welcome :)"/>

<link rel="stylesheet" type="text/css" href="term_paper.css" />

<title>Input devices for 3d virtual environments - the Spaceball under Linux</title>

</head>

<body>

<div class="nav">
<a href="term_paper.xml">Previous</a> |
<a href="term_paper.xml">Table of Contents</a> |
<a href="term_paper-2.xml">Next</a>
</div>

<h1>1. 2D vs. 6D input devices</h1>

<h2>1.1 Concepts</h2>

<p>
This paragraph introduces basic concepts and terminology for control and
manipulation of objects in <span class="keyword">virtual realities (VR)</span>,
as used in the 
<span class="keyword">Virtual Reality Markup Language (VRML)</span>.
Readers familiar with VRML may want to skip this.
</p>

<h3>1.1.1 Translation, rotation, degrees of freedom</h3>

<p>
An arbitraty motion of a body in 3-dimensional space can be described by 6
parameters or <span class="keyword">degrees of freedom</span>:
</p>
<ul>
	<li>
		three <span class="keyword">translations</span>
		or linear motions along the x-, y- and z-axis and
	</li>
	<li>
		three <span class="keyword">rotations</span>
		or turns around these axes, where the body remains
		in the same position, and only its orientation changes.
	</li>
</ul>
<p>
If no further constraints apply, these 6 parameters suffice to describe <em>any</em>
3-dimensional motion.
</p>

<div class="note">
<p>
As a sidenote, in robotics it is customary to define as many degrees of
freedom as all the machine parts have, with the understanding that there
are constraints on elongation and pan-tilt range.<br />
For example, a robot arm with three extensible telescope sections and three
rotatable joints can be described as having nine degrees of freedom
(3x elongation, 3x joint rotation, 3x joint angle), each of which has
specific physical limits.<br />
This extended model is necessary to completely describe the state of the
robot.<br />
However, the state of the tool at the end of the robot arm could still be
described by only 6 parameters.
</p>
</div>


<h3>1.1.2 The VRML and mouse coordinate systems</h3>

<div class="imagewithcaption">
<img src="vrmlcoords.png" alt="The VRML Coordinate System"/>
<p>
The <span class="keyword">VRML coordinate system</span> is a right-hand system
with the x axis pointing to the right, the y axis pointing upward and the z
axis pointing toward the user.
</p>
</div>

<div class="note">
<p>
The rotations around the x, y and z axes are called
<span class="keyword">pitch</span>, <span class="keyword">yaw</span>
and <span class="keyword">roll</span>,
borrowing nautical terms that describe the motion of a ship on the sea:
<em>Pitch</em> is the up- and downward motion of the ship's bow as it hits the waves,
<em>yaw</em> is the actual deviation from the course,
and <em>roll</em> is the particularly sickening rotation along the ship's longitudinal axis.
</p>
</div>

<div class="imagewithcaption">
<img src="mousecoords.png" alt="The Mouse Coordinate System"/>
<p>
When talking about <span class="keyword">mouse movements</span>, we will call
the direction of the user's view the x axis and the left-to-right direction
the y axis. Most mice nowadays come with an additional wheel control. 
The wheel is usually called the z axis, but for consistency we will call it x-rotation, the positive direction being away from the user.
</p>
</div>

<h3>1.1.3 Modes of user interaction in VRML</h3>

<p>
In VR environments, not all degrees of freedom are used all the time. VRML
defines three common <span class="keyword">modes</span> of user interaction, using
different subsets of parameters to control the situation:
</p>
<ul>
	<li>
		<span class="keyword">Walk mode</span> mimics actual walking
		around in a place. Only z translation and y rotation are used
		(plus x rotation if the model allows for looking up and down).
		The rules of gravity apply.
	</li>
	<li>
		<span class="keyword">Examine mode</span> is used to view a
		small object from all sides. The object remains in place and
		is only rotated along the x, y and z axes. Optionally, the user
		can control z translation to zoom in and out). Gravity has no
		effect, but unlike real zero-G conditions the objects don't
		have the pesky tendency to float all over the place.
	</li>
	<li>
		<span class="keyword">Fly mode</span> allows for all six
		degrees of freedom. Again, gravity is looking somewhere else.
	</li>
</ul>
<p>
Of those modes, walk and examine are closest to our real-world experience and
thus are the easiest and most intutitive to use.<br />
In fly mode, the discrepancy between actual sense of gravity and virtual lack
of it makes finding one's way around very difficult, and requires training and
specialized control gear to be used effectively.
</p>


<h2>1.2 What's wrong with mice ?</h2>

<h3>1.2.1 A real-life use case</h3>

<p>
Imagine a VRML representation of a product in a virtual catalogue. How would
you conveniently manipulate it with your mouse to view it from all sides?
</p>
<p>
You would need ways to control three degrees of freedom, i.e. x, y, and
z-rotation.
Three rotation axes *can* be mapped to a wheel mouse:
</p>

<div class="imagewithcaption">
<img src="vrml+mouse.png" alt="Mapping VRML to mouse coordinates"/>
<p>
x mouse motion becomes z-rotation of the object, y motion becomes x-rotation,
and x-rotation (the wheel) becomes y-rotation (ouch! this is totally
counter-intutive).<br />
Breathe deeply, fasten your seat belt, and watch out for RSI syndrome :(
</p>
</div>

<h3>1.2.2 Mapping 6D to mice</h3>

<p>
A standard mouse is a 2D device: it can intuitively model translations along 2
axes. You might use the wheel as a third axis, but then how would you perform
rotations ? Modifier keys, or dragging with buttons pressed ?
</p>
<p>
All these workarounds have severe disadvantages:
</p>
<ul>
	<li>They are unintutitive.</li>
	<li>They lead to unnatural movements (think 8hrs/day usage).</li>
	<li>They are imprecise (or very hard to get right).</li>
	<li>They require the user to break motions down into components.</li>
</ul>
<p>
Thus, for anything more demanding than WWW gimmicks, the user needs a new way
of interacting with the computer that is better suited to the task of navigating
and controlling VR environments.
</p>

<h2>1.3 Solution: real 6D control - the Spaceball(tm)</h2>

<h3>1.3.1 Hardware</h3>

<div class="imagewithcaption">
<img src="spaceball.jpg" alt="The spaceball" />
<p>
The spaceball connects to the computer via an RS-323 serial port (there are
also gameport variants, and newer versions than the one discussed here
additionally provide USB) and offers true 6 degrees of freedom, plus a number
of user-assignable buttons.
</p>
</div>

<div class="imagewithcaption">
<img src="spaceball-outline.png" alt="Spaceball schematic drawing" />
<p>
The rubber ball can be pushed or pulled and rotated along all 3 axes.
When released, an elastic bearing pulls it back to center position.
When rotated or displaced from the center, it generates a continous stream of
events.
</p>
</div>

<div class="imagewithcaption">
<p>
It is designed as an addition to keyboard and mouse, not necessarily as a
mouse replacement:
</p>
<img src="spaceball2hands.jpg" alt="Using spaceball and mouse together" />
</div>

<h3>1.3.2 Motion mapping</h3>

<p>
There is an important difference to keep in mind between the mouse and the
spaceball: the former offers <span class="keyword">absolute positioning</span>,
whereas the latter works with <span class="keyword">relative positioning</span>.
</p>
<p>
The mouse function &phi; maps motion of the device to motion of the mouse pointer:
<span class="formula">
	&phi;<sub>mouse</sub>: s<sub>mouse</sub> &middot; c &rarr; s<sub>pointer</sub>.
</span>
The driver will apply a constant user-definable scaling factor.
</p>

<p>
The spaceball functions &phi; and &psi; map displacement to linear motion and
torque to rotation. While the ball is off-center, the pointer (or rather the
controlled VR object) keeps moving:
<span class="formula">
	&phi;<sub>sball</sub>: (s<sub>sball</sub>)<sup>c<sub>1</sub></sup> &rarr; s'<sub>object</sub> (= v<sub>object</sub>),<br />
	&psi;<sub>sball</sub>: (&alpha;<sub>sball</sub>)<sup>c<sub>2</sub></sup> &rarr; &alpha;'<sub>object</sub> (= &omega;<sub>objekt</sub>),
</span>
where <em>x'</em> denotes the derivative in the time domain.<br />
The driver will apply a user-definable acceleration exponent.
</p>

<p>
While the mouse has a <span class="keyword">linear relationship</span> between input
and effect, the spaceball <span class="keyword">integrates</span> the input: linear
and angular speed are the first derivatives of displacement and torque in the time
domain.
</p>

<p>
This is the reason why a spaceball is difficult to use as a mouse replacement.
Its behaviour is similar to the mouse surrogate "joysticks" found in some
notebooks.
</p>

<div class="nav">
<a href="term_paper.xml">Previous</a> |
<a href="term_paper.xml">Table of Contents</a> |
<a href="term_paper-2.xml">Next</a>
</div>

</body>

</html>

