There are different scenarios where you wish to get a control of the camera in first person, such as in FPS video games. Basically, we want to move and rotate our camera in any horizontal direction defined by the combination of x and y rotation of the user mouse and by keyboard keys input. In this recipe, you will learn how to develop such a class from scratch, which can then be useful in your consequential projects where FPS behavior is needed.
Set up a basic Away3D scene extending
AwayTemplate and give it the name
FPSDemo. Then, create one more class which should extend
Sprite and give it the name
FPSController class encapsulates all the functionalities of the FPS camera. ...