The Motion Controller for PS3 works in a similar way to Nintendo's Wii controller. A sensor sits on top of the TV and detects the position, distance and movement of two controllers held in a user's hand.
The device can not only measure where the controllers are in relation to each other, but also how close they are to the sensor, meaning you can create true 3D movement within a game.
http://news.bbc.co.uk/2/hi/technology/8080436.stm