This first structure is very simple: it uses two motors as rotational sensors.
The two angles measure the rotation around axes x and y, and they rappresent the inclination respect to the vertical position (see fig below).
As one can see from the figure, it is possible to connect others sensors to the joystick (a normal pressure sensor is used in this example) using their signal to send some information or instructions to the NXT. A feedback force is created in order to bring back the joystick to the initial position, this feedback force is proportional to the position of the motors.
Joystick and Legway are linked by the bluethoot connection. Download the NXC sources, here is Matlab/Simulink version.