This works fine in the playground:
The starter template at:
has been copied to my Visual Studio HTML page.
The only thing I do to the starter template is replace its createScene function with the playground contents above.
It errors out at the scene.meshes[0].createNormals() line with the browser debug mode throwing an exception at it
scene.meshes[0].createNormals();
and reporting that scene.meshes[0] is undefined. The alert(“After meshes”) is never displayed the Browser.
Why is scene.meshes[0] defined in the Playground but undefined in the Browser?
What am I missing here?