When Leonard Foglia was invited to direct an opera based on Herman Melville’s masterpiece about a white whale, his first reaction was: “Moby-Dick. That’s great!”

“Then I ran to a used bookstore and got the book,” he recalled, “and I thought: ‘Oh my God, what am I in for here?’ It’s so daunting. I didn’t panic, but I thought, ‘How do we do this?’”

How he and his collaborators did it will be on display at the Metropolitan Opera beginning March 3. The opera is composed by Jake Heggie to a libretto crafted by Gene Scheer.

To begin with, Scheer had to whittle a novel of more than 600 pages down to a 64-page libretto. He kept as much of Melville’s language as possible, and estimates that 40% to 50% of his libretto can be found in the original text, though he often tweaked the phrasing to make it more singable.

Heggie and his initial partner, Terrence McNally (who withdrew for health reasons), had already decided to lop off the opening chapters, which take place on land. They set the entire opera aboard the whale-hunting ship Pequod.

Another crucial change was renaming the narrator, calling him Greenhorn to reflect his status as a novice aboard the ship. Now the book’s famous opening line, “Call me Ishmael,” is transposed to the very end of the opera when the character has matured.

“In the novel, Ishmael is telling a story that happened many years ago,” Scheer said. “But in the theater, you want to see it happen in real time. … We’re watching him take in all the experiences so that when he says ‘Call me Ishmael,’ he’s ready to write the book. In essence, this opera is the education of Ishmael.”

Tenor Stephen Costello, who is performing the role for the fifth time and is the lone cast holdover from the Dallas premiere in 2010, sees his character as “the only one who really has an arc.

“He goes on the Pequod because there was nothing for him on land,” Costello said. “So he’s either going to die at sea or figure out who he is.”