The glitter is going out of South Africa's big three precious minerals--gold, diamonds and platinum--all of whose world prices are plunging and costing the country billions of dollars in foreign exchange.

Gold has been the most dazzling. South Africa produces three-quarters of the free world's gold, and its soaring price, which reached a high of $820 an ounce in 1980, carried the country to its greatest boom in a decade, while the economies of the rest of the world were stagnating.

It was characteristic of South Africa, whose policies of strict racial segregation are universally condemned, that it should have had the perverse tendency to prosper when everyone else was in trouble.

The high gold price that brought it such an unprecedented bonanza was primarily a consequence of the economic malaise that weakened the dollar and other major currencies. Investors hedged into gold.

Now gold is on the way down, and South Africa is losing an estimated $200 million for every $10 the price falls, averaged out over a year.

Last year's sales earned South Africa $8 billion compared with $10.1 billion the year before. Last week the price fell below $380 a fine ounce, which is $234 below 1980s average and $79 below last year's.

The past week has seen the price dip more steeply as the Soviet Union, the world's next biggest producer, sold off large quantities of gold to buy grain in expectation of another poor crop and increased needs from Poland.

The drop in diamonds has been no less spectacular, though its impact on the South African economy is not as serious. More seriously affected will be Namibia, the neighboring former German colony that South Africa has administered since World War I. Diamonds are the biggest item in its economy, and production is being cut by a quarter this year.

South Africa is the world's third-largest diamond producer after Zaire and the Soviet Union. But Zaire produces mostly lower-grade industrial diamonds, while South Africa is the leader in gems.

Last week De Beers, the South African company that controls the marketing of most of the world's diamonds, revealed that sales last year crashed by about $1.5 billion, or 46 percent. The decline reached 54 percent in the second half of the year.

This time the stagnant Western economies have not worked to South Africa's advantage. The lackluster demand for jewelry, particularly in the United States, where more than half the gem diamonds are sold, has caused the crash.

What makes the decline in diamonds remarkable is that De Beers, which is part of the mining empire headed by the South African multimillionaire Harry F. Oppenheimer, has for years controlled one of the world's most successful commodity stabilizing systems.

Through its London-based subsidiary, the diamond trading company--more commonly known as the Central Selling Organization (CSO)--buys as many of the world's diamonds as it can get and then sells only what it believes the market can easily absorb.

It does this to a selected handful of 300 cutters and dealers who are invited to viewings in London and Kimberley, where De Beers has its headquarters. That way De Beers has been able to ensure that diamonds have had a steady rise in price over the 48 years since it founded the selling organization.

However, the system has begun to falter in recent years. First diamond cutters, particularly in Israel, began to stockpile large numbers of high-quality gems in hopes of making later profits. Then Zaire broke away from the CSO and established its own marketing agency.

These developments coincided with the world recession, which dried up the demand for diamonds, particularly in the United States.

In its recent annual report, De Beers expressed confidence that it could regain control of the situation and that diamonds would bounce back, beginning early 1983. De Beers is holding back on large numbers of diamonds and has cut output in its own mines, which are mainly in South Africa, Namibia and Botswana, a neighboring independent state.

The platinum story is much the same. South Africa produces 51 percent of the world's platinum group of metals. The United States and Japan are its main markets. The U.S. auto industry is its biggest single customer--it uses platinum as an antipollution catalyst.

The auto industry's troubles have hurt platinum badly, and technical advances have reduced the amount of platinum needed to meet current emission-control standards.

The platinum price has fallen from a high of $722 an ounce in September 1980 to around $390.

Rustenburg Platinum Holdings, which owns the world's largest platinum mine at Rustenburg, 100 miles west of Johannesburg, has pegged its own producer's price at $475 but reports that sales are badly down.

Viewed overall, it points to a tight year ahead for South Africa. The government estimates that its tax revenue from gold will be down 47 percent from last year, and revenue from diamonds will fall from $80 million to $2 million. As a result, the government will have to trim spending, even defense expenditures, when the new national budget is introduced in March.