Re: [osg-users] Geocentric terrain and camera positioning

116 views
Skip to first unread message

Zeki Yugnak

unread,
Jan 24, 2013, 8:37:47 AM1/24/13
to osg-...@lists.openscenegraph.org
Hi everyone,

I just begun to develop similar flight simulation record player with openscenegraph. I have some questions regarding to terrain, object and camera positioning.

I build flat terrain with osgdem from dted and geotiff texture data as "*.ive" file. I checked result with simple demo application and I saw the terrain without any problem.

Here are difficulties that I have encountered;

I am using recorded positions for whole simulation objects as lat, log and alt. I can successfully display, animate and track flight with orbit camera man. using recorded data. But I could not position flight on terrain :(. Also I could not positioning camera on terrain center or real real world coordinate.

- How can I position camera on terrain center or some special real world coordinate?

- How can I position and simulate flight on terrain?

- I could not display terrain with OsgEarth but is Osgearth good idea for these difficulties ?

Thanks for any help.
Regards.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52081#52081





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Robert Osfield

unread,
Feb 6, 2013, 4:31:07 AM2/6/13
to osg-...@lists.openscenegraph.org
HI Zeki,

I've just seen that you've made three similar posts with no answers to
any of them yet. It's generally best to be patient and stick to one
thread per topic rather than splurt it out ever where. If it's a new
topic it's also best to start a new thread.

As for the problems you have right now it's hard to know where to
start as it's hard to know what you actually understand about scene
graphs, OSG particularly, and what you've done so far. The best we
can do at this stage is provide general answers.

First up, what it sounds like you are trying to achieve is done by OSG
users all the time, terrain visualization it's very much one of the
OSG core areas of usage. The OSG is capable it's just a matter of
learning how to use it. Rather than diving in at the deep end and
trying to develop your application right away it may be best to start
learning about the various bits of software from a more ground up
approach. Getting one of the OSG books would probably be a good
starting place.

For you particular needs I think you'll need to deal with what
coordinate system you want to work in, this will mean converting your
path data into the scene graphs coordinate system, or creating the
scene graph in the path data's coordinate system, or converting back
and forth. The later might be best if you are dealing with whole
earth databases as the scene graph will be in Earth Center Earth
Fixed.

Robert.

Zeki Yugnak

unread,
Feb 6, 2013, 5:08:14 AM2/6/13
to osg-...@lists.openscenegraph.org
Thank you Robert.

My earlier messages sent at different times in the last weeks and I solved most of them at time period. Also, moderator has just approved all my messages :).

In the current situation, I am facing coordinate system problem. I am using geocentric terrain and geocentric coordinate system in order to show vehicle on the correct coordinates in the debriefing application. All geographic (lat, long and alt ) coordinates recorded on vehicle.

I have no problem on terrain displaying but the transformation is not smooth because of higher value of the coordinates. World coordinates which are obtained by "computeLocalToWorldTransformFromLatLongHeight" are very high values. I try to convert recorded object coordinates according to a origin point and transform terrain to this origin. But terrain and object is not correlated.

- How can I use middle coordinate system for object and terrain transformations?

Thank you!
Regards.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52409#52409

Robert Osfield

unread,
Feb 6, 2013, 5:44:36 AM2/6/13
to osg-...@lists.openscenegraph.org
Hi Zeki,

On 6 February 2013 10:08, Zeki Yugnak <zeki....@gmail.com> wrote:
> I have no problem on terrain displaying but the transformation is not smooth because of higher value of the coordinates. World coordinates which are obtained by "computeLocalToWorldTransformFromLatLongHeight" are very high values. I try to convert recorded object coordinates according to a origin point and transform terrain to this origin. But terrain and object is not correlated.

It's very hard to know what you mean and thus what to recommend.

What do you mean the "transformation is not smooth because of height
value of coordinates?"

Could it be that you have float precision problems? The OSG by
default uses double for all camera and all internal scene graph
transform nodes to avoid jitter problems caused by float.

> - How can I use middle coordinate system for object and terrain transformations?

Again, don't know what you mean by "middle coordinate system".

For geocentric terrain databases VirtualPlanetBuilder and osgEarth
both arrange the tiles such that they have a local origin and are in
the units of meters, and place these tiles under MatrixTransform that
place them in ECEF (Earth Center Earth Fixed). The
CoorindateSystemNode/Terrain(which subclasses from
CoordinateSystemNode) nodes are used to decorate terrain subgraphs and
provide a EllipsoidModel object that can convert from ECEF to
lats/long/height.

Does this make sense?
Robert.

Zeki Yugnak

unread,
Feb 6, 2013, 6:56:47 AM2/6/13
to osg-...@lists.openscenegraph.org
Hi Robert, thanks for your help.


> It's very hard to know what you mean and thus what to recommend.
>
> What do you mean the "transformation is not smooth because of height
> value of coordinates?"
>
> Could it be that you have float precision problems? The OSG by
> default uses double for all camera and all internal scene graph
> transform nodes to avoid jitter problems caused by float.
>
> Again, don't know what you mean by "middle coordinate system".
>

I am using double precision. X,y,z coordinates are over million in ECEF coordinate system after converting from lats/long/height. I supposed that graphic card is giving rounding off error and there is flickering on object motion in OSG.

So I want to use different coordinate system that is between world and local coordinate system. I am calculating all recorded object coordinates according to origin point and the origin point is the center of the terrain in geographic coordinate system (lats/long/height). I am using Delta3D's GeoCoordinate class for calculation. class reference link is below;

http://www.delta3d.org/api/api_2.0/classdt_terrain_1_1_geo_coordinates.html

I need to use different coordinate system that is between world and local coordinate systems for smooth motion displaying (without flickering). I hope that my problem is clear now.

Regards.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52413#52413

Robert Osfield

unread,
Feb 6, 2013, 7:04:48 AM2/6/13
to osg-...@lists.openscenegraph.org
HI Zeki,

On 6 February 2013 11:56, Zeki Yugnak <zeki....@gmail.com> wrote:
> I am using double precision. X,y,z coordinates are over million in ECEF coordinate system after converting from lats/long/height. I supposed that graphic card is giving rounding off error and there is flickering on object motion in OSG.

If the database is created correctly and the camera position is
computed correctly your shouldn't see visible jitter. Have a look
through the achives on this topic we've written about it many times.
I touched on it my previous reply, but you do need to go and do the
back research to understand the topic.


> So I want to use different coordinate system that is between world and local coordinate system. I am calculating all recorded object coordinates according to origin point and the origin point is the center of the terrain in geographic coordinate system (lats/long/height). I am using Delta3D's GeoCoordinate class for calculation. class reference link is below;
>
> http://www.delta3d.org/api/api_2.0/classdt_terrain_1_1_geo_coordinates.html
>
> I need to use different coordinate system that is between world and local coordinate systems for smooth motion displaying (without flickering). I hope that my problem is clear now.

I don't know Delta3D personally, if you are using Delta3D classes then
it's best to ask the question with the Delta3D community.

Robert.

Zeki Yugnak

unread,
Feb 6, 2013, 7:35:43 AM2/6/13
to osg-...@lists.openscenegraph.org
:) I think you misunderstood me. I have been searching all forum.

The terrain (is not whole earth) database was created correctly using osgdem with Terrain and geocentric parameters. Also camera position is computed correctly and I can easily track may object using orbit manipulator. But, If I use object transformation in ECEF coordinate system, My object does not move smoothly. It moves up and down little bit.

If I use local coordinates that are converted from lats/long/height according to an origin point, object moves correctly.

Also I am not using delta3d directly and the problem is not related to GeoCoordinate.

If I transform terrain or root scene to this origin point, how can I calculate object transformation without terrain-object correlation problem ?

Regards.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52417#52417
Reply all
Reply to author
Forward
0 new messages