<?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 Re: ModelSceneSymbol in lat lon space in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58370#M180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out the issue to my own problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ModelSceneSymbol uses the centroid of the model, not the center of the models bounding box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would be a good thing to add to the documentation. I kept assuming I had the spatial reference wrong, or my initial data was wrong, or my code was incorrect for calculating the offset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2019 19:17:48 GMT</pubDate>
    <dc:creator>PaulGrenning</dc:creator>
    <dc:date>2019-07-10T19:17:48Z</dc:date>
    <item>
      <title>ModelSceneSymbol in lat lon space</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58369#M179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the ModelSceneSymbol to load collada files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The collada are already projected to a specific lat lon. When I set the spatial reference and load the collada files, they are visualized at an offset. The offset appears to be the center of the models bounding box. This is not helpful since my model was already spatially correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next step I do is calculate&amp;nbsp;that offset manually to attempt to put the model at its original position instead of the bounding box center position. Now the models are close to where they should be but are still off. This is what I cannot figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use the same spatial reference in ArcGIS pro and load the same collada file, everything aligns perfectly. How can I achieve this in the java sdk?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest a better way to load collada files in the java api or explain what the offset actually is?&lt;/P&gt;&lt;P&gt;I will attach some images for a description. The&amp;nbsp;true origin of the collada files is near the southern edge of the roads, this is why the offset moves them so far north.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code that loads a collada file:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;private &lt;/SPAN&gt;Point &lt;SPAN style="color: #ffc66d;"&gt;LoadModel&lt;/SPAN&gt;(String filePath&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;SpatialReference spatialReference&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;GraphicsOverlay graphicsOverlay)
    {
        Parser parser = &lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;Parser()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;ColladaData data = &lt;SPAN style="color: #cc7832;"&gt;null;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        try &lt;/SPAN&gt;{
            data = parser.parseToColladaData(&lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;FileInputStream(&lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;File(filePath)))&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;} &lt;SPAN style="color: #cc7832;"&gt;catch &lt;/SPAN&gt;(IOException e) {
            e.printStackTrace()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;}
        MeshData mesh = (MeshData) data.getGeomertires().get(&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// calculate the model center
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        float&lt;/SPAN&gt;[] center = mesh.getCenter()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// project the model center using the spatial reference
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;Point roadProjectedPosition = &lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;Point(center[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;center[&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;center[&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;spatialReference)&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;ModelSceneSymbol modelSymbol = &lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;ModelSceneSymbol(filePath&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;modelSymbol.setAnchorPosition(AnchorPosition.&lt;SPAN style="color: #9876aa;"&gt;ORIGIN&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;modelSymbol.loadAsync()&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        &lt;/SPAN&gt;modelSymbol.addDoneLoadingListener(() -&amp;gt; {
            &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #b389c5;"&gt;modelSymbol&lt;/SPAN&gt;.getLoadStatus() == LoadStatus.&lt;SPAN style="color: #9876aa;"&gt;LOADED&lt;/SPAN&gt;) {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// use the projected point instead of 0,0,0 for the model position
                Graphic graphic=&lt;SPAN style="color: #cc7832;"&gt;new &lt;/SPAN&gt;Graphic(&lt;SPAN style="color: #b389c5;"&gt;roadProjectedPosition&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #b389c5;"&gt;modelSymbol&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                &lt;/SPAN&gt;&lt;SPAN style="color: #b389c5;"&gt;graphicsOverlay&lt;/SPAN&gt;.getGraphics().add(graphic)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;            &lt;/SPAN&gt;}
        })&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;        return &lt;/SPAN&gt;roadProjectedPosition&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;    &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58369#M179</guid>
      <dc:creator>PaulGrenning</dc:creator>
      <dc:date>2021-12-10T22:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: ModelSceneSymbol in lat lon space</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58370#M180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out the issue to my own problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ModelSceneSymbol uses the centroid of the model, not the center of the models bounding box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would be a good thing to add to the documentation. I kept assuming I had the spatial reference wrong, or my initial data was wrong, or my code was incorrect for calculating the offset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 19:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58370#M180</guid>
      <dc:creator>PaulGrenning</dc:creator>
      <dc:date>2019-07-10T19:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: ModelSceneSymbol in lat lon space</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58371#M181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback. We will extent our doc to make it clearer as to how a&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;ModelSceneSymbol is placed in the scene.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Gunther&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 09:00:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/modelscenesymbol-in-lat-lon-space/m-p/58371#M181</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2019-07-11T09:00:57Z</dc:date>
    </item>
  </channel>
</rss>

