javascript - THREE.PointerLockControls() returning "undefined is not a function" -
I am trying to implement a moving camera in three ways:
Function initThree () {view = new three. Sen (); Camera = new three. Perspectamera (75, window winner / window winner, 0.1,1000); Renderer = New three. Cantilever Raiders (); Renderer.setSize (window.innerWidth, window.innerHeight); Document.body.appendChild (renderer.domElement); Geometry = new three Cub Gymetry (1,1,1); Content = new three. Messaging content ({Color: 0x00ff00}); Cube = new three Mesh (geometry, content); Scene.add (cube); Camera.position.z = 5; Control = new three. Pointer lock control (camera); // failed on this line)
On the marked line, I get the following error:
Uncheck type error: there is no undefined function
However, this is an example on the page? I am currently using a local copy of the three builds.
Any help would be great!
You are receiving this error because it is not part of it if you want to use controls If you are, you probably need to include them separately.
Comments
Post a Comment