I have a VRML 97 file I’d like to import and display. Can I do this in BabylonJS?
The code for what I’m doing is here:
var modelToLoad = "phase_1.wrl"; var modelURL = "models/"; if (currentMesh == null) { var mesh = BABYLON.SceneLoader.ImportMesh("", modelURL, modelToLoad, scene, function (newMeshes) { scene.removeMesh(currentMesh); currentMesh = null; currentMesh = newMeshes[0]; currentMesh.rotate(BABYLON.Axis.Z, -Math.PI, BABYLON.Space.LOCAL); currentMesh.translate(new BABYLON.Vector3(-1, -1, -1), 65, BABYLON.Space.LOCAL); }); }
However I get this error
babylon.js:16 BJS - [14:15:31]: Unable to import meshes from models/phase_1.wrl: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse
I did see this work: VRML Loader - Need Help but I don’t know if I need to use her loader or if I just need BabylonJs API call.
Thanks,
~Shane