Skip to content
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

b3dm with external textures reference error #3892

Closed
benjaminabb opened this issue May 3, 2016 · 7 comments
Closed

b3dm with external textures reference error #3892

benjaminabb opened this issue May 3, 2016 · 7 comments

Comments

@benjaminabb
Copy link
Contributor

In the 3D Tiles branch, when loading a b3dm file that references external textures like this:

"images":{"tex_5709034.jpg":{"uri":"textures/tex_5709034.jpg"}

The request for texture images then looks like this:

http://localhost:8080/Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/b3dms/R/SW.b3dm/textures/tex_5709034.jpg?v=0.0

which results in

Failed to load resource: the server responded with a status of 404 (Not Found)

The path in not relative to the folder containing the .b3dm file, but to the file itself.

When removing the b3dm header and loading it as an .glb, the textures work fine. Simply adding "../" in front of the path results in not seeing the model at all.

Tested in Chrome and Firefox

@pjcozzi
Copy link
Contributor

pjcozzi commented May 10, 2016

@konashredbiker thanks for the report! Do you have a sample 3D Tiles tileset that we can test with? Just a tileset with one simple .b3dm file would be great.

@benjaminabb
Copy link
Contributor Author

Yes, here I generated a simple one.
b3dmExternalTexture.zip

@pjcozzi
Copy link
Contributor

pjcozzi commented May 11, 2016

Thanks @konashredbiker! I added this as a near-term item to the 3D Tiles roadmap, #3241.

@lilleyse
Copy link
Contributor

@sumitshyamsukha Let's work on this after #4344.

In Batched3DModel3DTileContent and Instanced3DModel3DTileContent the basePath should not be the url of the tile, but instead the directory of the tile. You can use getBaseUri for this.

For testing that it works download the sample tileset provided above, host it somewhere (we usually use the 3d-tiles-samples repo for this):

When testing tilesets using this server that you do not want to accidently push to git, create a localTilesets directory, place the tilesets there, and access like 'http://localhost:8003/localTilesets/GitIgnoredTileset/'.

Then in the 3D Tiles Sandcastle replace the url of the first tileset with the url like above. If everything goes smoothly you should see a textured building.

@sumitshyamsukha
Copy link
Contributor

@lilleyse I was trying to host the sample tileset provided, but after running the 3d-tiles-samples repo, I get an error on connecting to http://localhost:8003 that says:

Cannot GET /

I imagine it's most likely something to do with an Express route -- any suggestions on how to fix?

@lilleyse
Copy link
Contributor

You don't need to access 8003 directly, you just need to get the url of the tileset hosted there. Run Sandcastle normally from localhost:8080 and in the 3D Tiles demo change the url of one of the tilesets to http://localhost:8003/localTilesets/NameOfTileset/

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 10, 2016

Fixed in #4376 thanks to @sumitshyamsukha!

Thanks for the report, @konashredbiker!

@pjcozzi pjcozzi closed this as completed Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants