So here’s Martin Scorsese, almost 70 years old, one of the best directors in the history of cinema, and what does he do? He makes the first family film of his career. Why? For fun. For a change. Oh, and he does it in 3D, and not just in 3D, but in some of the most vivid and engaging 3D we’ve seen so far. There are directors who ONLY make family films who’ve never made one as good as this, Scorsese’s first.

This is “Hugo,” based on Brian Selznick’s book “The Invention of Hugo Cabret,” being the splendidly charming story of a young orphan boy who lives in a train station and has peculiar adventures, as young orphan boys in splendidly charming stories often do. Hugo (Asa Butterfield) came to live in the hidden passages of the ornate train station as apprentice to his boozy uncle Claude (Ray Winstone), who maintained the building’s many large clocks before wandering off. A born tinkerer, Hugo now passes the lonely hours repairing a small mechanical man that his late father (Jude Law) found among a museum’s discarded possessions.

Hugo generally keeps out of sight of the station’s employees, which include a humorously humorless policeman (Sacha Baron Cohen), a winsome flower girl (Emily Mortimer), an older cafe owner (Frances de la Tour), and a rotund newspaper seller (Richard Griffiths). But the lad can’t resist sneaking up to the toy booth, operated by a man named Georges (Ben Kingsley), to swipe mechanical playthings from which to salvage parts for his automaton. When he’s caught at it, and subsequently meets the stern Georges’ young goddaughter, Isabelle (Chloe Grace Moretz), and wife (Helen McCrory), he discovers that the family is mysteriously connected to his past. They’re also connected to something else Hugo loves: movies.

As it turns out, “Hugo” is specifically about the love of cinema, but it’s more broadly about the importance of remembering your history, even the painful parts. The station policeman, wounded in the Great War, is reminded of it whenever the metal brace on his leg seizes up, usually to comical effect. Hugo longs to unlock the mystery of the automaton because it’s his last connection to his father. Georges, on the other hand, resists his memories, and only reluctantly reveals them to us in a few extended flashbacks. These vignettes, like everything else in the film, are sumptuously photographed (by cinematographer Robert Richardson, a favorite of Scorsese and Quentin Tarantino) and presented with a sense of wonder and curiosity. They also happen to be laden with many true facts about the early days of film — nuggets of joy for budding cinephiles.

Ever an enthusiastic cinephile himself, Scorsese frolics through “Hugo” like a kid in a candy shop. All the skills he has exhibited elsewhere, including his mastery of camera movement and shot composition, are on display here, applied to a new genre but no less appealing than they were in, say, “Taxi Driver” or “Goodfellas.” He uses 3D to take us buzzing in and out of the train station’s nooks and crannies, into the mechanisms of clocks, back in time to Georges’ previous career, even into Hugo’s dreams. I don’t think I’ve seen a movie this year that was more visually delightful.

The only significant problem I have with it is that despite perfectly good performances by everyone involved, and despite a story that seems like it should tug the ol’ heartstrings, the film doesn’t strike an emotional chord with me at all. It isn’t cold or mechanical, but it’s not as warm and human as it ought to be, either. Even with all the genuine whimsy and imagination and colorful details being presented, there’s something almost perfunctory about the way the orphan-looks-for-his-place-in-the-world story comes together. Still, I’m excited to see where Scorsese will go next, now that he’s gotten back in touch with his inner child.

B+ (2 hrs., 6 min.; PG, thematic material and some perilous moments.)