To add WASD keyboard movement support to the webgl_loader_fbx.html file from the Three.js GitHub repository, you can make the following changes:
- First, add a
controls
variable to the JavaScript code near the top of the file, to store the instance of theTHREE.OrbitControls
object:
var camera, controls;
- Next, locate the
init()
function and add the following code after thecamera
variable is defined, to instantiate theOrbitControls
object and set some initial values: