R. Buckminster Fuller, 87, a modern Renaissance man who was known for designing the geodesic dome, for preaching salvation through technology, and for his gentle, glittering and multifaceted genius, died yesterday in Good Samaritan Hospital in Los Angeles.

Hospital officials said Mr. Fuller suffered a fatal heart attack while visiting the hospital bedside of his critically ill wife, Anne.

A prolific writer and startlingly innovative thinker, Mr. Fuller was the author of 25 books, the holder of 26 patents, and a continual conceiver of new ideas and of new connections between existing ones.

Mr. Fuller styled himself a comprehensivist, and his talents and versatility reminded some of a latter-day Leonardo da Vinci. He was skilled as an engineer, architect, scientist, mathematician and cartographer, and was admired and revered as a poet, environmentalist, world planner and educator.

His geodesic domes, lattices of triangles that provide maximum strength for a minimum expenditure of materials, dot landscapes around the globe.

His "World Game," a computerized, all-encompassing demonstration of the interaction between human actions and strategies and the world's resources, won him great regard among planners, environmentalists and, in particular, in the 1960s, among members of the counterculture, which revered him as a kind of guru.

A spell-binding talker, Mr. Fuller described himself as infused with delight at what he perceived from childhood as the beauty and wonder of the world. In nonstop, hours-long discourses that bubbled with excitement and enthusiasm, he spread out his visions over the years for rapt audiences at meetings and conventions around the globe.

Mr. Fuller was one of 12 Americans who received the Medal of Freedom, the nation's highest civilian honor, from President Reagan this year.

A man of many unconventional qualities, some of whose ideas and insights seemed at times to verge on the mystical, Mr. Fuller sprang from a background and traditions firmly rooted in the American past.

He was born on July 12, 1895, in Milton, Mass., a suburb of Boston, to Richard Buckminister Fuller, a prosperous merchant and his wife, Caroline Wolcott Fuller. Members of his family first settled in New England 350 years ago. One ancestor was Margaret Fuller, a feminist, social reformer and transcendentalist critic. Another was a state legislator, and still another was a colonial governor of Connecticut.

Despite this background, and despite the inheritance of intellectual gifts that manifested themselves early, he demonstrated as a child that tradition would play only a limited role in shaping his mind and character.

As a 6-year-old in kindergarten, he built a tetrahedral octet truss (a key structural element that later reappeared in his geodesic domes) out of toothpicks and dried peas. But while he did well in science and mathematics at Milton Academy, he showed impatience with its rules and teaching methods.

And after entering Harvard, alma mater of the male members of his line since 1760, he soon encountered a social stratification that made him restless. He was expelled after a spree in New York City during which he spent his tuition money on an elaborate party for the cast of the Ziegfeld Follies.

Readmitted after working as a factory mechanic, he was expelled again, ending his formal education. After hauling meat for a packing house and then working as a cashier, he joined the Navy in 1917, took a three-month officer training course at Annapolis and commanded crash boats at a naval flying school at Newport News.

After discharge as a lieutenant j.g., he eventually helped set up and devise machinery for a manufacturing company, but the company floundered and in 1927, he was sacked, leaving him at low ebb.

He had been married in 1917. In 1922, his 4-year-old daughter died. That loss had devastated him. In 1927, another daughter was born, but he was suddenly without a job.

He considered suicide, he later said, but decided instead to reorganize his life. "I made an experiment," he recalled, "to see what, if anything, an unknown penniless 32-year-old male with a wife and child could do."

"I asked myself a question," he said. "Who am I?

"I decided that I was an inventory of experiences. And if I did away with myself I might get rid of some connecting link of experience in the universe that would turn out to be important.

"So I decided that I would only work for humanity, not for my family, or myself, or any one side."

Moving with his family to a small apartment in a Chicago slum, Mr. Fuller entered a period of seclusion and meditation, basing his thinking on the premise that he would "reform the environment, instead of people."

From this period stemmed the designs for such structures as his hexagonal "living machine," a lightweight house designed for mass production, his prefabricated, modular bathroom, and the Dymaxion House, a structure suspended from a pole. He also devised a three-wheeled, rear-engine, streamlined Dymaxion car. Each of these was intended to help reach his goal of "finding ways of doing more with less to the end that all people--everywhere--can have more and more of everything."

From the early designs came a new type of map, still more houses, and in the late 1940s, the geodesic dome, which in a few years began to win broad acceptance. Ever larger, they sprouted up all over the world. The famed 1959 kitchen debate between President Nixon and Soviet Premier Khrushchev at a Moscow exchange fair took place in a golden geodesic dome.

After taking a post as research professor at Southern Illinois University in Carbondale in 1959, the five foot two inch Mr. Fuller turned his talents to management of global resources, traveling the world to champion such projects as wind-powered generators and world-connected power grids.

An indefatigable optimist, he asserted that technology needed to be improved not eliminated. "We don't have an energy crisis," he maintained. "We just have a crisis of ignorance."

The bespectacled, blue-eyed Mr. Fuller, once described as a free-lance genius, was hospitalized last year for hip surgery. When he was discharged he lectured on the insights that came from his stay in bed.

"We must be here for some extraordinarily important function," he said in an interview last year. "I feel we're at a point where humanity has the option to make it."