Depends how complex u wanna get. There's a lot of math with proper 3d stuff.
http://www.codylindley.com/Tutor…