Re: [osg-users] Exporting HeightFields in OSG
Hi Martin, these are just hints. Have a look at /** Accept a PrimitiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.*/ virtual void accept(PrimitiveFunctor pf) const; in ShapeDrawable Maybe there is a way to traverse all the primitives, and then create Geometry from it and export the created Geometries instead of the whole HeightFiled. Just a hint that might help Nick On Sun, Apr 28, 2013 at 9:56 PM, Martin Záleta zal...@atlas.sk wrote: Hi, Sadly, exporting a HeightField geometry into .flt likewise produces just an almost empty file. I kinda suppose it's because the geometry in HeightFields isn't represented by polygonal meshes, so OSG can't really do anything to export this data straight away other that maybe except save those values into an image file like a heightmap. Still, it's just a guess though, so if there's any other way, just let me know. Thanks anyway! Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53853#53853 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] generate texture with multiple image files
Hi, I have an elevation model and multiple image files (jpeg format). The four vertex coordinates of each image file are recorded in a text file. So, I wonder how can I put all these image files on he surface of elevation model with their vertex coordinates. Now, I can put only one image file on the elevation model. I have followed some instructions from website, but they din't work. Thanks for any suggestion. Cheers, tianyun___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] geographical coordination conversion
Hi, I use osgdem to create an IVE model with mercator projection and can load the model in my OSG program. I want to realize such funciton: (1) input the WGS84 coordinate (lon, lat) of target point (2) calculate the elevation (z) of the point from the terrain file (3) draw a graphic object at the point (lon, lat, z) The problem is how to convert the WGS84 coordinate of inputted point to mercator projection which is used in my OSG program. I have used the folllowing method: osg::ref_ptrosg::CoordinateSystemNode csn=new osg::CoordinateSystemNode; csn-setEllipsoidModel(new osg::EllipsoidModel); csn-addChild(terrain);//terrain is IVE model with mercator projection double o,p,q; csn-getEllipsoidModel()-convertLatLongHeightToXYZ(osg::DegreesToRadians(80.0),osg::DegreesToRadians(115.0),osg::DegreesToRadians(0.0),o,p,q); The convert value (o,p,q) is not correct. How can I realize the function? Thank you! Cheers, tianyun___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] geographical coordination conversion
The code snippet you provided maps from a geodetic coordinate system to a geocentric ECEF cartesian coordinate system so that the point (lat,lon,0) maps to the cartesian point (o,p,q) which lies on the surface of the ellipsoid. This probably isn't what you're looking for since it sounds like you've built your database to cater to a cylindrical map projection. Also in the method convertLatLongHeightToXYZ(), height is given in meters, not degrees... Shayne -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53860#53860 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Graphics Handler
Hi, Getting error while declaring the following : Code: osgViewer::GraphicsHandleX11 *linuxContext = NULL; osgViewer::GraphicsHandleWin32 *windowsContext = NULL; if( ctxID != -1 ) { // Find context with ctxID and make it current. for( unsigned int c=0; cctxs.size(); ++c ) { if( ctxs[c]-getState()-getContextID() == ctxID ) { ctx = ctxs[c]; } } } else { ctx = ctxs.front(); } if( NULL == ctx ) { osg::notify(osg::FATAL) __FUNCTION__ : cannot find valid OpenGL context.std::endl; return false; } //platform dependent casting #ifdef WIN32 windowsContext = dynamic_castGraphicsHandleWin32*(ctx); if(NULL == windowsContext) { osg::notify(osg::FATAL) Win32 Graphics Context Casting is unsuccessful std::endl; return false; } #else linuxContext = dynamic_castGraphicsHandleX11*(ctx); if(NULL == linuxContext) { osg::notify(osg::FATAL) X11 Graphics Context Casting is unsuccessful std::endl; return false; } #endif //by now the graphics context is found //and the platform id is also found cl_context_properties contextProperties[] = { #ifdef WIN32 CL_GL_CONTEXT_KHR, (cl_context_properties) windowsContext-getWGLContext(), CL_WGL_HDC_KHR, (cl_context_properties) windowsContext-getHDC(), #else CL_GL_CONTEXT_KHR, (cl_context_properties) linuxContext-getGLXContext(), CL_GLX_DISPLAY_KHR, (intptr_t) linuxContext-getDisplay(), #endif CL_CONTEXT_PLATFORM, (cl_context_properties) m_clPlatform, 0 }; the error is : Code: /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:87:7: error: ‘GraphicsHandleWin32’ is not a member of ‘osgViewer’ /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:87:39: error: ‘windowsContext’ was not declared in this scope /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35: error: expected type-specifier before ‘GraphicsHandleX11’ /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35: error: expected ‘’ before ‘GraphicsHandleX11’ /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35: error: expected ‘(’ before ‘GraphicsHandleX11’ /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35: error: ‘GraphicsHandleX11’ was not declared in this scope /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35: note: suggested alternative: /usr/local/include/osgViewer/api/X11/GraphicsHandleX11:44:24: note: ‘osgViewer::GraphicsHandleX11’ /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:53: error: expected primary-expression before ‘’ token /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:59: error: expected ‘)’ before ‘;’ token /home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:141:60: error: ‘class osgViewer::GraphicsHandleX11’ has no member named ‘getGLXContext’ make[2]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o] Error 1 make[1]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/all] Error 2 What should be the file inclusion to get it right? I have included as follows: Code: #include osg/Notify #ifdef WIN32 #include osgViewer/api/Win32/GraphicsHandleWin32 #else #include osgViewer/api/X11/GraphicsHandleX11 #endif Any idea ? Cheers, Sajjadul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53861#53861 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgSim::LighPoint radius
Nick, A shader would allow you to change most of those. -B From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Sunday, April 28, 2013 7:48 AM To: OpenSceneGraph Users Subject: [osg-users] osgSim::LighPoint radius Hi Community, I have faced a problem with the _radius from LighPoint. The showcase is to control all of the LightPoint attributes in run tim (dynamiclly change intensity, color ...these work just fine). However the radius can be changed on LightPoint re-creation,only and its can not be changed in run-time. Some hints? Thanks a bunch. Nick -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org