Design of virtual environments for rehabilitation devices