I'm interested in learning Quantum Mechanics the way it was discovered, and that seems to be from blackbody radiation, which itself seems to be first quantified by Wien's Displacement Law. So Wikipedia says Wien derived this law by "considering adiabatic expansion of a cavity containing waves of light in thermal equilibrium. He showed that under slow expansion or contraction, the energy of light reflecting off the walls changes in exactly the same way as the frequency." I'm assuming I need to understand thermodynamics, and maybe electromagnetism. But to what depth should I know these subjects before attempting to understand Wien's Law? Would an undergraduate course suffice? Also, any additional subjects would you recommend?