"Dancing at the Rascal Fair" is a daguerreotype of early-day homesteaders in the Montana high country. There they are, scuffing their boots in the dust of Main Street, or galloping through knee-high grass to herd their sheep, or loafing beside the barn on a summer day, and you want to climb right into the picture with them and smell the clean air.

The way Ivan Doig writes it, you almost can.

His wife Carol took rolls of pictures of buildings all over Montana, and in Scotland where the novel starts in 1889, and for hours he would pore over the slides on a light table, arranging them in rows to give himself a sense of what a frontier Main Street might have looked like back then.

He keeps file boxes of Montana lingo and stray bits of dialogue he has picked up from old letters and diaries, from his taped conversations with grizzled sheepherders. Some of it is new. In the small blue notebook he always carries is a snippet he overheard at a Garrison Keillor show last year.

First Woman: "Yes, I'm from St. Paul and my husband, he's from Minneapolis."

Second Woman: "Oh. A mixed marriage, huh?"

Maybe that will find its way into the final volume of Doig's trilogy, due to come out in 1990 for the celebration of the state's centennial.

"I do 800 words a day, four triple-spaced pages," the author said in a visit here. "I don't work consecutively. I might just write some dialogue and store it up."

There is a lot of cutting and pasting in Doig's technique. On the other hand, most of the set pieces -- the big blizzard, the sheepshearing contest, the forest fire in "English Creek," the first of the trilogy -- are written as they come up.

Doig is nothing if not methodical. When he visited Scotland three years ago he found the very dock where his ancestors left for America. Had his wife photograph the scene. Wrote notes to himself about exactly what a person could see from that spot. With his 5-by-8 index cards and his careful research, he sounds more like a historian.

Which in fact he is. He has a PhD in American frontier history, obtained early in his 21 years in the Seattle area. Even the fair of the book's title comes from a sociological study he read. And the accent of the hero's talk is historically accurate, you may be sure, as it changes subtly through the story, almost imperceptibly losing its Scottish lilt and turning into American Western.

But of course all the tape recordings and photos and research in the world can't make a novel sing. Or charm away the wooden heroes and cutout heroines, the travelogue landscapes, the tin-eared talk of so many best sellers.

What you need is passion.

Below us in its broad canyon the Two Medicine wound and coiled, the water base for all the world that could be seen. The sentinel cottonwoods beside the river rustled at every touch of wind. Up where we were and out across the big ridges all around, pothole lakes made blue pockets in the green prairie. Anna, you need to see this with me, I vowed that June morning on the green high bluffs of the Two Medicine. Sometime we must come, just the two of us, and on a morning such as this watch summer and the earth dress each other in light and grass.

This isn't something a writer gets from a textbook. It's something you know because you are the son of an easygoing ranch hand named Charlie Doig and Berneta, the woman he loved, and because you remember the night of your sixth birthday in the cabin high in the Bridger Mountains, when you heard your mother's asthmatic breathing labor, choke and then stop, while your father fumbled, crying, to light the lantern in the dark. "She's dead, Ivan. Your mother is dead."

The author remembers Charlie, after that, taking him along on his sheepherding jobs, and into the saloons of White Sulphur Springs, and then making peace with his mother-in-law, widowed Bessie Ringer, and settling with her as housekeeper into a more stable life for the sake of his son.

And the July afternoon when he was still a sophomore in high school, shearing sheep on the Blackfeet reservation and getting hit with a terrific icy rainstorm that stampeded the sheep and even froze some to death, and he decided in that one moment that this was enough, that he was going to get out of Montana, beautiful or not.

And the times he waited in the middle of nowhere, stood by the tracks with his suitcase at Ringling, Mont. (pop. 45), for the depot agent to flag down the train, and it would sit there hissing gigantically, and a guy in a white jacket would jump down and set out a portable step so he could get aboard, just him, to go to Northwestern University in Illinois.

"I got a doctorate. I never used it," Doig said. "I thought about journalism and ended up as a free-lance magazine writer. 'This House of Sky' came out of my exasperation at the money situation."

That first book, a memoir published in 1978, helped some, as did his first novel, "The Sea Runners," but basically his wife Carol, a teacher, supported the two of them until "English Creek" came out.

From the beginning he knew it would be a trilogy. He left little holes -- enigmatic references to the past -- in the first book, which happens in the '30s, knowing that he would fill them in one way or another in the second. The third will cover the centennial celebration and will tie up some loose ends in his McCaskill family, Scots like his own grandfather, Peter Doig, who came west to settle the hard country of Montana.

"I tried to figure what Scots guys would look like in those days," said Doig, 48, who with his graying red beard and long Saxon face wouldn't be a bad model himself. "I thought about Thomas Carlyle, with that long upper lip and big nose. Then there was a woman I wanted for Beth McCaskill, and I found her in the library, but she was 60 years old, so I asked her to get me a picture of herself at 40."

And the family albums. "My mother kept one. There was a photo of my father when he was a rodeo cowboy, young, in chaps, with his bandanna flowing. It was terrifically evocative. It reminds you -- they were young once too, by God, young and crazy and this and that."

(In "This House of Sky" Doig talks about this picture. "... He was so slim down the waist and hips that the seat of his pants forever bagged in and the tongue of his belt had to flap far past the buckle, as if trying to circle him twice. Certain photos catch this father of mine as almost mischievous, cocking the dry half-grin which sneaks onto my own face as I look at him ...")

Doig and his wife still live in Seattle. She still teaches, and he still writes on a manual typewriter because word processors affect his eyes. And he remains, still, a Montana boy.

Everything was in place. The continent's flange of mountain range along the west. The dark far butte called Heart and the nearer slow-sloping one like an aft sail. The grass plateaus beyond Gros Ventre and its cottonwood creek. The soft rumple of plains toward the Sweetgrass Hills and where the sun came from. Enough country that a century of Robs and Anguses would never fill it.