Skip to content

Commit

Permalink
Extend README, add example models
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Apr 10, 2024
1 parent d4eaef4 commit d58cdd1
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ In addition to the above formats, it also allows to open a ZIP file that contain

There are two ways to open your files:

1. Click on your file in an application like standard Android "Downloads" app. (Most other Android applications will also behave like that.)
1. Click on any supported file in an application like standard Android _"Downloads"_ app. (Most other Android applications will also behave like that.)

This will pass the file to _view3dscene-mobile_ through a mechanism that *does not* reveal the actual filename of the original file.
This will pass the file to _view3dscene-mobile_.

This approach will only work for _self-contained_ model files. Such files don't refer to other files (like textures) through relative URLs. Examples that work:
An important limitation: This approach will only work for _self-contained_ model files. Such files cannot refer to other files (like textures) using relative URLs. The reason behind this is that _view3dscene-mobile_ doesn't get the file path from the Android system, so it cannot resolve relative URLs. We only get file contents.

Examples that work:

- glTF GLB variant.
- ZIP file that contains a model (X3D, glTF, ...) and the associated media (textures etc.)
- X3D/VRML with media embedded using [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). You can use [to-data-uri](https://github.com/castle-engine/castle-engine/tree/master/tools/to-data-uri) utility distributed as part of [Castle Game Engine](https://castle-engine.io/) to convert any media to data URI.
- X3D/VRML with textures embedded using X3D/VRML `PixelTexture` node. Though we recommend "data URI", it is more universal.
- Models that don't need any additional media (like textures).
- Models that refer to the additional media using http/https links.
- ZIP file that contains a model (X3D, glTF, ...) and the associated media (textures etc.)
- X3D/VRML with media embedded using [data URI scheme](https://en.wikipedia.org/wiki/Data_URI_scheme). Specifically for textures, you can also embed them using X3D/VRML `PixelTexture` node.
- glTF GLB variant.

2. Click on your file in an application like [Total Commander for Android](https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander), that can pass to _view3dscene-mobile_ the actual filename.
Use the `example_models` directory for test models that work with this approach.

2. Click on your file in an application like [Total Commander for Android](https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander). This passes to _view3dscene-mobile_ the actual filename.

This works for all cases.

This is the perfect approach, that works in all cases.
Note that _view3dscene-mobile_ must have permissions to read from given external storage location. Make sure it is so, in the Android settings, under _Applications_ -> _view3dscene_ -> _Permissions_ -> _Storage_.
Binary file added example_models/castle.glb
Binary file not shown.
Binary file added example_models/castle_packed_in_zip.zip
Binary file not shown.
105 changes: 105 additions & 0 deletions example_models/data_uri_test.x3dv

Large diffs are not rendered by default.

0 comments on commit d58cdd1

Please sign in to comment.