Hi Robert,

Thank you for your reply.

Regarding the precision issue, I take care to do all computation in double
(which works because original coordinates are in local reference frame),
and, once transformed, I can safely use float without loss of precision.

As VPB and osgEarth, the MatrixTransform is below the PagedLOD and directly
above the Geode as you suggested.

However, having a detailed look at the original data, I saw that (A
PagedLOD has always a single Geode with a single Drawable):
* PagedLOD center/radius is not the same as the Geode bound center/radius

In the current version of my code, I set the PagedLOD center as the new
center computed from the coordinate transform, and set its radius according
to the Geode bound radius after conversion. I tried, to update the PagedLOD
raidus keeping the initial ratio, but the problem is still there.
However, this might also be related to the PagedLOD center. Do you have any
idea on how to update its value, taking into account the new and old Geode
centers, the old PagedLOD center?

Regards,

Olivier

2013/3/13 Robert Osfield <robert.osfi...@gmail.com>

> Hi Olivier,
>
> I principle what you are doing sounds reasonable.  The only odd bit in
> the description is that your data is already in OSG form before you
> transform it into local coords, to me this seems like a missed
> opportunity - as osg::Geometry stores coords with Vec3Array by default
> so will be using float positions so open to precision issues,
> subsequently moving these vertices into local coords won't fix the
> precision problem as it's already backed into the data.  Tools like
> VirtualPlanetBuilder and osgEarth all convert from
> geographic/geocentric coords that use doubles for position to local
> coords with floats for the vertex data and doubles in the
> MatrixTransform that decorate the local coordinate frames.
>
> The problems with missing tiles/wrong tiles suggests to be an issue
> with LOD range or centers.   I guess it could also be something like
> placing the transforms in the wrong place so that the LOD
> centers/ranges aren't in the coordinate frame you think they are in.
> Both VirtualPlanetBuilder and osgEarth place the MatrixTransform below
> the PagedLOD and directly above the geometry.
>
> Robert.
>
> On 13 March 2013 11:54, Olivier Tournaire <olit...@gmail.com> wrote:
> > Hi Robert,
> >
> > So, I will try to summarize my post, without any code :) With my first
> post,
> > I tried to be as complete as possible to clearly describe the issue, with
> > all the related code. Sorry for this.
> >
> > Thus, I am trying to convert geometry coordinates of Drawables contained
> in
> > Geodes. My Geodes are children of PagedLOD, and there is a single Geode
> per
> > PagedLOD. For a given part of my terrain, I have more than 1000 files,
> with
> > 9 levels of details.
> >
> > To convert the coordinates, I simply parse the coordinates in my original
> > geometries, apply the transformation (code of my own and with proj4) and
> > then use the setVertexArray method to replace the geometry coordinates
> in my
> > drawables. I do this for each file. I center the coordinates around
> (0,0,0)
> > because they are in 10e+06, and then add on top of my Geodes a
> translation
> > MatrixTransform which value come from the barycenter of the points. If my
> > Geode is contained in a PagedLOD, I also set the UserCenter to this
> value.
> >
> > The problem is that when I view the transformed hierarchy in osgviewer,
> > sometimes, when I am really close from the terrain, some tiles
> disappear. If
> > I move a few, they appear again. It also seems that the "order" of the
> > loaded tiles is incorrect. Both problems are illustrated by this images:
> > http://imageshack.us/photo/my-images/109/badtiles.png/
> > http://imageshack.us/photo/my-images/685/pagedlodsranges.jpg/
> >
> >
> >
> > Hope you could help.
> >
> > Best regards,
> >
> > Olivier
> >
> > 2013/3/13 Robert Osfield <robert.osfi...@gmail.com>
> >>
> >> Hi Oliver,
> >>
> >> On 13 March 2013 07:54, Olivier Tournaire <olit...@gmail.com> wrote:
> >> > No one on this?
> >>
> >> I suspect you lost a lot of readers with the volume of your post,
> >> please remember that all members of the community are busy working and
> >> only have a little time to read and keep up with posts and write
> >> replies.  Try distilling the issue you have down to what others might
> >> be able to easily understand and provide an answer for.
> >>
> >> Robert.
> >> _______________________________________________
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to