<iframe id="showcase" width="740" height="480" src="/bundle/showcase.html?m=[MODEL_SID]&applicationKey=[YOUR_SDK_KEY_HERE]" frameborder=”0” allowfullscreen allow="vr"'></iframe>
const showcase = document.getElementById('showcase');
 
const showcaseWindow = showcase.contentWindow;
showcase.addEventListener('load', async function() {
  let mpSdk;
  try {
    mpSdk = await showcaseWindow.MP_SDK.connect(showcaseWindow);
  }
  catch(e) {
    console.error(e);
    return;
  }
  console.log('Hello Bundle SDK', mpSdk);
});

 
const [ sceneObject ] = await sdk.Scene.createObjects(1);
const lights = sceneObject.addNode();
lights.addComponent('mp.lights');
lights.start();

const modelNode = sceneObject.addNode();
const fbxComponent = modelNode.addComponent(sdk.Scene.Component.FBX_LOADER, {
  url: 'https://cdn.jsdelivr.net/gh/mrdoob/three.js@dev/examples/models/fbx/stanford-bunny.fbx',
});
fbxComponent.inputs.localScale = {
  x: 0.00002,
  y: 0.00002,
  z: 0.00002
};
modelNode.obj3D.position.set(0,-1,0);
modelNode.start();

onLoaded = (gltf) => { 
   const THREE = this.context.three;
 
   this.context.renderer.physicallyCorrectLights = true
   this.context.renderer.shadowMap.enabled = false
   this.context.renderer.outputEncoding = THREE.sRGBEncoding
 
   let pmremGenerator = new THREE.PMREMGenerator( this.context.renderer );
       pmremGenerator.compileEquirectangularShader();
   let envMap = pmremGenerator.fromScene( new THREE.RoomEnvironment() ).texture;
   this.context.scene.environment = envMap;
 
    this.mesh = gltf.scene;
    this.mesh.animations = gltf.animations;
    this.mesh.name = this.inputs.name;
    this.mesh.scale.set(this.inputs.localScale.x, this.inputs.localScale.y / this.inputs.aspectRatio, this.inputs.localScale.z);
    this.mesh.rotation.set(this.inputs.localRotation.x, this.inputs.localRotation.y, this.inputs.localRotation.z)
    this.mesh.position.set(this.inputs.localPosition.x, this.inputs.localPosition.y, this.inputs.localPosition.z);
    this.mesh.visible = false;
    this.receiveShadow = true
 
    const light = new THREE.AmbientLight( 0xFFFFFF, 1.5 );
    light.position.y += 1
    light.position.z += 1
    light.castShadow = true
    this.mesh.add( light );
 
    this.outputs.objectRoot = this.mesh;
    this.outputs.collider = this.mesh;
 }
 
let speechConfig = SpeechSDK.SpeechConfig.fromSubscription(subscription.key, subscription.region);
if (voice.endpointId){      speechConfig.endpointId = voice.endpointId
}
speechConfig.speechSynthesisLanguage = lang speechConfig.speechSynthesisVoiceName = voice.name
 let stream       = SpeechSDK.AudioOutputStream.createPullStream(); let audioConfig  = SpeechSDK.AudioConfig.fromStreamOutput(stream);
let viseme    = [] let bookmarks = [] let synthesizer = new SpeechSDK.SpeechSynthesizer(speechConfig, audioConfig); synthesizer.visemeReceived  = (s, e) => { viseme.push(e) } synthesizer.bookmarkReached = (s, e) => { bookmarks.push(e) }
let handleResult = (result) => {     synthesizer.close();     msg.payload.ssml = { emotts, tts, ssml, text, viseme, bookmarks }
    if (result.audioData){         msg.payload.buffer = Buffer.from(result.audioData)         node.send(msg)     } else {         msg.payload.error = result.privErrorDetails         node.send([undefined,msg])     } }