How To Access GLTF Loader In Common JS on Server Side

33 views Asked by At

I Want Load My Environment On Server and Client Both But want To Send Model Properties From Server Their Position Direction rotation. But When I want to access GLTF Loader it couldn't Get GLTF loader on server side Here is my Code To Access GLTF Loader It Gives That GLTF is not a construcor

const THREE = require('three');
const { GLTFLoader } = require('three/examples/jsm/loaders/GLTFLoader');
const {DRACOLoader} = require("three");
// const {BufferGeometryOctree } = require('three');
class CreateBox {
    constructor() {
        this.world = new THREE.Group();
        // this.worldOctree = new BufferGeometryOctree();

        this.gltfLoader = new GLTFLoader().setPath('../assets/models/');
        this.dracoLoader = new DRACOLoader();
        this.dracoLoader.setDecoderPath('../assets/draco/');
        this.gltfLoader.setDRACOLoader(this.dracoLoader);
    }
0

There are 0 answers