Glamorgan 569 for 7 (Wright 123, Allenby 57, Cooke 52) lead Gloucestershire 391 by 178 runs
Ben Wright hit a sparkling 125-ball century to give Glamorgan a chance of pulling off an unlikely victory over Gloucestershire at Bristol.
Replying to the home side's 391, Glamorgan posted 569 for 7 by the end of day three, claiming maximum batting points. Wright contributed 123 and Jacques Rudolph, unbeaten on 108 overnight, eventually fell for 139.
Wright, the 26-year-old Lancastrian, played a superb innings featuring 24 fours and a six. He began the day on eight in a score of 209 for 2 and batted through the morning session with Rudolph, the pair adding 130 to the total by lunch.
Half-centuries from Jim Allenby and Chris Cooke later cemented Glamorgan's grip on the game as Gloucestershire's bowlers toiled in fierce afternoon sunshine. By the close the visitors led by 178 and have the opportunity to apply some pressure tomorrow.
The pitch, which had looked bland on day two, offered no more assistance to the bowlers as Rudolph and, particularly Wright, scored quickly from the start of the day.
Wright, who had looked uncomfortable at times the previous evening, hit top form with some sweet timing and moved to a half-century off 71 balls, outscoring his partner. Their stand of 158 took the score to 343 in the afternoon session before Rudolph departed, caught at third-man advancing to a short ball from Matt Taylor and attempting to uppercut it for six. Rudolph had faced 266 balls and hit 18 fours and a six.
Wright followed with the total on 370, caught by Ian Cockbain behind square, looking to sweep left-arm spinner Tom Smith. He left the pitch to warm applause and can rarely have played better.
Gloucestershire's efforts to stem the scoring rate and prevent their opponents gaining a meaningful lead were centred around bowling short to a field with as many as three or four players on the leg-side boundary.
Allenby was dropped at mid-off by Benny Howell off Smith on 7 and went on to enjoy himself, hitting boundaries off three consecutive balls from Liam Norwell, who conceded 17 from a single over.
It was 475 for 4 at tea, with Glamorgan 84 in front and Allenby having reached a 75-ball half-century. He fell soon after the interval, caught at deep square off Norwell. Cooke followed to catch at cover off the same bowler, having made a solid 52 off 111 balls, and Graham Wagg had to retire hurt on 5 after being hit by a short ball from Taylor.
But Glamorgan moved relentlessly past the 500-mark before Andrew Salter fell leg before to Howell for 19. By then it was clear they were intent on batting through the day.
Glamorgan coach Toby Radford said: "Graham Wagg took a nasty blow on the back of the head and was a bit woozy for an hour or so. But he's back to his normal chirpy self now.
"Ben Wright played beautifully and we are hoping this is an innings he can really kick on from. We will probably bat on for a bit in the morning and then hopefully our bowlers can do some damage."
Gloucestershire director of cricket John Bracewell provided an update on his side's injury problems: "Cameron Herring will undergo surgery on Thursday to have a pin inserted in his broken finger and we will be looking to sign a wicketkeeper on loan.
"Michael Klinger's injury has been confirmed by X-rays as a broken toe, but we are not sure yet how long he will be out of action."
Gloucs vs Glamorgan
England Domestic Season
LV= County Championship Division Two