Using Threejs + OrbitContols in TypeScript

前端 未结 14 1464
清歌不尽
清歌不尽 2021-02-07 11:59

I\'m not able to get this example of using the aforementioned combo going in TypeScript.

I have and <

14条回答
  •  失恋的感觉
    2021-02-07 12:26

    Feeling kind of silly since the solution (or workaround at least) turns out to be quite simple...

    Just declare the OrbitControls variable:

    declare var THREE.OrbitControls: any; // even "declare var THREE.OrbitControls;" will do the trick
    

    There are still some compilation errors but it works.

提交回复
热议问题