2014-02-17 46 views
1

我想實現移動的攝像機在三個像這樣:THREE.PointerLockControls()返回「不確定是不是一個函數」

function initThree(){ 
    scene = new THREE.Scene(); 
    camera = new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,0.1,1000); 
    renderer = new THREE.CanvasRenderer(); 
    renderer.setSize(window.innerWidth,window.innerHeight); 
    document.body.appendChild(renderer.domElement); 
    geometry = new THREE.CubeGeometry(1,1,1); 
    material = new THREE.MeshBasicMaterial({color:0x00ff00}); 
    cube = new THREE.Mesh(geometry,material); 
    scene.add(cube); 
    camera.position.z=5; 
    controls = new THREE.PointerLockControls(camera); //fails at this line 

} 

在線條爲標誌,我得到以下錯誤:

Uncaught TypeError: undefined is not a function 

但是,有關於this頁面的示例嗎?我目前正在使用本地副本this THREE版本。

任何幫助將是偉大的!

+0

您確定它包含在該版本中嗎?我做了一個搜索,它沒有出現。 – linstantnoodles

回答

相關問題