Respuesta :

Due to the transition from a cool environment to a warmer/hotter environment. It's the same with condensation on a glass of water, essentially. Eyeglasses fog up when they are cooled below the dew point and encounter warm, moist air.
While inside, the lenses of your glasses had cooled to the point that when you walked outside, they were cooler than the dew point temperature of the air outside. The water vapor in the relatively warmer, and more moist air condensed, hence fogging your glasses.