我無法得到this在TypeScript中使用上述組合的示例。在TypeScript中使用Threejs + OrbitContols
我有<script src="lib/three.min.js"></script>
和<script src="lib/OrbitControls.js"></script>
在我的HTML <head>
和輸出文件放在<body>
:
/// <reference path="lib\three.d.ts" />
...
this.controls = new THREE.OrbitControls(this.camera); //there's the error
this.controls.addEventListener('change', this.render);
...
和
this.controls.update();
在定期調用render()
功能。據我所知,該設置是相同的expample,但給了我一個巨大的錯誤(略)在OrbitControls構造線的編譯:
The property 'OrbitControls' does not exist on value of type '{REVISION:string;
CullFace: {[x: number ...
我想有全Threejs中的錯誤,因爲Visual Studio的崩潰當我點擊它:)。謝謝你的幫助。
鏈接中斷 – smartmeta
對不起,這裏是更新後的鏈接:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/three/three-orbitcontrols.d.ts – BenR
@BenR更新後的鏈接再次被破壞:( –