John B. Slaughter, director of the National Science Foundation, has been appointed chancellor of the University of Maryland's main campus at College Park, it was announced yesterday.

Slaughter, a 48-year-old engineer, leaves the federal science agency after less than two years of a six-year-term. A soft-spoken, generally low-profile administrator, he was appointed by President Carter.

Yesterday he said he had "good support" from the Reagan administration, which this year proposed a slight increase in the foundation's $1 billion budget. Slaughter said he decided to accept the post at Maryland because of the "rare opportunity" to take part part in "the transformation of a fine university to one that is great."

Slaughter will become one of the few blacks to head a major American university campus and the first to hold such a position in Maryland.

With 37,528 students, including about 7,500 graduate students in 70 fields, the University of Maryland at College Park is the seventh largest college campus in the nation.

Blacks make up 7 percent of its students and 4 percent of its 1,700 faculty members. For the last decade, black student groups have expressed dissatisfaction about race relations on the campus.

Slaughter said yesterday the university should seek more blacks, not only from Maryland but from the District of Columbia. He said the school should try to attract "some of the finest students of all races and colors."

"I think my own appointment will have some symbolic importance . . . as a measure of the distance this institution has come," Slaughter said. "But the university looks for a chancellor to lead the entire campus . . . ."

Slaughter succeeds Robert L. Gluckstern, who resigned after seven years as head of the College Park campus. Gluckstern, whose relations with University President John Toll were reportedly cool because of the president's detaileddecision-making, will become a physics professor at Maryland this fall.

"The president of the University of Maryland is the senior ranking official," Slaughter said. "There's no confusion about that. I will have absolutely zero problem in working with him."

Besides College Park, the University of Maryland has campuses in downtown Baltimore, Baltimore County, and Princess Anne, each headed by a chancellor as its chief academic and executive officer.

In late April, the university's governing board of regents offered the College Park chancellor's post to Delbert Shankel, an administrator at the University of Kansas, but Shankel turned it down, saying his family did not want to move to Maryland.

Toll said the Board of Regents voted to appoint Slaughter at a closed meeting in late May.

Slaughter, who lives in Chevy Chase, said he will move into the chancellor's house on campus in January when he assumes his $75,000-a-year job. He said he was delaying his departure from the federal government to give President Reagan time to appoint his successor. Vice Chancellor William E. Kirwin will serve as acting chancellor after Gluckstern leaves in mid-August, Toll announced yesterday.

Born in Topeka, Kan., Slaughter has a bachelor's degree in electrical engineering from Kansas State University, a master's from the University of California, Los Angeles, and a PhD in engineering sciences from the University of California, San Diego. He worked 15 years for the Naval Electronics Laboratory Center in San Diego before becoming director of the Applied Physics Laboratory at the University of Washington from 1975 to 1977.

For the next two years he was an assistant director of the National Science Foundation before moving to Washington State for a year.

Slaughter and his wife, Ida Bernice, have two children, John, a veterinary medicine student at Tuskegee Institute, and Jacqueline, who is graduating next week from Bethesda-Chevy Chase High School. Slaughter said Jacqueline is "inclined toward attending" Hampton Institute next fall. "She has not precluded coming to College Park ," he added. "But I'm not going to exert any pressure . . . ." CAPTION: Picture, John B. Slaughter will assume his $75,000-a-year post as chancellor of the College Park campus in January. By Vanessa Barnes-Hillian -- The Washington Post