It works with a 3d accelerometer to know wether its facing upwards or not. the rotational view only happens of the device is pointing downwards.
The wii remote also uses a 3d accelerometer... (but according to alot of people just lately, additive error would make one impossible for this...)