Thank you Robert. I will give that a try. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Monday, June 05, 2006 2:44 PM To: osg users Subject: Re: [osg-users] Vertex Array Precision
Hi Andrew, OpenGL and the OSG store vertices as floats so you won't be able to achieve much going this route. The way I tackle such issues is create a subgraph with local origin then use a MatrixTransform to position that data into the earth centered earth fixed coordinate system. Since the OSG accumulates matrices as doubles by default it maintains the precsions as long as possible. Robert. On 6/5/06, Andrew Weitz <[EMAIL PROTECTED]> wrote: > Hi, > > I have a bunch of models in a proprietary format that I'm converting to > OSG format. The models are simple meshes that consist of vertices, > triangles, and texture coordinates. They are all geo-referenced and use > the UTM/WGS84 coordinate system. > > Recently, I have converted all the models to the Lat/Long coordinate > system. To represent the models' vertices accurately in space, I need > to retain 9 digits of precision after each vertex coordinate's decimal > place. The problem I'm having is that when I write the models to OSG > format, it's only saving between 2 and 5 decimal places. > > To generate my vertex arrays, I simply create an osg::Vec3Array. Then I > call push_back(osg::Vec3d(x, y, z)) for every coordinate, where x, y, > and z are double precision. When I'm done populating the array, I add > it to my geometry node via setVertexArray(). Then I add my triangle > indices and texture coordinates. Last, I write out the file using > osgDB::writeNodeFile(). > > When viewing the file in osgviewer, it does not look correct at all. I > discovered this is because the number of decimal places in the vertex > coordinates is being truncated. I was hoping someone could tell me how > to output all 9 decimal places in the OSG file. Will this same solution > work for an IVE file? > > Thank you! > > Andrew > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
