Alvin M. Marks, a prolific inventor who held patents on polarized film for sunglasses, a 3-D moviemaking process, a generator the size of a grapefruit that could produce enough electricity for a house, a windmill with no moving parts and a trillion-dollar “space train,” died Sunday in Gardner, Mass. He was 97 and lived in Athol, Mass.

The cause was liver and pancreatic cancer, said Molly Bennett Aitken, his former wife.

A man capable of both small-bore pragmatism and large-scale imagination, Mr. Marks held 122 patents. An expert in optics, he developed several variants of polarized film that were used in sunglasses and to reduce glare on television screens; a headlight system to aid night driving; and window panels that change gradually from transparent to opaque and back again.

In 1951, he was granted a patent for a “three-dimensional intercommunicating system” that could be used to make TV shows and movies. He was president for many years of the Marks Polarized Corporation, based in the Whitestone section of Queens, where, along with his brother, Mortimer, who died in 2006, he invented many improvements on his original device, even though three-dimensional moviemaking never became the widespread technique he hoped it would.

For much of the latter half of his career, Mr. Marks focused on developing alternative and low-cost energy sources. An early experimenter with solar energy, he served as an adviser to President John F. Kennedy, and in 1967 was a consultant to the United States Senate on new technologies.