How do i composit a 3D environment into a green screen footage?


hello im new to VFX , ive read a lot of theory .now im finally tryint to bring in some action.

i tried googling , i didnt find exactly what i was looking for .so if someone be find to tell me the concepts and techniques in brief maybe i can google in the proper direction.

basically i am trying to find out how to composit terrains and 3D environments (vue,wm , terragen) into a green screen footage .i wonder cause if 2D images are brought into a compositing application , how are people able to move camera around like its a 3D environment .

Software : Vue , Unreal Engine , Maya , After Effects
sorry if i am too much …thanks in advance