To generate a triangle wave using an op-amp, a square wave is first integrated, resulting in a triangular waveform. The circuit includes an amplifying buffer for the input square wave and an integrator, with diodes used to control the amplitude. A capacitor in the feedback path allows for a constant current, creating a linear ramp voltage across it. Understanding the effects of input offset voltages and open loop gain is also important for accurate waveform generation. This approach effectively utilizes the properties of capacitors and op-amps to produce the desired triangle wave.