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 <[email protected]> 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 <[email protected]> >> >> Hi Oliver, >> >> On 13 March 2013 07:54, Olivier Tournaire <[email protected]> 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 >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

