A special education and rehabilitation system employs real-time interactive computer graphics and photorealistic virtual humans that use gaze and facial gestures as guides to focus the learner's attention. By incorporating appropriate emotional responses while providing both verbal and nonverbal feedback, the solution implements an emotional modulation technique that increases learning efficiency. The model is based on a closed-loop interaction paradigm in which the learner's internal state is continuously monitored by sensors, and the responses as well as strategies of the animated tutoring system are adjusted accordingly. Sensors include a video camera for facial tracking and facial expression analysis, an eye tracker for measuring gaze, a biofeedback device to gauge stress levels, and other input/output devices for VR. The system has been used to develop many novel practical solutions. Case studies include applications for autistic children, cybertherapy, and cognitive rehabilitation.