[iTowns-user] Unwanted culling when rotating globe
Terek Campbell
terekc at gmail.com
Tue Aug 6 16:07:47 PDT 2019
Here's a bit larger snippet with most of my iTowns related code:
* private initGlobeView(sceneDiv) { const position = new
Coordinates("WGS84", 2.351323, 48.856712, 25e6); this.view = new
GlobeView(sceneDiv, position, { scene3D: this.scene, renderer:
this.renderer }); const globeLayer =
this.view.getLayerById("globe"); const globe = globeLayer.object3d;
this.view.addFrameRequester(MAIN_LOOP_EVENTS.UPDATE_START, () => {
globe.rotation.z = this.globals.getSceneRotation(); });
Fetcher.json("../../../assets/layers/JSONLayers/Ortho.json").then(config =>
this.addColorLayerFromConfig(config));
Fetcher.json("../../../assets/layers/JSONLayers/WORLD_DTM.json").then(config
=> this.addElevationLayerFromConfig(config));
Fetcher.json("../../../assets/layers/JSONLayers/IGN_MNT_HIGHRES.json").then(config
=> this.addElevationLayerFromConfig(config)); }*
I'll note that overwriting the culling function like so
* globeLayer.culling = () => {};*
does resolve my problem, but then I'm losing out on culling altogether. I'd
like it to still do the culling, just have it properly cull despite the
rotating earth.
I think the problem is that *worldToScaledEllipsoid* in iTowns
GlobeLayer.js is not being updated and thus in GlobeLayer.js's *preUpdate *
function the *cameraPosition* variable isn't being set correctly, but
that's just speculation. I don't quite understand how all the parts are
working together yet.
~Terek Campbell
On Tue, Aug 6, 2019 at 1:01 AM Adrien Berthet <Adrien.Berthet at ign.fr> wrote:
> Hello Terek,
>
> Could you share a more independent example ? I'm not sure what is the
> `globe` variable here, that's why it may cause some odd culling.
>
> Thanks
>
> Adrien
> ------------------------------
> *De :* ITowns-user [itowns-user-bounces at lists.osgeo.org] de la part de
> Terek Campbell [terekc at gmail.com]
> *Envoyé :* lundi 5 août 2019 23:35
> *À :* itowns-user at lists.osgeo.org
> *Objet :* [iTowns-user] Unwanted culling when rotating globe
>
> Hey all,
>
> I’m attempting to rotate the globe over time via the following code:
>
> this.view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_CAMERA_UPDATE, ()
> => {
> globe.rotation.z = this.globals.getTotalRotation();
> this.view.notifyChange();
> });
>
> However, I’m seeing odd culling once it starts rotating as in the attached
> screenshot. How can I prevent this?
>
> ~Terek Campbell
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/itowns-user/attachments/20190806/7f758773/attachment.html>
More information about the ITowns-user
mailing list