Maybe you can use the code from the water sample from OGRE.
http://www.ogre3d.org/