<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I want to put an arc on the ground (3D map) and let it rotate slowly, how can I do it? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1271688#M80667</link>
    <description>&lt;P&gt;I wana&amp;nbsp;put an arc graphic on the ground (3D map) and let it rotate slowly, how can I do it?&lt;/P&gt;&lt;P&gt;I'm using argis js 4.19,I want a smooth aninams ,so I cannot delete layer and add layer. this would let screen blink! could u help me?&lt;/P&gt;</description>
    <pubDate>Sun, 26 Mar 2023 02:20:37 GMT</pubDate>
    <dc:creator>tangms</dc:creator>
    <dc:date>2023-03-26T02:20:37Z</dc:date>
    <item>
      <title>I want to put an arc on the ground (3D map) and let it rotate slowly, how can I do it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1271688#M80667</link>
      <description>&lt;P&gt;I wana&amp;nbsp;put an arc graphic on the ground (3D map) and let it rotate slowly, how can I do it?&lt;/P&gt;&lt;P&gt;I'm using argis js 4.19,I want a smooth aninams ,so I cannot delete layer and add layer. this would let screen blink! could u help me?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 02:20:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1271688#M80667</guid>
      <dc:creator>tangms</dc:creator>
      <dc:date>2023-03-26T02:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: I want to put an arc on the ground (3D map) and let it rotate slowly, how can I do it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1273898#M80706</link>
      <description>&lt;P&gt;It's not really built for animation in that sense but you can effectively create what your after by creating&amp;nbsp; a graphic and then creating your own animation frameHandler by using something like a setInterval() that regular updates the geometry of that graphic.&lt;BR /&gt;&lt;BR /&gt;A really quick rough example that I modified from the code sample looks like:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;title&amp;gt;
      Add Graphics to a SceneView | Sample | ArcGIS Maps SDK for JavaScript 4.26
    &amp;lt;/title&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.26/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.26/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script&amp;gt;
      require([
        "esri/Map",
        "esri/views/SceneView",
        "esri/layers/GraphicsLayer",
        "esri/Graphic",
        "esri/geometry/geometryEngine"
      ], (Map, SceneView, GraphicsLayer, Graphic, geometryEngine) =&amp;gt; {
        const map = new Map({
          basemap: "hybrid"
        });

        const view = new SceneView({
          container: "viewDiv",
          map: map,

          camera: {
            // autocasts as new Camera()
            position: {
              // autocasts as new Point()
              x: -0.17746710975334712,
              y: 51.44543992422466,
              z: 1266.7049653716385
            },
            heading: 0.34445102566290225,
            tilt: 82.95536300536367
          }
        });

        /*********************
         * Add graphics layer
         *********************/

        const graphicsLayer = new GraphicsLayer();
        map.add(graphicsLayer);

        /*************************
         * Add a 3D point graphic
         *************************/

        // London
        const point = {
          type: "point", // autocasts as new Point()
          x: -0.178,
          y: 51.48791,
          z: 1010
        };

        const markerSymbol = {
          type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
          color: [226, 119, 40],
          outline: {
            // autocasts as new SimpleLineSymbol()
            color: [255, 255, 255],
            width: 2
          }
        };

        const pointGraphic = new Graphic({
          geometry: point,
          symbol: markerSymbol
        });

        graphicsLayer.add(pointGraphic);

        /****************************
         * Add a 3D polyline graphic
         ****************************/

        const polyline = {
          type: "polyline", // autocasts as new Polyline()
          paths: [
            [-0.178, 51.48791, 0],
            [-0.178, 51.48791, 1000]
          ]
        };

        const lineSymbol = {
          type: "simple-line", // autocasts as SimpleLineSymbol()
          color: [226, 119, 40],
          width: 4
        };

        const polylineGraphic = new Graphic({
          geometry: polyline,
          symbol: lineSymbol
        });

        graphicsLayer.add(polylineGraphic);

        /***************************
         * Add a 3D polygon graphic
         ***************************/

        const polygon = {
          type: "polygon", // autocasts as new Polygon()
          rings: [
            [-0.184, 51.48391, 400],
            [-0.184, 51.49091, 500],
            [-0.172, 51.49091, 500],
            [-0.172, 51.48391, 400],
            [-0.184, 51.48391, 400]
          ]
        };

        const fillSymbol = {
          type: "simple-fill", // autocasts as new SimpleFillSymbol()
          color: [227, 139, 79, 0.8],
          outline: {
            // autocasts as new SimpleLineSymbol()
            color: [255, 255, 255],
            width: 2
          }
        };

        const polygonGraphic = new Graphic({
          attributes: {
            title: "square"
          },
          geometry: polygon,
          symbol: fillSymbol
        });

        graphicsLayer.add(polygonGraphic);
        
        view.when(() =&amp;gt; {
          
          let timerControl = setInterval(() =&amp;gt; {
            const toRotate = graphicsLayer.graphics.items.find(graphic =&amp;gt; graphic.attributes?.title === 'square')
                const rotatedGeometry = geometryEngine.rotate(toRotate.geometry, 2)
                toRotate.geometry = rotatedGeometry;
          }, 100);
        })
        
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The key part being this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; let timerControl = setInterval(() =&amp;gt; {
   const toRotate = graphicsLayer.graphics.items.find(graphic =&amp;gt; graphic.attributes?.title === 'square')
   const rotatedGeometry = geometryEngine.rotate(toRotate.geometry, 2)
                toRotate.geometry = rotatedGeometry;
          }, 100);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where I'm running a function every 100ms that calls geometryEngine to rotate a geometry by 2 degrees.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 21:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1273898#M80706</guid>
      <dc:creator>JamesIng</dc:creator>
      <dc:date>2023-03-30T21:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: I want to put an arc on the ground (3D map) and let it rotate slowly, how can I do it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1274473#M80717</link>
      <description>&lt;P&gt;that's work&amp;nbsp; for me,thank u!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 02:07:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-want-to-put-an-arc-on-the-ground-3d-map-and-let/m-p/1274473#M80717</guid>
      <dc:creator>tangms</dc:creator>
      <dc:date>2023-04-03T02:07:50Z</dc:date>
    </item>
  </channel>
</rss>

