I spent a few hours yesterday "pair programming" with chatGPT something similar in three.js. There has been lots of criticism of boilerplate aspects of what GPT writes, but its ability to take feedback and iterate is underrated.