-
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
Support for loading 3D Tiles via CZML and Entity API #8580
Conversation
This change enabled CZML and the Entity API to load 3D Tiles tilesets. Since `Cesium3DTileset` has dozens of options, I only exposed uri/show/maximumScreenSpaceError to start. We also use the entity position/orientation (if specified) to compute the tileset.modelMatrix allowing for moving tilesets that can be tracked with the camera. Details: 1. New Sandcastle example, `CZML 3D Tiles.html` 2. New class, `Cesium3DTilesetGraphics` for representing a tileset via the Entity API. 3. New class, `Cesium3DTilesetVisualizer` for creating/managing the primitives. 4. Add `Entity.tileset` which is an instance of `Cesium3DTilesetGraphics` 5. Specs for everything
Thanks for the pull request @mramato!
Reviewers, don't forget to make sure that:
|
Another use case for this (in addition to flying houses) is that you can have an interval show property that swaps static tilesets over time, in case you wanted to do something like show interval-based collects over time and be able to scrub back and forth between them with the timeline. |
@lilleyse just a reminder to look at the 3D Tiles loading issue in this branch. Thanks! |
For whoever has the time to look at the tile loading issue: |
@mramato have you tried turning cullRequestsWhileMoving to false? https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html#cullRequestsWhileMoving |
No, but if that is the case it seems like something that shouldn't default to true since that means broken by default (or it needs to be made smarter) |
There is also a "multipler" flag with a similar name and if you set it to 0 it will turn the code path off so the true/false flag is redundant. |
To reproduce the problem:
You'll see a satellite marker flying like the typical simple.czml, but it's not until you hit pause that the house comes in. |
And just to confirm (though @loshjawrence already mentioned it) setting |
@mramato actually it should be I'm going to go with a simple solution where it treats |
@lilleyse while your at it we should lower the cullRequestWhileMovingMultiplier because its too aggressive for static tilesets (0.1 or something) |
@loshjawrence I kept it out of #8598 but you can open a separate PR. 60 to 0.1 is a huge difference though... |
Adding the 3D Tileset to the Entity API is kind of big news! It solves this 3D Tiles tracking/camera flying issue for example: #7086 since you can now add a 3D Tileset like this:
Or from ion:
The code, docs, specs and Sandcastle example all look good to me. My only quandary here is: inheriting the modelMatrix from the entity's position & orientation seems like the wrong approach. This would only produce the expected result when the 3D Tileset is located at the center of the Earth, right? I almost feel like I would be fine with merging this as-is assuming the common approach would be users creating a tileset on an entity with no position, and only using |
Source/DataSources/Entity.js
Outdated
/** | ||
* Gets or sets the tileset. | ||
* @memberof Entity.prototype | ||
* @type {TilesetGraphics} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no such type as TilesetGraphics
. This should be Cesium3DTilesetGraphics
. This produces an unclickable type in the doc here: http://localhost:8080/Build/Documentation/Entity.html#tileset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though party of me thought about removing the Cesium3D prefix from everywhere, but I guess keeping the two consistent makes more sense.
We should also remember to update https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide |
This is exactly what they should do. |
@OmarShehata ready |
Thanks @mramato . I just merged in master and resolved the conflict in CHANGES.md. Will merge when green. |
Awesome, thanks @OmarShehata! |
show: createPropertyDescriptor('show'), | ||
|
||
/** | ||
* Gets or sets the string Property specifying the URI of the glTF asset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't refer to a glTF asset. Copy/paste error from ModelGraphics?
This change enables CZML and the Entity API to load 3D Tiles tilesets. Since
Cesium3DTileset
has dozens of options, I only exposed uri/show/maximumScreenSpaceError to start but I'm open to adding more if we think they're needed. We also use the entity position/orientation (if specified) to compute thetileset.modelMatrix
allowing for moving tilesets that can be tracked with the camera. There seems to be an issue with 3D Tiles here where a moving tileset never actually gets loaded unless you pause animation to the camera stops. @loshjawrence seems to know how to fix this. (Also CC @lilleyse)Details:
CZML 3D Tiles.html
Cesium3DTilesetGraphics
for representing a tileset via the Entity API.Cesium3DTilesetVisualizer
for creating/managing the primitives.Entity.tileset
which is an instance ofCesium3DTilesetGraphics
This can wait until after Monday's release to merge so we aren't stuffing in a feature at the last moment.