Advertisement

Usage Three.js OrbitControls in TypeScript on Playground

Started by December 18, 2018 09:19 PM
0 comments, last by 8Observer8 5 years, 11 months ago

Hello,

I am trying to run official Getting Started Example on Playground https://plnkr.co/edit/ with OrbitControls.

The first problem was that official OrbitControls is not friendly with TypeScript and I took: https://github.com/nicolaspanel/three-orbitcontrols-ts

But this module does not use AMD by default and I recompiled it to AMD for usage with RequireJS library because I have a few files: Program.ts and Scene.ts and I can run my example on Playground only with AMD compilation. Recompilation requires going in node_modules folder for recompiling module - it is not a common way.

I created libs folder in my project and copied content of dist to libs/three-orbitcontrols-ts/ it works localy: https://github.com/8Observer8/usage-orbitcontrols-in-typescript-on-playground

I put all files in one directory for usage in Plunker and it works localy: https://github.com/8Observer8/usage-orbitcontrols-in-typescript-on-playground-one-directory

But when I upload the files on Plunker it does not work: https://plnkr.co/edit/yICv96E7lTK8xu7DohJB?p=preview

You will see the error in a console:

Quote

Scene.js:11 Uncaught TypeError: three_orbitcontrols_ts_1.OrbitControls is not a constructor

Please, help me to solve this problem.

This topic is closed to new replies.

Advertisement