<div dir="ltr">So what I have done in reading a point cloud from a .ply file with point coordinate in WGS84 (Lat-Long-Height), is that I iterate over each vertex and convert the coordinates into ECEF format given the functions from osgEarth:<div><br></div><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre class="code highlight" lang="cpp"><span id="LC53" class="line" lang="cpp"><span class="k"><span style="color: #008;" class="styled-by-prettify">for</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(</span></span><span class="n"><span style="color: #008;" class="styled-by-prettify">uint</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">elementIdx</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify">=</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="mi"><span style="color: #066;" class="styled-by-prettify">0</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">;</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">elementIdx</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify"><</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">vertArray</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">-></span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">getNumElements</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">();</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify">++</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">elementIdx</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">)</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC54" class="line" lang="cpp"><span class="p"><span style="color: #660;" class="styled-by-prettify">{</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC59" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="c1"><span style="color: #800;" class="styled-by-prettify">//--- read current vertex from array</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span></pre></div></code></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre class="code highlight" lang="cpp"><span id="LC60" class="line" lang="cpp"><span class="n"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">Vec3d</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">llhVert</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify">=</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="k"><span style="color: #008;" class="styled-by-prettify">static_cast</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify"><</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">Vec3</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">></span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">((</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">*</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">vertArray</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">)[</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">elementIdx</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">]);</span></span></span></pre></div></code></div></div></blockquote><div><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><pre class="code highlight" lang="cpp"><span id="LC61" class="line" lang="cpp"></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC62" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="c1"><span style="color: #800;" class="styled-by-prettify">//--- initialize geopoint</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC63" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="n"><span style="color: #000;" class="styled-by-prettify">osgEarth</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">GeoPoint</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">geoPoint</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">;</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC69" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="n"><span style="color: #000;" class="styled-by-prettify">geoPoint</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify">=</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">osgEarth</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">GeoPoint</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">osgEarth</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">SpatialReference</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #008;" class="styled-by-prettify">get</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(</span></span><span class="s"><span style="color: #080;" class="styled-by-prettify">"epsg:4326"</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">,</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="s"><span style="color: #080;" class="styled-by-prettify">"egm96"</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">),</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC70" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">                                    </span><span class="n"><span style="color: #000;" class="styled-by-prettify">llhVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">.</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">x</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(),</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">llhVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">.</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">y</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(),</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">llhVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">.</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">z</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(),</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC71" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">                                    </span><span class="n"><span style="color: #000;" class="styled-by-prettify">osgEarth</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">ALTMODE_ABSOLUTE</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">);</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC72" class="line" lang="cpp"></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC73" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="c1"><span style="color: #800;" class="styled-by-prettify">//--- convert geopoint into ecef point</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC74" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="n"><span style="color: #000;" class="styled-by-prettify">osg</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">::</span></span><span class="n"><span style="color: #606;" class="styled-by-prettify">Vec3d</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">ecefVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">;</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC75" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="n"><span style="color: #000;" class="styled-by-prettify">geoPoint</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">.</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">toWorld</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">(</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">ecefVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">);</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC78" class="line" lang="cpp"></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC79" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="c1"><span style="color: #800;" class="styled-by-prettify">//--- save vertex</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span><span id="LC80" class="line" lang="cpp"><span style="color: #000;" class="styled-by-prettify">      </span><span class="p"><span style="color: #660;" class="styled-by-prettify">(</span></span><span class="o"><span style="color: #660;" class="styled-by-prettify">*</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">vertArray</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">)[</span></span><span class="n"><span style="color: #000;" class="styled-by-prettify">elementIdx</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">]</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="o"><span style="color: #660;" class="styled-by-prettify">=</span></span><span style="color: #000;" class="styled-by-prettify"> </span><span class="n"><span style="color: #000;" class="styled-by-prettify">ecefVert</span></span><span class="p"><span style="color: #660;" class="styled-by-prettify">;</span></span></span><span style="color: #000;" class="styled-by-prettify"><br><br></span><span id="LC83" class="line" lang="cpp"><span class="p"><span style="color: #660;" class="styled-by-prettify">}</span></span></span><span style="color: #000;" class="styled-by-prettify"><br></span></pre></div></code></div><br><br><br>Am Mittwoch, 29. April 2020 05:49:35 UTC+2 schrieb wu:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Can you provide some ideas? I am a novice for osgearth. I use readNodeFile fnction to read obj  file and display (wgs84), then use writeNodeFile to write obj file then display in cesiumlab.<br><br>On Tuesday, April 28, 2020 at 7:02:27 PM UTC+8, Boitumelo Ruf wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, but internally it will transform the wgs84 coordinates to ECEF in order to place them inside the eucledian coordinate system of osg. Look at: <a href="http://forum.osgearth.org/LIDAR-data-visualization-td7592224.html" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fforum.osgearth.org%2FLIDAR-data-visualization-td7592224.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1ytJIzBpmIer4yu52tEEuifzRfA';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fforum.osgearth.org%2FLIDAR-data-visualization-td7592224.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1ytJIzBpmIer4yu52tEEuifzRfA';return true;">http://forum.osgearth.org/<wbr>LIDAR-data-visualization-<wbr>td7592224.html</a><div><br>Am Dienstag, 28. April 2020 12:29:01 UTC+2 schrieb wu:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">my osgearth coordinate system use the wgs84 not ECEF<br><br>On Tuesday, April 28, 2020 at 5:12:29 PM UTC+8, Boitumelo Ruf wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Have you checked the osgEarth forum: <a href="http://forum.osgearth.org/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fforum.osgearth.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHy8ygf2_0PLeorsVqcDL9DzKpnPA';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fforum.osgearth.org%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHy8ygf2_0PLeorsVqcDL9DzKpnPA';return true;">http://forum.osgearth.<wbr>org/</a><div><br></div><div>osgEarth uses an Earth-Centered-Earth-Fixed (ECEF) eucledian coordinate system. Maybe you would need to transform the coordinates inside your .obj file first.<br><br>Am Dienstag, 28. April 2020 11:03:38 UTC+2 schrieb wu:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">obj file coordinate is different from what osgearth display!<br><div>i use osgearth  display my pipe (wgs84)</div><div>pipe display correct,but  obj Exported is Incorrect。I checked some information but found no reason!</div><div><br></div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div></blockquote></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/f89a9df4-79d4-4124-a0db-191667bd4251%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/f89a9df4-79d4-4124-a0db-191667bd4251%40googlegroups.com</a>.<br />