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

3D tiles - tiles invisible and cut #4333

Closed
daniel-hilton opened this issue Sep 18, 2016 · 11 comments
Closed

3D tiles - tiles invisible and cut #4333

daniel-hilton opened this issue Sep 18, 2016 · 11 comments

Comments

@daniel-hilton
Copy link

daniel-hilton commented Sep 18, 2016

I've tried to convert the gltf model of the old city Girona, Spain from here and recreated it as b3dm (by adding rtc_center, data as binary, batchId and b3dm header). The tileset that contains all these files has a root tile and 42 children that uses "replace" refine

There are 2 problems in the tile loading and view (both has video below)

  1. Sometimes the 3D model is getting cut in certain line - sometimes only the near side is seen and sometimes the opposite - in the video you can see both in the end
  2. Sometimes tiles disappears - the Bounding Box is there but the model it should contain does not.

(1)

start

(2)

end

@daniel-hilton daniel-hilton changed the title 3D tiled - unvisibe and cut tiles 3D tiles - tiles invisible and cut Sep 18, 2016
@lilleyse
Copy link
Contributor

Thanks for the letting us know about these issues. Would you be able to send over the tileset so that we can debug them?

@daniel-hilton
Copy link
Author

daniel-hilton commented Sep 18, 2016

i'm not sure I can publish it because it's ICGC model. but I can share it with you in private via email dropbox etc.

@lilleyse
Copy link
Contributor

Ok, you can send a dropbox link to [email protected]

@daniel-hilton
Copy link
Author

shared! If anyone else want this model write your mail here and ill send it ASAP

@daniel-hilton
Copy link
Author

BTW, this model is generated by acute and was converted from dae to glTF using the COLLADA2GLTF and from glTF to b3dm by this

@lilleyse
Copy link
Contributor

Quick update: I noticed that the bounding spheres generated for the underlying model are not aligned properly, which causes the view frustum near plane to be incorrect (causing problem 1) and is probably related to problem 2.

Would you also be able to also send over one of the original dae models through Dropbox?

bounding

@daniel-hilton
Copy link
Author

daniel-hilton commented Sep 20, 2016

I don't have the dae, only the glTF files, I'll send you them shortly.

As part of the b3dm convert process I have gone threw every vertex (in the POSITION accessor) and multiplied it by the transition matrix. because before the multiplication the model was directed by the Cartesian plane and not the cartographic. This might have been the problem.

  1. doesn't the bounding sphere calculated from the POSITION array? so if I've change the position it should change too. what am I missing?
  2. I've tried to use the transition matrix that exist in the tileset scheme, but it didn't effect the model, is there an example of using it?
  3. how did you managed to show the bounding sphere?

this is the code that "fixed" the POSITION accessor:

    for (let i = 0; i < count; i++) {
        tempCartesian3.x = buffer.readFloatLE(12 * i + offset);
        tempCartesian3.y = buffer.readFloatLE(12 * i + offset + 4);
        tempCartesian3.z = buffer.readFloatLE(12 * i + offset + 8);

        addPointToExtent(tempCartesian3,currentExtent);

        Cesium.Matrix4.multiplyByPoint(transformMatrix, tempCartesian3, tempCartesian3);
        Cesium.Cartesian3.subtract(tempCartesian3, centerRtc, tempCartesian3);

        buffer.writeFloatLE(tempCartesian3.x, 12 * i + offset);
        buffer.writeFloatLE(tempCartesian3.y, 12 * i + offset + 4);
        buffer.writeFloatLE(tempCartesian3.z, 12 * i + offset + 8);
    }

@daniel-hilton
Copy link
Author

I've added the the gltf files to the shared dropbox

@lilleyse
Copy link
Contributor

lilleyse commented Sep 20, 2016

Thanks I'll check them out soon.

The bounding spheres are calculated from the min/max of the position accessor, so if those aren't updated as well that could be a problem. Since you are transforming the positions, you may also need to transform the min and max.

So you tried using a transform on the root tile already? That seems like a good alternative to this situation. You can check out an example here: https:/AnalyticalGraphicsInc/3d-tiles-samples/tree/master/tilesets/TilesetWithDiscreteLOD. If you go this approach you may not need to modify the glTF positions at all.

To show the bounding spheres, in Batched3DModel3DTileContent.js I pass in debugShowBoundingVolume as true when creating new Model. This is just for debugging purposes and isn't an available option through the API.

As a side note, I noticed that each of your tiles contains two meshes associated with it. One with POSITION, TEXCOORD_0, and BATCHID, and another with just POSITION and BATCHID. So in Cesium your tileset is actually rendering twice the number of commands than it needs.

Anyways I'll take a closer look at the glTFs when I have a chance and get back to you.

@daniel-hilton
Copy link
Author

Seems that the min-max values was the issue. thanks for your help.

Continue to do the great things you do!

@lilleyse
Copy link
Contributor

Nice! I'm glad it works now.

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

2 participants