Three component terpolymer and IPN hydrogels with response to stimuli