public static GetAbsoluteUrl: (url: string) => string =
typeof document === "object"
? (url) => {
const a = document.createElement("a");
a.href = url;
return a.href;
}
: typeof URL === "function" && typeof location === "object"
? (url) => new URL(url, location.origin).href
: () => {
throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.");
};
is the current implementation of the GetAbsoluteUrl function but I guess it is not available in your server environment. You should override it to something that would work on your environment with
Tools.GetAbsoluteUrl = (url) => { return ... };
Also are you sure the rest of what you need to render is available on your backend or are you not trying to render there but simply using nullengine
I’m simply trying to use the nullable engine ,to be able to calculate a set of meshes and placing then next to each others.
but to be able to do so i need to read the mesh data . and calculate by bounding box info …
I believe the issue is actually the HTTP request you are doing (which should not be an HTTP request). You are reading the file from the file system, right? The file is local and is not served by any static server?
Have you tried the file: protocol, or reading the file using fs. and converting the model to a data URL? I have noticed you mentioned it before, but the code is using localhost which I am not sure is what you meant to do.
playground link
for the actual data i’m reading from the file . its working properly in the sandbox .
but when i try to make it on my backend . I receive an error
Hey, I checked out your repo and I think the problem is with the model.
I had this error even for the local import;
With the model (I took seagulf.glb) from the
it works (at least local import).
I’m not sure what you’re trying to do with async loading - if you have files in your folder - just read them with eg. readFileSync.
If you want to load them from the Internet - try getting them from the Babylon mesh library maybe
well, it doesn’t make any difference if i used the default configuration or if i sat different urls .
( I thought The nestjs framework had a problem loading the urls) that’s why i specified them .