1 year ago

#356209

test-img

sygi

Is there synchronous loading in threejs?

I have a scene stored in a scene.json file (created in threejs editor). I would like to load the scene in javascript synchronously, ie. something like:

const scene = some_function("scene.json");
scene.add(camera);
renderer.render(scene, camera);

I only found how to do it asynchronously by:

loader.load("scene.json", function(scene){
  scene.add(camera);
  renderer.render( scene, camera );
});

but I don't like it, as I'll have a sizable logic after loading the scene, and on the other hand the scene itself is small and won't affect page loading times.

javascript

three.js

synchronous

0 Answers

Your Answer

Accepted video resources