Hello all! I am experiencing a problem when using xhr2
and the Babylon Null Engine
.
When I use the following simple code:
global.XMLHttpRequest = require('xhr2').XMLHttpRequest;
ground_size=[100,100];
var options = {width: ground_size[0], height: ground_size[1],
subdivisions: 100, minHeight: -118, maxHeight: 92};
var ground = BABYLON.MeshBuilder.CreateGroundFromHeightMap("ground",
"/images/heightMap.jpg", options, scene);
I get an error:
throw new NetworkError(`Unsupported protocol ${this._url.protocol}`);
After searching some other problems, I searched about this problem and found a link here: Loading models in NullEngine - Questions & Answers - HTML5 Game Devs Forum. However, this link seems to be talking about the Scene Loader
, while my problem is doesn’t use the scene loader. What is the problem here? How can I fix it?