Re: [osg-users] Geographic earth in OSG?
Hi Shayne and Akilan, I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. That is what I was trying to say, If you do your calculations with an ellipsoid model, but then you try to draw these positions in a ShapeDrawable::Sphere you'll never see the models in their right place. You have to draw on an Ellipsoid, not a Sphere. Depending on where you are putting our model (near the equator or near the poles) the difference could be very large. Cheers. -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
I understand the discrepancy. The real question is why the originator of the thread was using a sphere in the first place and not the ellipsoid to place the models... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jordi Torres Sent: Friday, May 18, 2012 1:41 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Geographic earth in OSG? Hi Shayne and Akilan, I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. That is what I was trying to say, If you do your calculations with an ellipsoid model, but then you try to draw these positions in a ShapeDrawable::Sphere you'll never see the models in their right place. You have to draw on an Ellipsoid, not a Sphere. Depending on where you are putting our model (near the equator or near the poles) the difference could be very large. Cheers. -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
Hi AKilan, The problem could be that an sphere is not an ellipsoid model, is a spherical model. So depending on where you are putting your model de preccision difference could be very large. An ellipsoid model has two radius, equatorial and polar, so defining a sphere with radius polar it's not enough to fit in a ellipsoid model. Could it be? Cheers. 2012/5/16 Akilan Thangamani akilan.thangam...@gmail.com Hi, True. There is no problem with osgearth as it has well wrapped with projection information. I did not face any issue with that. But the samething when tried with OSG alone, i observed some issues. I put the pbm this way, suppose for given latitude and longitude as 11.0 and 77.0 (to be in radians) and to the resultant (x,y,z) of ellipsoid-converLatLonHtToXYZ(..), an object was attached. The object placement is not exactly over that latitude and longitude. It lies totally somewhere else on the globe. I think it is projection issue. Is anybody tried this out??? Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47738#47738 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
When you instance an Ellipsoid object, the default is already an oblate spheroid (WGS84 with polar and equatorial radii defined in meters). I suspect your problem has something to do with your shape drawable where you're using a sphere in your code. For starters, I would suggest that you reference off the ellipsoid directly to position objects on the earth. I have never had any problems mapping geodetic to geocentric coordinates and vice versa when I reference the EllipsoidModel object with its conversion methods (i.e. convertLatLongHeightToXYZ). Entities are placed on the surface of the spheroid correctly as expected (assuming Height is 0.0). -Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47745#47745 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Geographic earth in OSG?
Hi, I created virtual earth as follows, osg::Node* createEarth() { osg::TessellationHints* hints = new osg::TessellationHints; hints-setDetailRatio(5.0f); osg::ShapeDrawable* sd = new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0,0.0,0.0), osg::WGS_84_RADIUS_POLAR), hints); osg::Geode* geode = new osg::Geode; geode-addDrawable(sd); std::string filename = osgDB::findDataFile(Images/land_shallow_topo_2048.jpg); geode-getOrCreateStateSet()-setTextureAttributeAndModes(0, new osg::Texture2D(osgDB::readImageFile(filename))); osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode; csn-setEllipsoidModel(new osg::EllipsoidModel()); csn-addChild(geode); return csn; } But with the above ellipsoidal model I could not locate any geographic location accurately. Means that, not able to locate any position for given latitude and longitude accurately. What should be done more? Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47727#47727 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
osg::EllipsoidModel *ellipsoid = new osg::EllipsoidModel(); ellipsoid-convertLatLongHeightToXYZ(osg::DegreesToRadians(lat), osg::DegreesToRadian(lon), Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47728#47728 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
Also, consider using osgEarth. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geographic earth in OSG?
Hi, True. There is no problem with osgearth as it has well wrapped with projection information. I did not face any issue with that. But the samething when tried with OSG alone, i observed some issues. I put the pbm this way, suppose for given latitude and longitude as 11.0 and 77.0 (to be in radians) and to the resultant (x,y,z) of ellipsoid-converLatLonHtToXYZ(..), an object was attached. The object placement is not exactly over that latitude and longitude. It lies totally somewhere else on the globe. I think it is projection issue. Is anybody tried this out??? Thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=47738#47738 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org