-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basePath doesn't seem to work when loading glTF content #5319
Comments
I presume you were trying this within the context of I plan to investigate this issue as part of the review of AnalyticalGraphicsInc/gltf-vscode#6. |
Precisely. I found a workaround, but I think it makes sense to support local rootpaths as well since you might want to implement an app/game that can run off Cesium locally. |
This is most likely to |
@mramato This is kind of the opposite problem. In this particular case, Cesium is executing inside an HTML preview sandbox with relaxed security that allows reading arbitrary files off the local filesystem. Actually I wonder if just slapping |
Ahh, that makes perfect sense, and I expect making sure you use a |
Great catch. That does indeed fix it. I missed this because Babylon doesn't want the |
Great, thanks! |
new Cesium.Model
lets you specifybasePath
to indicate the base path that any relative paths in the glTF JSON are referring to. Unfortunately, it doesn't seem to work.I attempted to use the glTF 1.0 boxTextured sample model. I copied the files to
c:\sample\
and did something like this:var gltfContent = ""; // insert the full content of the .glTF file here. model = scene.primitives.add(new Cesium.Model({ gltf: gltfContent, basePath: "c:\\sample" // I also tried "c:\\sample\\" and had same result }));
Nothing ends up rendering.
Now, if I modify the
uri
s withingltfContent
and make all of those paths absolute, it all renders just fine. So, it appears thatbasePath
functionality has an issue.The text was updated successfully, but these errors were encountered: