Closed marcin-ochman closed 3 years ago
I'm using Two.js in Angular app. I would like to use ZUI.
I import two.js with following line:
import Two from "two.js";
and init ZUI with:
var zui = new Two.ZUI(this.two.scene); zui.addLimits(0.05, 10); fromEvent(this.container.nativeElement, 'mousewheel').subscribe((event: any) => { const dy = (event.wheelDeltaY || - event.deltaY) / 1000; zui.zoomBy(dy, event.clientX, event.clientY); })
Unfortunately, I get this error (Firefox):
ERROR TypeError: two_js__WEBPACK_IMPORTED_MODULE_2__.default.ZUI is not a constructor
Could you tell me how can I import it and make it work?
You should be able to import it through the extras folder like so:
extras
import ZUI from 'two.js/extras/jsm/zui.js';
I'm using Two.js in Angular app. I would like to use ZUI.
I import two.js with following line:
and init ZUI with:
Unfortunately, I get this error (Firefox):
Could you tell me how can I import it and make it work?