A computer game is basically an interactive animation. Different animation loops are played based on the key inputs given by the user.In this example you can see how basic keyboard interaction can be added to a 3D animation using
ThreeJS library. Sample model created using
To make this work, the scripts listed below are required: :
- ColladaLoader - for loading model in .dae format
- OrbitControls - predefined camera controls with mouse
Left click and move mouse to rotate camera. Scroll to zoom in and out.
Press space key to reset.
- W - Make character walk
- A - Turn Left
- D - Turn Right