When you reset to factory settings, did you restore as new or did you restore from a backup? If you restored from a backup, you could try restoring as new and don't use the backup. If you do that, you will lose all of your data, but you can download or sync all of your content back to the iPad.
You could also try resetting all settings before your restore as new. Settings>General>Reset>Reset all settings. You will have to re enter all device settings again.
And of course the possibility does exist that the iPad has developed a hardware problem that is causing the rotation issue and only a visit to an Apple Store could determine that for sure.