Have a read through
this thread, grab some of my attachments and look at how I did it (may not be the only way I must add). See if you can adapt what's in there to your specific requirements. If you get stuck just reply here and I'll see if I can get it working for you.
p.s. It's a long thread - grab a coffee before you start
😉
Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).