I imported the voxel (.glb) model to three.js editor and the material is applied just perfect, I don’t see any stairs
But when I import the same model on my stage, I see a ladder
What is interesting: if I change Envrionment to modelviewer in the editor, then I see a ladder
But if it costs EQUIRECT, then everything is perfect
How and where can I put this EQUIRECT in my scene and what is it?
Mugen87
November 23, 2022, 6:56pm
3
You usually want to load a HDR environment map (e.g. via RGBELoader
or EXRLoader
) and then assign it to Scene.environment . Check out how the basic GLTFLoader
example does this if you need a code snippet: three.js webgl - GLTFloader
Please explain how the editor imports objects?
That is why there is a difference between importing into the scene and importing the same .glb into the editor
Mugen87
November 23, 2022, 7:14pm
5
The editor does not import glTF asset differently like in the example. Below code snippet is the actual import logic:
case 'glb':
{
reader.addEventListener( 'load', async function ( event ) {
const contents = event.target.result;
const { DRACOLoader } = await import( 'three/addons/loaders/DRACOLoader.js' );
const { GLTFLoader } = await import( 'three/addons/loaders/GLTFLoader.js' );
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' );
const loader = new GLTFLoader();
loader.setDRACOLoader( dracoLoader );
loader.parse( contents, '', function ( result ) {
const scene = result.scene;
scene.name = filename;
This file has been truncated. show original
The usage of DRACOLoader
is not mandatory. You only need it when your asset is compressed.