loading a scene and delaying the addition of it
===

In all the examples of loading an external model, one adds that mesh to the scene INSIDE that function.

For example:

    function createMesh(geometry) {
        mesh1 = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
        var axis = new THREE.Vector3( 16, -20, -8 )
        var radians = Math.PI/2
        scene.add( mesh1)           // LIKE THIS RIGHT HERE
    }

I ask because I need to rotate the imported mesh1 as a rigid body rotation about an arbitrary axis. To do that, I need the mesh1 object as a handle.


So I tried moving the scene.add(mesh1) into the main routine; But it always fails.

So I created a dummy object inside of the main routine and then add mesh1 to that dummy.

As follows

    function createMesh(geometry) {
        mesh1 = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial() );
        var axis = new THREE.Vector3( 16, -20, -8 )
        var radians = Math.PI/2
        dummy.add( mesh1)           // LIKE THIS RIGHT HERE
    }

Then, inside the main, I can rotate dummy.

IF this is clear... why must I do all this?

Does it have to do with the fact that the mesh1 MUST be added inside the function due to the asynchronous loading of the web page?