<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Helvetica;color: #000000;font-size: 10pt;">
<div>Thanks !</div>
<div><br>
</div>
<div>So what you got wrong is that you are moving the globe, when you should be<b> moving the camera</b>.</div>
<div><br>
</div>
<div>Here's a quick thing you can do for example, using the controls <font face="Courier New">
lookAtCoordinate</font> method:</div>
<blockquote>
<div><font face="Courier New">let target = view.controls.getLookAtCoordinate();<br>
setInterval(() => {<br>
    target.x = (target.x + 180+ 0.5) % 360 - 180;<br>
    globe.controls.lookAtCoordinate({ coord: target }, false);<br>
    globe.notifyChange();<br>
}, 100);</font><br>
</div>
</blockquote>
<div>More information here <a href="http://www.itowns-project.org/itowns/docs/#api/Controls/GlobeControls" target="_blank">
http://www.itowns-project.org/itowns/docs/#api/Controls/GlobeControls</a> and here
<a href="http://www.itowns-project.org/itowns/docs/#api/Controls/CameraUtils" target="_blank">
http://www.itowns-project.org/itowns/docs/#api/Controls/CameraUtils</a> <br>
</div>
<div><br>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF192027" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>De :</b> Terek Campbell [terekc@gmail.com]<br>
<b>Envoyé :</b> mercredi 7 août 2019 01:07<br>
<b>À :</b> Adrien Berthet<br>
<b>Cc :</b> itowns-user@lists.osgeo.org<br>
<b>Objet :</b> Re: [iTowns-user] Unwanted culling when rotating globe<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>Here's a bit larger snippet with most of my iTowns related code:</div>
<div><br>
</div>
<i>  private initGlobeView(sceneDiv) {<br>
    const position = new Coordinates("WGS84", 2.351323, 48.856712, 25e6);<br>
<br>
    this.view = new GlobeView(sceneDiv, position, {<br>
      scene3D: this.scene,<br>
      renderer: this.renderer<br>
    });<br>
<br>
    const globeLayer = this.view.getLayerById("globe");<br>
    const globe = globeLayer.object3d;<br>
<br>
    this.view.addFrameRequester(MAIN_LOOP_EVENTS.UPDATE_START, () => {<br>
      globe.rotation.z = this.globals.getSceneRotation();<br>
    });<br>
<br>
    Fetcher.json("../../../assets/layers/JSONLayers/Ortho.json").then(config => this.addColorLayerFromConfig(config));<br>
    Fetcher.json("../../../assets/layers/JSONLayers/WORLD_DTM.json").then(config => this.addElevationLayerFromConfig(config));<br>
    Fetcher.json("../../../assets/layers/JSONLayers/IGN_MNT_HIGHRES.json").then(config => this.addElevationLayerFromConfig(config));<br>
  }<br>
<br>
</i>
<div>
<div dir="ltr" class="gmail_signature">
<div>I'll note that overwriting the culling function like so</div>
<div><i>    globeLayer.culling = () => {};</i><br>
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.</div>
<div><br>
</div>
<div>I think the problem is that <i>worldToScaledEllipsoid</i> in iTowns GlobeLayer.js is not being updated and thus in GlobeLayer.js's <i>preUpdate
</i>function<i> </i>the <i>cameraPosition</i> variable isn't being set correctly, but that's just speculation. I don't quite understand how all the parts are working together yet.</div>
<div><br>
</div>
<div> </div>
<div>~Terek Campbell</div>
</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Aug 6, 2019 at 1:01 AM Adrien Berthet <<a href="mailto:Adrien.Berthet@ign.fr" target="_blank" rel="noopener noreferrer">Adrien.Berthet@ign.fr</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Helvetica; color:rgb(0,0,0); font-size:10pt">
<div>Hello Terek,</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>Adrien<br>
</div>
<div style="font-family:"Times New Roman"; color:rgb(0,0,0); font-size:16px">
<hr>
<div id="gmail-m_3882398577283642884divRpF912141" style="direction:ltr"><font size="2" face="Tahoma" color="#000000"><b>De :</b> ITowns-user [<a href="mailto:itowns-user-bounces@lists.osgeo.org" target="_blank" rel="noopener noreferrer">itowns-user-bounces@lists.osgeo.org</a>]
 de la part de Terek Campbell [<a href="mailto:terekc@gmail.com" target="_blank" rel="noopener noreferrer">terekc@gmail.com</a>]<br>
<b>Envoyé :</b> lundi 5 août 2019 23:35<br>
<b>À :</b> <a href="mailto:itowns-user@lists.osgeo.org" target="_blank" rel="noopener noreferrer">
itowns-user@lists.osgeo.org</a><br>
<b>Objet :</b> [iTowns-user] Unwanted culling when rotating globe<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hey all, <br>
<br>
I’m attempting to rotate the globe over time via the following code:<br>
<br>
    this.view.addFrameRequester(MAIN_LOOP_EVENTS.BEFORE_CAMERA_UPDATE, () => {<br>
      globe.rotation.z = this.globals.getTotalRotation();<br>
      this.view.notifyChange();<br>
    });<br>
<br>
However, I’m seeing odd culling once it starts rotating as in the attached screenshot. How can I prevent this?<br clear="all">
<div>
<div dir="ltr" class="gmail-m_3882398577283642884gmail_signature">
<div> </div>
<div>~Terek Campbell</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>