How does each building represent its own coordinates in 3DTILES? Is the property RTC-CENTER used? I want to get each building coordinates, but b3dm is binary, not very convenient to get, is there any good way? These building coordinates can be modified?
The 3d-tiles-tools
are offering some functions that can be helpful here.
You can
- install it with
npm install 3d-tiles-tools
, and then run it withnpx 3d-tiles-tools ...
- or clone the repository, and run
npx ts-node ./src/main.ts ...
in the cloned repository
The relevant functions are
b3dmToGlb
to extract the GLB from a B3DM fileglbToB3dm
to create a simple, default B3DM file from a GLB
Note: The question about what should happen with the RTC_CENTER
is not yet clear. There is a recent PR where this came up, but it is not yet decided what the final solution will be.
If your intention is to …
- extract the GLB from the B3DM
- modify the GLB
- create a B3DM from the GLB
then it is not clear what should happen with the RTC_CENTER
in this process. One approach that could work in this case is to use the state from the linked PR, i.e. the branch at GitHub - CesiumGS/3d-tiles-tools at apply-rtc-to-glb . With this branch, the behavior will be:
- when you extract the GLB from the B3DM with
b3dmToGlb
, then it will transform the GLB with theRTC_CENTER
- then you can modify the (transformed) GLB
- then you can create a B3DM from the (transformed) GLB with
glbToB3dm
.
The resulting B3DM file will then not define a RTC_CENTER
any more, because that will then already be part of the GLB - so the GLB should still be at the right position, even without the RTC_CENTER
.
Note that other information from the B3DM, e.g. batch table data, would also be lost in this process - from your screenshot, it looks like there is no batch table data, but it may be worth mentioning. As I said: The linked PR is only a draft, and we’ll have to see how to move forward from that.
If you have any feedback about the desired behavior and how the RTC_CENTER
should be handled, then we can consider this for our next steps.
thank you for your reply.
My goal is to modify the position of these models. Which attribute information of b3dm should I modify, or what other method should I use. B3dm information is binary and processed
Maybe there are some additional details that have to be considered, but generally, it should be possible to…
- Check out the branch of the tools at GitHub - CesiumGS/3d-tiles-tools at apply-rtc-to-glb
- extract the GLB from the B3DM with
b3dmToGlb
- modify the GLB
- create a B3DM from the modified GLB with
glbToB3dm
.
If the question is about how to specifically modify the positions of a certain building, then there are different options for that. One approach could be to just import the GLB into Blender and perform the modifications there.
thank you for your reply. but i have some questions.In b3dm under 3dtiles, these binary data are very inconvenient to view, is there any tool to convert him? Convert to normal English strings. It can be viewed directly on txt.
like red part
Most of this data is the actual GLB contents. After extracting this from the B3DM with the b3dmToGlb
command of the 3d-tiles-tools
, you can inspect this data in different ways. And depending on what exactly you want to analyze here, there are different options.
But a relatively easy and versatile one could be to use the glTF Tools - Visual Studio Marketplace plugin in VSCode. After installing this, you can…
Right-click the GLB file and select “glTF: Import from GLB”
(and then confirm the location for the .gltf
file)
Then you can obtain information about the glTF itself, by looking at the glTF JSON, and you can right-click, for example, on one of the accessors
and select “glTF: Inspect Data”:
The data will then be displayed in the window in the lower left - here, for example, the indices of the mesh: