I want to import the pointerlockcontrols from the three js, but I have cdn. How do I import it? An example is this:
import { PointerLockControls } from ‘./jsm/controls/PointerLockControls.js’;
Or could I use ‘./jsm/controls/PointerLockControls.js’; ? When I use that, it gives me a white screen. How do I solve that?
You can just import directly via the url, ex.:
import { GLTFLoader } from 'https://unpkg.com/three@0.133.0/examples/jsm/loaders/GLTFLoader.js';
(The url may depend on the CDN you’re using - just be sure to import the jsm
version of the files.)
im using cloudflare cdnjs