Melo Trimble (2) scored a career-high 32 points Wednesday night at Northwestern. (Nam Y. Huh/Associated Press)

Mired in his worst shooting slump of the season, Maryland’s Melo Trimble didn’t tinker with his routine or preparation. Instead, he changed his look, going for a simple haircut and shave. He tightened his fade and trimmed his facial hair Monday in College Park. “I just felt that a new look would be right for me,” he said.

The new look earned him some new admirers Wednesday night after he scored a career-high 32 points in the Terrapins’ 74-64 win at Northwestern. He shook off a five-game stretch in which he was shooting barely above 30 percent to make 12 of 17 shots, including 4 of 5 from three-point range.

He looked, in short, like the player No. 23 Maryland (22-4, 10-3 Big Ten) will need if it is to make a run over the final month of the season.

“He’s got to be borderline cocky out there,” Maryland Coach Mark Turgeon said of the junior guard. “And I think he played that way a little bit tonight.”

Trimble played that way even as Northwestern (19-7, 8-5) sent its most physical perimeter players — rangy 6-foot-7 forward Vic Law and burly 6-6 guard Sanjay Lumpkin — after him. His confidence was cemented after he hit his first three-pointer less than three minutes into the game.

“Once I saw that first shot go in, right then and there I knew it was going to be my game,” Trimble said.

It helped that Northwestern started cold offensively — it hit just 2 of its first 15 shots and finished the game at 39 percent from the field (23 for 59). It helped that the Wildcats’ leading scorer, Scottie Lindsey, missed his fourth straight game with mononucleosis. It also helped that junior guard Bryant McIntosh pivoted between the bench and the court all night with foul trouble, finishing with nine points on 3-for-13 shooting.

But just three days after Northwestern tightened the Big Ten race with a momentous win at Wisconsin, the overflow crowd at Welsh-Ryan Arena suffered through long bouts of humbled silence because of Trimble. He gave his team a 32-22 halftime lead on two crucial plays in the final minute of the first half, including a dish in transition that led to a dunk by Damonte Dodd (12 points). On the ensuing possession, Trimble finished a three-point play after being fouled on an off-balance layup.

Trimble historically had been good against the Wildcats — he averaged 23 points in three previous meetings against Northwestern — but he took it to another level as soon as the second half started Wednesday.

“I never thought the old Melo left,” Dodd said. “I think he’s still there.”

Trimble had scored just one point in the second half of each of the previous two games, but he was the focal point of the offense after intermission Wednesday. He ripped off five points less than three minutes into the half to help push the lead to 13. After Northwestern cut the deficit back to 10, Wildcats Coach Chris Collins immediately called a timeout to disrupt Maryland’s traction on the offensive end. It didn’t work: Trimble came out of the timeout and pulled up for another three-pointer with Lumpkin in his face to make it 44-31 with 16:06 remaining.

By the time Trimble hit another three-pointer a few possessions later, giving Maryland a 17-point lead and silencing the crowd again, it looked as if he would cruise past his career-high of 31 points. And he was hardly alone in his strong night: Maryland as a whole shot 50 percent from the field (27 for 54) and outrebounded the Wildcats 40-31. Freshman Anthony Cowan Jr. (13 points) and junior guard Jaylen Brantley hit back-to-back jumpers to balloon the lead to 18 with 11:12 remaining and Trimble catching a breather. When Trimble came back on the floor, he completed another three-point play after finishing another hard drive to the basket.

Trimble passed his previous career high with a runner with 5:38 remaining. Maryland had a 17-point lead at that point, and even as Northwestern pulled within eight points with 1:16 left, it simply couldn’t get over the hump on a night that belonged to Trimble.

“I’ve just been trying to play basketball . . . this whole year, just play basketball. Unfortunately I couldn’t hit any shots,” Trimble said of his slump. “Tonight was my night.”