#Immediate Renderer render() just before alert()

3 messages · Page 1 of 1 (latest)

glad saddle
#

I want to render each step wise construction of the scene.
So I placed alert() in middle of code, just after render() call, but it seems that rendering is interrupted and scene does not drawn.
Are there canonical ways to wait until render() job finishes?

Thank you!

CODE SNIPPET

const geometry = new THREE.BoxGeometry();
const lineMaterial = new THREE.LineBasicMaterial( { color: 0x00ccff } );
const line = new THREE.Line(geometry, lineMaterial);
scene.add(line);

renderer.setClearColor(0x773333, 1.0);
renderer.render(scene, camera);

alert("lo! at wireframe... then"); // FIXME: But does not show render result

const meshMaterial = new THREE.MeshBasicMaterial( { color: 0x00ccff, size: 3.0 } );
const mesh = new THREE.Mesh(geometry, meshMaterial);
scene.add(mesh);

renderer.setClearColor(0x337733, 1.0);
renderer.render(scene, camera);

midnight surge
#

Have you resolved the issue?

glad saddle
#

Partially. I divided my code to subroutines and call them step wise worked.
But inserting alert() method is not yet resolved though.
Since alert() seems to stop all javascript execution, I searched a way to finish rendering before calling alert(),
but is it that there are no such api?
I will close the thread. Thank you!