@metodologia, maybe this post discussed previously should help you get an idea of how it is done:
And this one too …