This is perfectly described in the workshops, read them >_^

http://tutorial.3dgamestudio.net/

workshop 9 and 10 goes through what you want.