The temperature of the scrotum and testes is regulated by two muscles: the dartos and cremaster muscles. During cold weather these muscles contract the testes closer to the center of the body to maintain the correct temperature for sperm production; during hot weather they expand and sweat glands produce sweat. In the absence of sweat glands, the testes cannot be cooled properly, and sperm production may be affected.