[osg-users] CAD style rotation
hello, I am after an osgManipulator with CAD style rotation. In a typical CAD program the rotation keeps the roll fixed and orbits around the centre of the screen. In contrast the TrackballManipulator allows the roll to change and rotates around the origin. Has anyone come across code that implements this type of rotation? thanks, Richard ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dynamic Modification..
OK Paul..thanks a lot -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10592#10592 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Ogre3D Ocean Demo
Hi all, I'm trying to port the Ogre3D ocean demo to OpenSceneGraph but I've problem achieving the ocean demo effect. Has anybody did this before? VP: Code: uniform float BumpScale; uniform vec2 textureScale; uniform vec2 bumpSpeed; uniform float time; uniform float waveFreq; uniform float waveAmp; uniform mat4 osg_ViewMatrix; varying vec3 eyePosition; varying mat3 rotMatrix; // transform from tangent to obj space varying vec2 bumpCoord0; varying vec2 bumpCoord1; varying vec2 bumpCoord2; varying vec3 eyeVector; // wave functions struct Wave { float freq; // 2*PI / wavelength float amp; // amplitude float phase; // speed * 2*PI / wavelength vec2 dir; }; void main(void) { #define NWAVES 2 Wave wave[NWAVES]; wave[0] = Wave( waveFreq, waveAmp, 0.5, vec2(-1, 0) ); wave[1] = Wave( 3.0 * waveFreq, 0.33 * waveAmp, 1.7, vec2(-0.7, 0.7) ); vec4 P = gl_Vertex; // sum waves float ddx = 0.0, ddy = 0.0; float deriv; float angle; // wave synthesis using two sine waves at different frequencies and phase shift for(int i = 0; iNWAVES; ++i) { angle = dot(wave[i].dir, P.xy) * wave[i].freq + time * wave[i].phase; P.z += wave[i].amp * sin( angle ); // calculate derivate of wave function deriv = wave[i].freq * wave[i].amp * cos(angle); ddx += deriv * wave[i].dir.x; ddy += deriv * wave[i].dir.y; } // compute the 3x3 tranform from tangent space to object space // compute tangent basis vec3 T = normalize(vec3(0.0, 1.0, ddy)) * BumpScale; vec3 B = normalize(vec3(1.0, 0.0, ddx)) * BumpScale; vec3 N = normalize(vec3(-ddx, -ddy, 1.0)); rotMatrix = mat3(T, B, N); gl_Position = gl_ModelViewProjectionMatrix * P; // calculate texture coordinates for normal map lookup bumpCoord0.xy = gl_MultiTexCoord0.xy * textureScale + time * bumpSpeed; bumpCoord1.xy = gl_MultiTexCoord0.xy * textureScale * 2.0 + time * bumpSpeed * 4.0; bumpCoord2.xy = gl_MultiTexCoord0.xy * textureScale * 4.0 + time * bumpSpeed * 8.0; eyePosition = -osg_ViewMatrix[3].xyz / osg_ViewMatrix[3].w; //vec3(gl_ModelViewMatrix * P); eyeVector = P.xyz - eyePosition; // eye position in vertex space } FP: Code: uniform sampler2D NormalMap; uniform samplerCube EnvironmentMap; uniform vec4 deepColor; uniform vec4 shallowColor; uniform vec4 reflectionColor; uniform float reflectionAmount; uniform float reflectionBlur; uniform float waterAmount; uniform float fresnelPower; uniform float fresnelBias; uniform float hdrMultiplier; varying mat3 rotMatrix; // first row of the 3x3 transform from tangent to cube space varying vec2 bumpCoord0; varying vec2 bumpCoord1; varying vec2 bumpCoord2; varying vec3 eyeVector; void main(void) { // sum normal maps // sample from 3 different points so no texture repetition is noticeable vec4 t0 = texture2D(NormalMap, bumpCoord0) * 2.0 - 1.0; vec4 t1 = texture2D(NormalMap, bumpCoord1) * 2.0 - 1.0; vec4 t2 = texture2D(NormalMap, bumpCoord2) * 2.0 - 1.0; vec3 N = t0.xyz + t1.xyz + t2.xyz; N = normalize(rotMatrix * N); // reflection vec3 E = normalize(eyeVector); vec3 R = reflect(E, N); // Ogre conversion for cube map lookup R.y = -R.y; vec4 reflection = textureCube(EnvironmentMap, R, reflectionBlur); // cheap hdr effect reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier; // fresnel float facing = 1.0 - dot(-E, N); float fresnel = clamp(fresnelBias + pow(facing, fresnelPower), 0.0, 1.0); vec4 waterColor = mix(shallowColor, deepColor, facing) * waterAmount; reflection = mix(waterColor, reflection * reflectionColor, fresnel) * reflectionAmount; gl_FragColor = waterColor + reflection; } Main code: Code: osg::TextureCubeMap* readCubeMap() { osg::TextureCubeMap* cubemap = new osg::TextureCubeMap; osg::Image* imagePosX = osgDB::readImageFile( ./Images/cubemapsJS/morning_RT.jpg ); osg::Image* imageNegX = osgDB::readImageFile( ./Images/cubemapsJS/morning_LF.jpg ); osg::Image* imagePosY = osgDB::readImageFile( ./Images/cubemapsJS/morning_FR.jpg ); osg::Image* imageNegY = osgDB::readImageFile( ./Images/cubemapsJS/morning_BK.jpg ); osg::Image* imagePosZ = osgDB::readImageFile( ./Images/cubemapsJS/morning_DN.jpg ); osg::Image* imageNegZ = osgDB::readImageFile( ./Images/cubemapsJS/morning_UP.jpg ); if (imagePosX imageNegX imagePosY /* imageNegY imagePosZ imageNegZ*/) { cubemap-setImage(osg::TextureCubeMap::POSITIVE_X, imagePosX); cubemap-setImage(osg::TextureCubeMap::NEGATIVE_X, imageNegX); cubemap-setImage(osg::TextureCubeMap::POSITIVE_Y,
[osg-users] Action in Handlers thread safe ?
Hello, Looking for a random bug, I found something strange and it would be more easy for me if you can help me : I have a complex group (group with osgManipulator, transforms, geodes, ...) and it contains an osgManipulator::dragger. So, in my DraggerHandler, during the drag, the group is modified (the geode are removed and rebuilt). But I have a reccursive function traversing the graph to count visible faces ... and it crashes randomly on these complex group... the deboger do not return me interesting informations... So the question is : it is ok to modify geometry/graph in the Handler even ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] terrain database popping...
Hi Alejandro, libmini contains some addons for the display of terrain as stand-alone (for example the libmini viewer). For an integration into osg most of that stuff is of course not needed, because osg has its own loader etc. What needs to be integrated within osg is just the very core of libMini, which is called the ministub. It encapsulates the main algorithm that produces a reduced triangle mesh from a height field. It doesn't even need OpenGL as a dependency, since the generated geometry is passed to the calling framework via a call-back mechanism. In the case of osg the call back would append to a osg::vertex_array, that is a double (front and back) vertex buffer. The rest would be handled by osg like texturing etc. The draw implementation of osgTerrain is a particularly nice place to fit that in, because it already provides the necessary height field and texture. There is an adaptor missing though that closes the cracks with adjacent tiles. libMini supports that by just passing pointers to the four adjacent tiles. I'd be glad to provide the necessary information (and potential modifications) to make that work with osg. Cheers, Stefan On Apr 17, 2009, at 5:40 PM, Alejandro Aguilar Sierra wrote: Hi Stefan, I played with libmini some time ago. I didn't studied the code deeply, but I think some things are already in OSG, like the viewer. I don't have too much time right now, but with the proper insight, I may try to do it. Regards, -- A. On Thu, Apr 16, 2009 at 4:32 AM, Stefan Roettger ste...@stereofx.org wrote: On Apr 15, 2009, at 11:44 PM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: I think it would be good to fold libmini (or something equivalent) into OSG. That way you can use the databases built with VPB. I don't know much about VTP but using VPB databases are nice... Yes. I have been thinking for almost 2 years now about folding libMini into OSG, but so far did not have the necessary time to do it. So it got delayed and delayed... If someone is volunteering though, I'd be happy to give the necessary insight into libMini. Cheers, Stefan ___ 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] AttributeBinding clarification needed
Hi Users, We encountered a bug with some geometry (lets call it geomA) acting weird (disappearing) and found out that it was another geometry (lets call it geomB) setColorBinding was effecting geomA. It turns out that geomA did not use the method setColorBinding at all but of course geomB did. So this brought up a question we need answered: Q: When we looked at the enum values possible we found that there is a BIND_OFF, is this the default value if not specified? and does this mean that the geom will use the last binding value used from the last rendered geom? -- Regards, Peter Wraae Marino www.osghelp.com - OpenSceneGraph support site ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D Point to ScreenSpace Coordinates
Hello again, It sounds like you are trying to draw a 2D element at the same window position as a 3D object. Is this correct? Yes, thats exactly what Im trying to achieve. I have POINTS (not objects) in 3D Space that have to be labeled. And I want them to be clickable. As points have no volume thats a bit of a problem. So I thought I add a sphere as apoint representation to the scene. But the clcikable sphere should of yourse always have the same size no matter how far from the camera. So this idea was born. You'd need two Camera nodes for this, one with your 3D projection and one for 2D. This is what I was doing. And I computed the projection by hand and wanted to give the coords to my 2D objects with a event callback. But the coords are not exact somehow, so the point is always just very near the supposed point. Another option would be to look at the AutoTransform node. Wow, I guess this is exactly what I was looking for. Thx, Ill try it out Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10600#10600 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is polygon on screen
Something not quite understood,as I see from OpenSceneGraph Quick Start Guide by Paul Martz and other examples in the forum/mailing list, the osgUtil::PolytopeIntersector is used to check a mouse click x,y if it's hitting something. I need to know if a certain triangle in my node is on screen now. maybe tip #2?? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10601#10601 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
HI Akilan, It kinda looks like you creating a scene graph that either uses the low res whole earth model or a group of high res tiles that all site in a single flat group. This is *really* inefficient way to build your scene graph. The proper way to build paged databases is to build a quad tree database. I don't know if the concept of quad tree is familiar to you so don't know how much to explain. Wriiting software that creates decent terrain paged databases is not a trivial matter, rather than create it yourself you should considering using a 3rd party tool to do it for you. For instance VirtualPlanetBuilder is designed to generated whole earth paged database that can be browsed with OSG apps. osgEarth and ossimPlanet also can generated paged databases on the fly for you. Robert. On Wed, Apr 22, 2009 at 6:41 AM, Akilan akilan.thangam...@gmail.com wrote: Hi The following is the environment which i am working on, Hardware configuration: HP xw4400 Workstation Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz, 2GB RAM NVIDIA Quadro FX 3500 OS: MS Windows XP Professional Version 2002 Service Pack 3, v.3244 OSG: OSG2.2 The following set of code shows about how I am building scene graph for terrian visualization, //the fileTerrainModels.txt Contains list of terrain models(.osga files) with absolute path //all are geographic models with datum 'WGS-84' and 'UTM' projection ifstream fin(TerrainModels.txt); while(!fin.eof()){ finstr; if(strstr(str,.osga)!=NULL){ osg::ref_ptrosg::Fog fog=new osg::Fog; fog-setColor(osg::Vec4(.45,.45,.45,1.)); fog-setStart(0.f); fog-setEnd(50.f); fog-setDensity(1.f); fog-setMode(osg::Fog::LINEAR); fog-setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH); osg::StateSet *statSet=new osg::StateSet(); statSet-setMode(GL_BLEND,osg::StateAttribute::ON); statSet-setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); statSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN); statSet-setAttributeAndModes(fog.get(),osg::StateAttribute::ON); osg::PagedLOD *plod = new osg::PagedLOD(); plod-setName(str); plod-setRangeMode(osg::PagedLOD::DISTANCE_FROM_EYE_POINT); plod-setFileName(0, str); plod-setPriorityOffset(0, 1.f); plod-setPriorityScale(0, 1.f); plod-setRange(0, 50.f, 100.f); plod-setStateSet(statSet); group-addChild(plod); }else if(strstr(str,bluemarble.ive)==0) //for specifically adding virtual earth group-addChild(osgDB::readNodeFile(str)); } fin.close(); osgViewer::Viewer viewer; osgUtil::Optimizer optimzer; optimzer.optimize(group.get()); viewer.setSceneData(group.get()); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()-getOrCreateStateSet()) ); viewer.addEventHandler(new osgViewer::ThreadingHandler); viewer.setCameraManipulator(new osgGA::TerrainManipulator()); viewer.realize(); while(!viewer.done()){ viewer.frame(); } Let me explain the problem, I am trying to load around 8000-9000 osg terrain models which are covering part of india. As I have set the PagedLOD range 50-100, when I enter the range(zooming-down thru virtual earth), all the terrain models start loading and from that range onwards I am not able to zoom-down freely. It becomes very slow and the view also jerks. Please correct me. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10589#10589 ___ 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
Re: [osg-users] terrain database popping...
Stefan Roettger wrote: Hi Alejandro, libmini contains some addons for the display of terrain as stand-alone (for example the libmini viewer). For an integration into osg most of that stuff is of course not needed, because osg has its own loader etc. What needs to be integrated within osg is just the very core of libMini, which is called the ministub. It encapsulates the main algorithm that produces a reduced triangle mesh from a height field. It doesn't even need OpenGL as a dependency, since the generated geometry is passed to the calling framework via a call-back mechanism. In the case of osg the call back would append to a osg::vertex_array, that is a double (front and back) vertex buffer. The rest would be handled by osg like texturing etc. The draw implementation of osgTerrain is a particularly nice place to fit that in, because it already provides the necessary height field and texture. There is an adaptor missing though that closes the cracks with adjacent tiles. libMini supports that by just passing pointers to the four adjacent tiles. I'd be glad to provide the necessary information (and potential modifications) to make that work with osg. Cheers, Stefan On Apr 17, 2009, at 5:40 PM, Alejandro Aguilar Sierra wrote: Hi Stefan, I played with libmini some time ago. I didn't studied the code deeply, but I think some things are already in OSG, like the viewer. I don't have too much time right now, but with the proper insight, I may try to do it. Regards, -- A. On Thu, Apr 16, 2009 at 4:32 AM, Stefan Roettger wrote: On Apr 15, 2009, at 11:44 PM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote: I think it would be good to fold libmini (or something equivalent) into OSG. That way you can use the databases built with VPB. I don't know much about VTP but using VPB databases are nice... Yes. I have been thinking for almost 2 years now about folding libMini into OSG, but so far did not have the necessary time to do it. So it got delayed and delayed... If someone is volunteering though, I'd be happy to give the necessary insight into libMini. Cheers, Stefan ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Hi Stefan, I am also interested in the necessary information (and potential modifications) to make libMini work with osg. Thanks, Tim -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10605#10605 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is polygon on screen
On Wed, Apr 22, 2009 at 10:17 AM, Mangu Liok mangul...@yahoo.com wrote: Something not quite understood,as I see from OpenSceneGraph Quick Start Guide by Paul Martz and other examples in the forum/mailing list, the osgUtil::PolytopeIntersector is used to check a mouse click x,y if it's hitting something. I need to know if a certain triangle in my node is on screen now. maybe tip #2?? The mouse picking code is just used to set up the polytope that is used for picking, for your case you just use the whole viewport as your picking region - you use the whole camera frustum as the polytope. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Action in Handlers thread safe ?
Hi Robert, Thanks for the reply. So if I understand well, modifying the graph in a handler is not safe at all... But if I modify in a callback, this will not be more safe because of iterators as you said, no ? ... so when and how can I modify my graph safely ? It looks like a beginner question, but I feel a bit lost with that revelation ... Thanks. Regards, Vincent. 2009/4/22 Robert Osfield robert.osfi...@gmail.com On Wed, Apr 22, 2009 at 8:51 AM, Vincent Bourdier vincent.bourd...@gmail.com wrote: So the question is : it is ok to modify geometry/graph in the Handler even ? It all depends upon what modifications you are making. If you are modify content of parents from within a callback/handler then you'll be invalidating iterators that are held by the function that called your callback, so this is very definitely something you should avoid doing. Beyond that there is much I can add, it's your code, there are many things you can do wrong and frankly is pointless any of us attempting guessing what these many things might be. It's you code, you have it front of you, you have a debugger and capability to step through the code in the debugger, go do it. 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
Re: [osg-users] Is it possible to specify interleaved vertex data using Geometry node?
Hi Zhidkov, On Wed, Apr 22, 2009 at 10:37 AM, Zhidkov Evgueny osgfo...@tevs.eu wrote: Hi all! Due to some circumstances I'm now working under OSG. And looking on Geometry node, I realized, that I don't know, how to do some basic things, which I used to have: 1) Interleaved arrays. Say, I have vertex representation structure of 2 floats as vertex, 4 bytes as color and 4 bytes as some factors. Vertex size is 16 bytes. How can I specify my vertex array in such a interleaved order? As I found, OSG arrays simply lay one after another in VBO memory, and I can't specify interleaved arrays. Is there any way to have interleaved vertex data representation to use alignment features and GPU cache more effectively? Modern graphics cards don't require interleaved arrays for good performance. Interleaved arrays were more relevant to CPU based TL processing as they made better use of the cache found on a CPU. The OSG doesn't support interleaved arrays as they just complicate setup and management for no gain in performance on modern systems. 2) Static VBO memory w/o system memory footprint. Say, I have some binary file with mesh representation, and I don't want to have all this vertex soup in RAM. I want to load it directly to VBO and forget about it. As I understood, that is impossible because of OSG base paradigm, that drawing context may be attached or changed any time, so OSG always get this arrays in system memory, loading to VBO on first compilation/change event. So, memory consumption is twice (or sometimes even 3 times) greater, than it could be. So, is it possible to forget about system memory source after loading data to VBO? It is possible, this is what is done for osg::Texture's - you can get them to automatically unref data when download to the GPU. In the case of vertex arrays you can do this manually if you wish, but you'd loose all capability to do intersection testing etc. As for the 3x memroy consumption, this is incorrect, you'll only get 2x memory consumption in main memory as the driver and application memory will keep a copy of the data, while the GPU memory will only copy from driver memory when required so this third copy is only transient and doesn't even effect main memory. For most user applications there is no need to try to be clever about deleting the applications geometry data, even very large scale models typically have few problems, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Action in Handlers thread safe ?
I just read some archives and I saw that the update callback is a good place to modify the node children, but not its parent. But , the osg Handler inherits from nodeCallback ... so it is safe to modify children in a handle() isn't it ? Last, when can I modify a node's parent, or the node itsef (I mean adding/removing children by 'modify') ? Thanks, any link or precision will be appreciated. Regards, Vincent. 2009/4/22 Vincent Bourdier vincent.bourd...@gmail.com Hi Robert, Thanks for the reply. So if I understand well, modifying the graph in a handler is not safe at all... But if I modify in a callback, this will not be more safe because of iterators as you said, no ? ... so when and how can I modify my graph safely ? It looks like a beginner question, but I feel a bit lost with that revelation ... Thanks. Regards, Vincent. 2009/4/22 Robert Osfield robert.osfi...@gmail.com On Wed, Apr 22, 2009 at 8:51 AM, Vincent Bourdier vincent.bourd...@gmail.com wrote: So the question is : it is ok to modify geometry/graph in the Handler even ? It all depends upon what modifications you are making. If you are modify content of parents from within a callback/handler then you'll be invalidating iterators that are held by the function that called your callback, so this is very definitely something you should avoid doing. Beyond that there is much I can add, it's your code, there are many things you can do wrong and frankly is pointless any of us attempting guessing what these many things might be. It's you code, you have it front of you, you have a debugger and capability to step through the code in the debugger, go do it. 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
Re: [osg-users] AttributeBinding clarification needed
Hi Peter, On Wed, Apr 22, 2009 at 9:47 AM, Peter Wraae Marino osgh...@gmail.com wrote: Q: When we looked at the enum values possible we found that there is a BIND_OFF, is this the default value if not specified? and does this mean that the geom will use the last binding value used from the last rendered geom? It simply means that Geometry will do an non op for that particular vertex attribute, in your case it won't do set any colour array, so the colour that OpenGL will use in rendering with will l be the last glColour that the previous valid osg::Geometry (or other drawable) set. It's valid to have BIND_OFF for colour array for cases when you are using OpenGL lighting and have an osg::Material that sets the ColorMode to OFF. However, if you have OpenGL lighting disabled or an osg::Material with ColorMode not set to OFF then OpenGL will use the glColor value, so you must assign at least a single colour to your geometry. So... just fix you underdefined osg::Geometry so that it explicitly set the colour and the problems will disappear. The same applies to the other vertex attributes. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Is it possible to specify interleaved vertex data using Geometry node?
Hi all! Due to some circumstances I'm now working under OSG. And looking on Geometry node, I realized, that I don't know, how to do some basic things, which I used to have: 1) Interleaved arrays. Say, I have vertex representation structure of 2 floats as vertex, 4 bytes as color and 4 bytes as some factors. Vertex size is 16 bytes. How can I specify my vertex array in such a interleaved order? As I found, OSG arrays simply lay one after another in VBO memory, and I can't specify interleaved arrays. Is there any way to have interleaved vertex data representation to use alignment features and GPU cache more effectively? 2) Static VBO memory w/o system memory footprint. Say, I have some binary file with mesh representation, and I don't want to have all this vertex soup in RAM. I want to load it directly to VBO and forget about it. As I understood, that is impossible because of OSG base paradigm, that drawing context may be attached or changed any time, so OSG always get this arrays in system memory, loading to VBO on first compilation/change event. So, memory consumption is twice (or sometimes even 3 times) greater, than it could be. So, is it possible to forget about system memory source after loading data to VBO? Any comments really appreciated, Zhidkov Evgueny. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10602#10602 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is it possible to specify interleaved vertex data using Geometry node?
Thanks, Robert. It is good, that we can safely unref CPU-side geometry. Will discover it more precisely, thanks again. But on interleaved arrays - it's controversial point, because my own tests not so while ago (on nv40-g80 cards) showed me, that interleaved arrays are still faster (yes, a little bit, but the fact). Thank you for your efficiency. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10615#10615 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG + Qt4.5 + Textures
Hi, I'm new to OSG, but found it handling 3D scenes several magnitudes faster than I did :) So I jumped on integrating it with our existing Qt4.5 based application which already has very complicated UI based on QGraphicsScene with a 3D earth rendered in the background. 'osgEarth' plugin is just perfect for that job. However I can't just change everything to OSG, I need to use our original GL textures as well. So I learned from other posts how to save the states for OSG/Qt rendering. I want to draw a texture still in OSG's 3D scene, but that is incorrect. Texture coordinates and quad coordinates are not the ones I expect. It's visible especially when resizing the window. Here's a short example: Code: #include QApplication #include QGLWidget #include osgViewer/Viewer #include osgDB/ReadFile static const double _R = 6378137.; // Earth radius class OsgAdapterWidget : public QGLWidget, public osgViewer::Viewer { osg::ref_ptrosgViewer::GraphicsWindowEmbedded _gw; osg::ref_ptrosg::Node _model; osg::ref_ptrosg::StateSet _lastStateSet; GLuint _textureID; public: OsgAdapterWidget(QWidget* parent = 0); void paintGL(); void resizeGL(int, int); }; OsgAdapterWidget::OsgAdapterWidget(QWidget *parent) : QGLWidget(QGLFormat(QGL::Rgba | QGL::AlphaChannel | QGL::SampleBuffers | QGL::DoubleBuffer), parent), _lastStateSet(new osg::StateSet) { _gw = new osgViewer::GraphicsWindowEmbedded(0, 0, width(), height()); getCamera()-setGraphicsContext(_gw.get()); getCamera()-setClearColor(osg::Vec4f(0., 0., 0., 1.)); getCamera()-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); _model = osgDB::readNodeFile(model.earth); setSceneData(_model.get()); QGLWidget::makeCurrent(); QImage image(image.png); glEnable(GL_TEXTURE_2D); glGenTextures(1, _textureID); glBindTexture(GL_TEXTURE_2D, _textureID); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_BGRA, GL_UNSIGNED_BYTE, image.bits()); } void OsgAdapterWidget::resizeGL(int w, int h) { glViewport(0, 0, w, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-w/2, w/2, h/2, -h/2); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); _gw-getEventQueue()-windowResize(0, 0, w, h); _gw-resized(0, 0, w, h); getCamera()-setViewport(new osg::Viewport(0, 0, double(w), double(h))); getCamera()-setProjectionMatrixAsPerspective(35., double(w)/double(h), 1., 4*_R); getCamera()-setViewMatrixAsLookAt(osg::Vec3d(3*_R, 0., 0.), osg::Vec3d(0., 0., 0.), osg::Vec3d(0., 0., 1.)); update(); } void OsgAdapterWidget::paintGL() { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); glPushAttrib(GL_ALL_ATTRIB_BITS); glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS); glMatrixMode(GL_TEXTURE); glPushMatrix(); glLoadIdentity(); glShadeModel(GL_SMOOTH); osg::State *state = getCamera()-getGraphicsContext()-getState(); state-reset(); state-apply(_lastStateSet.get()); frame(); glMatrixMode(GL_TEXTURE); glPopMatrix(); // This is not working, texture coordinates are not in 0-1 range // and quad seems to be in incorrect position as well. glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _textureID); glBegin(GL_QUADS); glTexCoord2d(0., 0.); glVertex3d(-_R, -_R, _R); glTexCoord2d(1., 0.); glVertex3d(_R, -_R, _R); glTexCoord2d(1., 1.); glVertex3d(_R, _R, -_R); glTexCoord2d(0., 1.); glVertex3d(-_R, _R, -_R); glEnd(); getCamera()-getGraphicsContext()-getState()-captureCurrentState(*_lastStateSet); glPopAttrib(); glPopClientAttrib(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _textureID); glBegin(GL_QUADS); glTexCoord2d(0., 0.); glVertex2d(-50., -50.); glTexCoord2d(1., 0.); glVertex2d(50., -50.); glTexCoord2d(1., 1.); glVertex2d(50., 50.); glTexCoord2d(0., 1.); glVertex2d(-50., 50.); glEnd(); } int main(int ac, char* av[]) { QApplication app(ac, av); app.setGraphicsSystem(opengl); OsgAdapterWidget mainWindow; mainWindow.show(); return app.exec(); } You'll need an image.png for the texture and for model.earth you can use this: Code: map name=TMS Example type=geocentric image name=metacarta blue marble driver=tms urlhttp://labs.metacarta.com/wms-c/Basic.py/1.0.0/satellite//url /image /map I'd appreciate some suggestions. Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10619#10619 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D Point to ScreenSpace Coordinates
Thanks again. Works perfectly. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10623#10623 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Deploying on Vista vs. Deploying on XP
Hello, I use WinXP, Microsoft Visual Studio Express 8.0 Service Pack 1 and - of course - osg. I ship the runtime-dlls as private assemblies, and this works good on Windows XP and used to work for vista-users, too. Some months ago I updated Visual Studio with Service pack 1 and had to change the runtime-dlls, too. On winXP all still works fine, but not on Vista (at least on some machines, I cannot tell more precisely as I do not have Vista installed). It would be of great help for me if someone experienced with deploying osg-apps here could perhaps bring some light into this issue, it´s driving me crazy. If there are vista-users here which would like to play with the installer (and perhaps have a look at it with depends.exe or some other tool), it´s here: http://raumgeometrie.de/installer/ArchimedesGeo3DSetup1_3.exe Regards Thanks, Andreas ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is polygon on screen
I see, I misunderstood the polytope issue, I thought the polygon I'm checking is the polytope, that's why I got no where. I'll try again. It seems easy now, hopefully. thank you -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10625#10625 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Is there osg SDK ? who can tell me!
Hi, who can offer me some information about OSG SDK. the downloap address is best then we can use it to develop some simple applications. I think it will be very helpful for me. Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10627#10627 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Is there osg SDK ? who can tell me!
Err how about looking at the web site http://www.openscenegraph.org/projects/osg/wiki/Downloads __ Gordon Tomlinson gor...@gordontomlinson.com IM: gordon3db...@3dscenegraph.com www.vis-sim.com www.gordontomlinson.com __ -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cuiqingshan Sent: Wednesday, April 22, 2009 8:00 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Is there osg SDK ? who can tell me! Hi, who can offer me some information about OSG SDK. the downloap address is best then we can use it to develop some simple applications. I think it will be very helpful for me. Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10627#10627 ___ 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
Re: [osg-users] Deploying on Vista vs. Deploying on XP
your manifest uses 8.0.50727.762 but in dependecy viewer i actualy see loaded 8.0.50727.3053 so there is definitely some plugin/lib which is compiled using old version [Wink] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10630#10630 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
Radioman schrieb: your manifest uses 8.0.50727.762 but in dependecy viewer i actualy see loaded 8.0.50727.3053 so there is definitely some plugin/lib which is compiled using old version [Wink] Tanks a lot! Do you have a good idea (or does you dependency viewer show) which one this might be? I´d have to search all the dlls for the embedded manifest otherwise. If there´s no other way, I´ll do that. Regards, Andreas ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Can you tell me how to use the function of setMinimumScale and setMaximumScale
Hi, Can you tell me how to use the function of setMinimumScale and setMaximumScale?I run the program ,but I still don't know the function of the two function. :) Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10634#10634 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Picking Problem NodeVisitor
Hi, ive tried the Picking Handler from http://www.lulu.com/content/767629 ebook page 116 it uses the PolytopeIntersector but the accuracy isnt very well My Question: can anybody help me to realize a working pick handler or a picking method which visits only nodes and which gives me the picked node object How can i do that? Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10635#10635 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Public ffmpeg plugin testing streams
Hi all, (from the thread ffmpeg plugin streaming improvements (I hope) on osg-submissions: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/5283/focus=5305 ) I'll probably also be able to give addresses of some public streams in various formats, so we can all test from the same streams. I've gotten approval to open up our camera publically. I'd appreciate if only the people who want to test the ffmpeg plugin with http/rtsp streams from our camera would connect to it. It's currently just looking at a phone in our offices, and the admin interface should hopefully not be accessible without the password. You can see the video by opening this page in a browser: http://iris.cm-labs.com:10080/ If you want to try it with the OSG ffmpeg plugin, try this command line: osgmovie -e ffmpeg http://iris.cm-labs.com:10080/img/video.mjpeg (you can add --interactive to get a quad you can rotate around) You will (hopefully) see that the video starts, runs for about 15-20 seconds, and then stops. That's one bug I would like to see if someone can fix. Perhaps it's caused by my version of ffmpeg, I didn't think of trying with another but if others don't see this then I'll try). Another problem (which you won't see because you don't have the real movement to compare to) is that there is a delay at the start of viewing the stream (video is about 5 seconds late with reality) and it catches up. At the end of the 15-20 seconds of video, the video is pretty much in sync with reality. It would be great if that http stream worked without those problems. The other part is that the camera also streams MPEG-4 over RTSP. The command for that should be: osgmovie -e ffmpeg rtsp://iris.cm-labs.com:10554/img/media.sav If you try that, currently it will hang while trying to read data (with OSG_NOTIFY_LEVEL=DEBUG, you see ReaderWriterFFmpeg::readImage rtsp://iris.cm-labs.com:10554/img/media.sav). When I do that here, I can see the camera sending data (the data light flashes) but it seems the ffmpeg plugin is unable to decode that data. I suspect there is some initialization missing to tell ffmpeg what sort of data to expect over rtsp, but I'm not sure. I'm also trying to see if I can use another video viewer to see if the rtsp address at least works, but I'm not sure what I can use on Windows to view rtsp streams. I've tried Windows Media Player but it says it can't open that protocol, and I've tried The KMPlayer (my player of choice) but that crashes when trying to open it. Any suggestions? So, if anyone with some ffmpeg / streaming experience is inclined to help getting these working, I'd be very grateful. As I've said, I've kind of hit a wall here, I don't know how I can go forward. I'll remove the public streams in a week if there's no progress, but will keep them up as long as needed if someone wants to use them to test. Thanks in advance, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
Code: GetProcAddress(0x75EF [c:\windows\system32\MSVCRT.DLL], _get_terminate) called from c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.3053_none_d08d7bba442a9b36\MSVCR80.DLL at address 0x7322447F and returned NULL. Error: The specified procedure could not be found (127). ..hm -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10637#10637 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
p.s. all dll use correct manifes, it's hard to tell why actualy loaded dll is with lower version :? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10639#10639 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
can you try replace Microsoft.VC80.CRT.manifest content with this and test it where your program don't loaded Code: ?xml version=1.0 encoding=UTF-8 standalone=yes? assembly xmlns=urn:schemas-microsoft-com:asm.v1 manifestVersion=1.0 noInheritable/ assemblyIdentity type=win32 name=Microsoft.VC80.CRT version=8.0.50727.762 processorArchitecture=x86 publicKeyToken=1fc8b3b9a1e18e3b / file name=msvcr80.dll/ file name=msvcp80.dll/ file name=msvcm80.dll/ /assembly -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10640#10640 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Public ffmpeg plugin testing streams
Hi J-S, Thanks for the link to the camera. I tried the mjpeg osgmovie commandline and it took a number of seconds before the first frame came up then looked to be working but then eventually stopped update. The media.sav commandline does nothing right now, osgmovie just hangs without reporting anything. I haven't yet looked into the ffmpeg plugin and how it's coping with these sources, but I am using svn/trunk rather than your suggested changes that I haven't merged. Do your suggested changes effect the end result at all? Robert. On Wed, Apr 22, 2009 at 2:42 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi all, (from the thread ffmpeg plugin streaming improvements (I hope) on osg-submissions: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/5283/focus=5305 ) I'll probably also be able to give addresses of some public streams in various formats, so we can all test from the same streams. I've gotten approval to open up our camera publically. I'd appreciate if only the people who want to test the ffmpeg plugin with http/rtsp streams from our camera would connect to it. It's currently just looking at a phone in our offices, and the admin interface should hopefully not be accessible without the password. You can see the video by opening this page in a browser: http://iris.cm-labs.com:10080/ If you want to try it with the OSG ffmpeg plugin, try this command line: osgmovie -e ffmpeg http://iris.cm-labs.com:10080/img/video.mjpeg (you can add --interactive to get a quad you can rotate around) You will (hopefully) see that the video starts, runs for about 15-20 seconds, and then stops. That's one bug I would like to see if someone can fix. Perhaps it's caused by my version of ffmpeg, I didn't think of trying with another but if others don't see this then I'll try). Another problem (which you won't see because you don't have the real movement to compare to) is that there is a delay at the start of viewing the stream (video is about 5 seconds late with reality) and it catches up. At the end of the 15-20 seconds of video, the video is pretty much in sync with reality. It would be great if that http stream worked without those problems. The other part is that the camera also streams MPEG-4 over RTSP. The command for that should be: osgmovie -e ffmpeg rtsp://iris.cm-labs.com:10554/img/media.sav If you try that, currently it will hang while trying to read data (with OSG_NOTIFY_LEVEL=DEBUG, you see ReaderWriterFFmpeg::readImage rtsp://iris.cm-labs.com:10554/img/media.sav). When I do that here, I can see the camera sending data (the data light flashes) but it seems the ffmpeg plugin is unable to decode that data. I suspect there is some initialization missing to tell ffmpeg what sort of data to expect over rtsp, but I'm not sure. I'm also trying to see if I can use another video viewer to see if the rtsp address at least works, but I'm not sure what I can use on Windows to view rtsp streams. I've tried Windows Media Player but it says it can't open that protocol, and I've tried The KMPlayer (my player of choice) but that crashes when trying to open it. Any suggestions? So, if anyone with some ffmpeg / streaming experience is inclined to help getting these working, I'd be very grateful. As I've said, I've kind of hit a wall here, I don't know how I can go forward. I'll remove the public streams in a week if there's no progress, but will keep them up as long as needed if someone wants to use them to test. Thanks in advance, J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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
Re: [osg-users] Deploying on Vista vs. Deploying on XP
Hi, my program loads on my machine without problems with the modified manifest. Also I wonder if the 8.0.50727.3053 version is really older, or newer, as 762 3053 (I don´t know how this is counted). Regards, Andreas Radioman schrieb: can you try replace Microsoft.VC80.CRT.manifest content with this and test it where your program don't loaded Code: ?xml version=1.0 encoding=UTF-8 standalone=yes? assembly xmlns=urn:schemas-microsoft-com:asm.v1 manifestVersion=1.0 noInheritable/ assemblyIdentity type=win32 name=Microsoft.VC80.CRT version=8.0.50727.762 processorArchitecture=x86 publicKeyToken=1fc8b3b9a1e18e3b / file name=msvcr80.dll/ file name=msvcp80.dll/ file name=msvcm80.dll/ /assembly -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10640#10640 ___ 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
Re: [osg-users] Picking Problem NodeVisitor
Are you saying the Quick Start Guide picking example code doesn't do what you want? If so, can you be more specific about your feature requirements? Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthias Asselborn Sent: Wednesday, April 22, 2009 7:30 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Picking Problem NodeVisitor Hi, ive tried the Picking Handler from http://www.lulu.com/content/767629 ebook page 116 it uses the PolytopeIntersector but the accuracy isnt very well My Question: can anybody help me to realize a working pick handler or a picking method which visits only nodes and which gives me the picked node object How can i do that? Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10635#10635 ___ 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
Re: [osg-users] 3D Point to ScreenSpace Coordinates
I don't see why picking a point would be a problem. Use the PolytopeIntersector. Have you read the Quick Start Guide? Glad to hear AutoTransform did the trick. Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Hagen Sent: Wednesday, April 22, 2009 3:01 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] 3D Point to ScreenSpace Coordinates Hello again, It sounds like you are trying to draw a 2D element at the same window position as a 3D object. Is this correct? Yes, thats exactly what Im trying to achieve. I have POINTS (not objects) in 3D Space that have to be labeled. And I want them to be clickable. As points have no volume thats a bit of a problem. So I thought I add a sphere as apoint representation to the scene. But the clcikable sphere should of yourse always have the same size no matter how far from the camera. So this idea was born. You'd need two Camera nodes for this, one with your 3D projection and one for 2D. This is what I was doing. And I computed the projection by hand and wanted to give the coords to my 2D objects with a event callback. But the coords are not exact somehow, so the point is always just very near the supposed point. Another option would be to look at the AutoTransform node. Wow, I guess this is exactly what I was looking for. Thx, Ill try it out Hagen -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10600#10600 ___ 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
Re: [osg-users] CAD style rotation
Yes, I've done this as well, pretty easy to write, just allows you to position the camera in altitude and azimuth while maintaining an up vector. I'd say it's more common in sim apps than CAD apps, though. I see someone else has posted code for this. Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com http://www.skew-matrix.com/ +1 303 859 9466 _ From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Richard Baron Penman Sent: Wednesday, April 22, 2009 12:44 AM To: OpenSceneGraph Users Subject: [osg-users] CAD style rotation hello, I am after an osgManipulator with CAD style rotation. In a typical CAD program the rotation keeps the roll fixed and orbits around the centre of the screen. In contrast the TrackballManipulator allows the roll to change and rotates around the origin. Has anyone come across code that implements this type of rotation? thanks, Richard ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] difficulty of examples from osg distribution
Hi, I would like to have an ordered list (in increasing level of difficulty) of the examples that come with the svn version of osg. At least, grouping them in some categories if a numerical order cannot be applied. please forgive my english, francholi ... Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10646#10646 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
Yes it is. First my SceneGraph has a a root ( osg::Group ). The Root contains few transform nodes under one transform nodes is one node, a model added by a loader. now i want to click on a object on the screen. and i want to get a pointer of this object by picking! the example in the book is done with the PolytopeIntersector but it doesnt work accurately i get a node when i clicked on a empty place in the scene or i clicked on another node and i get a other node from the picker. ive tested the LineIntersector in OSG examples it works great but i get only points on the screen no nodes... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10648#10648 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Public ffmpeg plugin testing streams
Hi Robert, Thanks for the link to the camera. I tried the mjpeg osgmovie commandline and it took a number of seconds before the first frame came up then looked to be working but then eventually stopped update. Yep, those are my results too. The time to start is not that much of a concern, but it could explain the delay I was talking about (i.e. the plugin/ffmpeg reads X seconds of video to buffer, then plays that while reading more data for Y seconds and eventually catches up to itself and stops). Perhaps the fact that it stops is because it tries to read data too fast, resulting in an error which is not caught and just stops further reading? (just theorizing here, I don't know much about these things) The media.sav commandline does nothing right now, osgmovie just hangs without reporting anything. Same here. Turning up OSG_NOTIFY_LEVEL will show that it's trying to read data, and as I said I can see the data light flashing here when that happens, so the camera seems to be sending the data. I haven't yet looked into the ffmpeg plugin and how it's coping with these sources, but I am using svn/trunk rather than your suggested changes that I haven't merged. Do your suggested changes effect the end result at all? Well, it enabled using the rtsp format for reading from the stream (you need to call av_find_input_format with rtsp instead of the file extension of sav). But from there, the result was pretty much the same. It just looks like the ffmpeg lib doesn't know what to do with the data once it gets it. Thanks for testing, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] difficulty of examples from osg distribution
Hello Francisco, I would like to have an ordered list (in increasing level of difficulty) of the examples that come with the svn version of osg. At least, grouping them in some categories if a numerical order cannot be applied. I don't know if there's an ordering in order of difficulty. I'd say it's more a case of each example demonstrating something, and you need to find the example that shows what you want to do to base your code on that. In general, you won't work through the examples in sequential order, you'll search through the examples for a given class name or method name (like setVertexArray for example) to see how it can be used. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to make a thread running into the graph safely ?
Hi, I have a problem of how-to : I have a function, which need to run into the graph to count the visible and total number of face. This is a code which is not so quick... so I would like to put it in a separate thread to avoid my application lags. But, my thread isn't synchronized yet, so in case of the graph modification ... it crashes. How can I set my thread to be synchronized with osg threads, keeping the thread advantage or parallel process to avoid the user seeing a lag when the algorithm traverse the graph ? This algorithm is based on NodeVisistors, does it change anything ? Thanks for help. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
hm [Rolling Eyes] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10650#10650 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] difficulty of examples from osg distribution
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials [Wink] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10651#10651 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] problems in hanging in and out Nodes to a TransformNode
Hi, if i perfom a pick in my scene i get the picked node ( TransformNode1 ) i added to this picked Node a boundingbox ( TransformNode1-addchild( boundingNode ) when TransformNode1 isnt picked i have to remove this boundigbox node i do this with: (TransformNode1-removeChild( boundingNode ) and add it to the new picked (TransformNode2-addChild( boundingNode ) okay now i picked the first ( TransformNode1 ) again then the code crashes in TransformNode1-addchild( boundingNode ) why? is there another method to show / hide Nodes? Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10654#10654 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to make a thread running into the graph safely ?
Hi Vincent, The osgviewer stats has scene info collection and works pretty fast so I'm surprised similar code of yours has problems. Is you scene particular big? How many nodes/geometries etc? As for running in a separate thread when not run the thread in a parallel to the viewer.renderingTraversals(); just put a barrier before and after the call to renderingTraversals(). Robert. On Wed, Apr 22, 2009 at 3:53 PM, Vincent Bourdier vincent.bourd...@gmail.com wrote: Hi, I have a problem of how-to : I have a function, which need to run into the graph to count the visible and total number of face. This is a code which is not so quick... so I would like to put it in a separate thread to avoid my application lags. But, my thread isn't synchronized yet, so in case of the graph modification ... it crashes. How can I set my thread to be synchronized with osg threads, keeping the thread advantage or parallel process to avoid the user seeing a lag when the algorithm traverse the graph ? This algorithm is based on NodeVisistors, does it change anything ? Thanks for help. Regards, Vincent. ___ 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
Re: [osg-users] problems in hanging in and out Nodes to a TransformNode
Hi Mathias, Use osg::Switch or node-setNodeMask(0x0)/node-setNodeMask(0x); On Wed, Apr 22, 2009 at 4:01 PM, Matthias Asselborn matthias.asselb...@gmx.de wrote: Hi, if i perfom a pick in my scene i get the picked node ( TransformNode1 ) i added to this picked Node a boundingbox ( TransformNode1-addchild( boundingNode ) when TransformNode1 isnt picked i have to remove this boundigbox node i do this with: (TransformNode1-removeChild( boundingNode ) and add it to the new picked (TransformNode2-addChild( boundingNode ) okay now i picked the first ( TransformNode1 ) again then the code crashes in TransformNode1-addchild( boundingNode ) why? is there another method to show / hide Nodes? Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10654#10654 ___ 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
Re: [osg-users] difficulty of examples from osg distribution
Skylark wrote: Hello Francisco, I don't know if there's an ordering in order of difficulty. I'd say it's more a case of each example demonstrating something, and you need to find the example that shows what you want to do to base your code on that. In general, you won't work through the examples in sequential order, you'll search through the examples for a given class name or method name (like setVertexArray for example) to see how it can be used. Hope this helps, J-S THANKS, that's exactly what I'm doing for the moment, just a grep over the examples looking for Classes or Methods and also running each example searching for some effect o personal need. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10657#10657 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
Hi Matthias, Matthias Asselborn schrieb: Yes it is. First my SceneGraph has a a root ( osg::Group ). The Root contains few transform nodes under one transform nodes is one node, a model added by a loader. now i want to click on a object on the screen. and i want to get a pointer of this object by picking! the example in the book is done with the PolytopeIntersector but it doesnt work accurately i get a node when i clicked on a empty place in the scene or i clicked on another node and i get a other node from the picker. Can you reproduce your problems with the osgkeyboardmouse example? It switches to use the PolytopeIntersector when you press 'p' once (actually it toggles). If you use a OSG loader you can pass your filename as first parameter to the executable. I have not read the quick start guide but I have some general remarks: - you can adjust the accuracy of the Polytope-Picking by the size of the polytope which is usually incorporated in the constructor arguments of PolytopeIntersector (see osgkeyboardmouse) - the PolytopeIntersector returns *all* intersections it encounters, and if you call getFirstIntersection() you will only get one. This may account for your getting the wrong node. ive tested the LineIntersector in OSG examples it works great but i get only points on the screen no nodes... Regards, Peter Hrenka -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problems in hanging in and out Nodes to a TransformNode
thanks a lot it works! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10661#10661 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry considered in near+far plane auto computation
Hi Chris, I assume the call to traverse() is what actually adds the skydome to the render graph, so I'd need to trace down into that right? I traced down into that, and the drawables are added to the graph... It goes down to inline void CullVisitor::addDrawableAndDepth( osg::Drawable* drawable,osg::RefMatrix* matrix,float depth) { // ... _currentStateGraph-addLeaf(createOrReuseRenderLeaf( drawable,_projectionStack.back().get(),matrix,depth)); } and adds them. So it seems that they should be drawn. I think the problem is that the skydome is being clipped by OpenGL before rasterization. I think there's no real way to get around that, because the dome is really big and the near/far computed are really small. So I think my only real solution is the additional camera. What do you think? J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Geometry considered in near+far plane auto computation
On Wed, Apr 22, 2009 at 4:36 PM, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: Jean-Sébastien Guay wrote: I just had a thought, could the object on which this callback is set have any influence on the results? Should I set the cull callback on the Geode, or will any parent node do? I was setting it on the parent node of my skydome, which is a MatrixTransform. Perhaps that had some influence... I no longer recall how I handled that, but I think I had a MatrixTransform up there too. I think I'd ask Robert if you're barking up the wrong tree. A little theory validation goes a long way. Can't add anything really, this has been a long and twisting thread. Only things I can think of adding is perhaps adding the ability to manually set the compute near/far that the CullVisitor would be appropriate change. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
oh what a great idee! ive checked that no... i can't reproduce my problems ... in osgkeyboardmouse example i will change my code! and i will notice you! thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10664#10664 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
what is the difference between Polytope Intersector and Linesegment Intersector ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10665#10665 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
On Wed, Apr 22, 2009 at 5:22 PM, Matthias Asselborn matthias.asselb...@gmx.de wrote: what is the difference between Polytope Intersector and Linesegment Intersector ? The clue to the difference is the name PolytopeIntersector uses a Polytope do the intersection tests, while a LineSegmentIntersector uses a LineSegmenet. A Polytope is convex hull built from a list of planes (that represent half spaces). A LineSegment is simple two vertices that define the line segment. I would encourage you to search the web for more indepth discussion of what a Polytope is and what it's used for. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
Hello Matthias, In the context of intersection, the different intersectors are just used for different tasks. If you want to pick an object by a single click, you can use a line segment. If you want to pick by drawing a box, you can use a polytope. If you want to pick something that has an area / volume, you can use a line segment. But if you want to pick points, you'll get a hard time getting a line segment from the mouse coordinates to intersect a point, so you'd use a polytope (perhaps one that represents a 2x2 or 4x4 pixel box around the clicked point, extruded from near to far plane). Another difference, the line segment intersector orders objects by their distance (closest intersection first), but the polytope intersector doesn't (it would be pretty hard to implement even an approximation, and even that would be slow - the polytope intersector is slow enough as it is). So you see, the two types of intersectors lend themselves naturally to different applications. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Public ffmpeg plugin testing streams
Hi Jean-Sebastien, The osgFFmpeg plugin was written with a file source in mind. By default when it encounters an EOF, it will either loop the video or stop playing (depending on the ImageStream settings). This behaviour may probably be incorrect with streaming sources. As you said, one needs to dive further into FFmpeg API to really understand what is really happening. Cheers, Tanguy -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jean-Sébastien Guay Sent: Wednesday 22 April 2009 15:50 To: OpenSceneGraph Users Subject: Re: [osg-users] Public ffmpeg plugin testing streams Hi Robert, Thanks for the link to the camera. I tried the mjpeg osgmovie commandline and it took a number of seconds before the first frame came up then looked to be working but then eventually stopped update. Yep, those are my results too. The time to start is not that much of a concern, but it could explain the delay I was talking about (i.e. the plugin/ffmpeg reads X seconds of video to buffer, then plays that while reading more data for Y seconds and eventually catches up to itself and stops). Perhaps the fact that it stops is because it tries to read data too fast, resulting in an error which is not caught and just stops further reading? (just theorizing here, I don't know much about these things) The media.sav commandline does nothing right now, osgmovie just hangs without reporting anything. Same here. Turning up OSG_NOTIFY_LEVEL will show that it's trying to read data, and as I said I can see the data light flashing here when that happens, so the camera seems to be sending the data. I haven't yet looked into the ffmpeg plugin and how it's coping with these sources, but I am using svn/trunk rather than your suggested changes that I haven't merged. Do your suggested changes effect the end result at all? Well, it enabled using the rtsp format for reading from the stream (you need to call av_find_input_format with rtsp instead of the file extension of sav). But from there, the result was pretty much the same. It just looks like the ffmpeg lib doesn't know what to do with the data once it gets it. Thanks for testing, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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] Copying top half of image using osg::copyImage
Hi Robert, I'm trying to copy the top half of an existing image using osg::copyImage. I do this as such: // Read in source image osg::ref_ptr osg::Image pImageSrc = osgDB::readImageFile( test.jpg ); int nHalfSrcHeight = (int)(pImageSrc-t() * 0.5); // Allocate destination image osg::Image *pImageDest = new osg::Image(); pImageDest-allocateImage(pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageSrc-getPixelFormat(), pImageSrc-getDataType()); // Copy top half of source image to destination myCopyImage( pImageSrc.get(), 0, (nHalfSrcHeight-1), 0, pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageDest, 0, 0, 0, false ); This appears to be the correct way to perform this operation. Is this correct? If so, then line 210 of osg/ImageUtils.cpp appears to be incorrect as it notifies that my input height is too large. And indeed when I commend out the block below in ImageUtils.cpp, then it outputs the top half of my image as I expect. if ((src_t+height) (dest_t + destImage-t())) { osg::notify(osg::NOTICE)copyImage(srcImage, src_s, src_t, src_r, width, height, depthstd::endl; osg::notify(osg::NOTICE) destImage, dest_s, dest_t, dest_r, doRescale)std::endl; osg::notify(osg::NOTICE) input height too large.std::endl; return false; } Thanks for any help you can provide, Donny ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Public ffmpeg plugin testing streams
Hello Tanguy, The osgFFmpeg plugin was written with a file source in mind. By default when it encounters an EOF, it will either loop the video or stop playing (depending on the ImageStream settings). This behaviour may probably be incorrect with streaming sources. Yes, seems so, it would need to wait and try again later... Interesting you didn't mention this earlier, I've been saying that it stopped after 15-20 seconds of streaming and asking if someone knew why... Oh wait, are you not on osg-submissions? That discussion was there. Where is that code located? I looked around but didn't find it, perhaps I was looking wrong :-) As you said, one needs to dive further into FFmpeg API to really understand what is really happening. Yeah, that's what's killing me. I really want this to work, but without knowing ffmpeg more I'm really grasping at straws... Thanks, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Copying top half of image using osg::copyImage
oops, mis-copied a line from below: osg::copyImage( pImageSrc.get(), 0, (nHalfSrcHeight-1), 0, pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageDest, 0, 0, 0, false ); - Donny On Wed, Apr 22, 2009 at 11:57 AM, Donald Cipperly osgc...@gmail.com wrote: Hi Robert, I'm trying to copy the top half of an existing image using osg::copyImage. I do this as such: // Read in source image osg::ref_ptr osg::Image pImageSrc = osgDB::readImageFile( test.jpg ); int nHalfSrcHeight = (int)(pImageSrc-t() * 0.5); // Allocate destination image osg::Image *pImageDest = new osg::Image(); pImageDest-allocateImage(pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageSrc-getPixelFormat(), pImageSrc-getDataType()); // Copy top half of source image to destination myCopyImage( pImageSrc.get(), 0, (nHalfSrcHeight-1), 0, pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageDest, 0, 0, 0, false ); This appears to be the correct way to perform this operation. Is this correct? If so, then line 210 of osg/ImageUtils.cpp appears to be incorrect as it notifies that my input height is too large. And indeed when I commend out the block below in ImageUtils.cpp, then it outputs the top half of my image as I expect. if ((src_t+height) (dest_t + destImage-t())) { osg::notify(osg::NOTICE)copyImage(srcImage, src_s, src_t, src_r, width, height, depthstd::endl; osg::notify(osg::NOTICE) destImage, dest_s, dest_t, dest_r, doRescale)std::endl; osg::notify(osg::NOTICE) input height too large.std::endl; return false; } Thanks for any help you can provide, Donny ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Copying top half of image using osg::copyImage
Hi Donald, Have you gone through your code with a debugger at all? Check what value of nHalfSrcHeight you are getting. One fix to your code you could do would be to use /2 rather *0.5 as /2 can use integer maths, while *0.5 requires pImageSrc-t() to be automatically promoted to a float for it work. Robert. On Wed, Apr 22, 2009 at 5:57 PM, Donald Cipperly osgc...@gmail.com wrote: Hi Robert, I'm trying to copy the top half of an existing image using osg::copyImage. I do this as such: // Read in source image osg::ref_ptr osg::Image pImageSrc = osgDB::readImageFile( test.jpg ); int nHalfSrcHeight = (int)(pImageSrc-t() * 0.5); // Allocate destination image osg::Image *pImageDest = new osg::Image(); pImageDest-allocateImage(pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageSrc-getPixelFormat(), pImageSrc-getDataType()); // Copy top half of source image to destination myCopyImage( pImageSrc.get(), 0, (nHalfSrcHeight-1), 0, pImageSrc-s(), nHalfSrcHeight, pImageSrc-r(), pImageDest, 0, 0, 0, false ); This appears to be the correct way to perform this operation. Is this correct? If so, then line 210 of osg/ImageUtils.cpp appears to be incorrect as it notifies that my input height is too large. And indeed when I commend out the block below in ImageUtils.cpp, then it outputs the top half of my image as I expect. if ((src_t+height) (dest_t + destImage-t())) { osg::notify(osg::NOTICE)copyImage(srcImage, src_s, src_t, src_r, width, height, depthstd::endl; osg::notify(osg::NOTICE) destImage, dest_s, dest_t, dest_r, doRescale)std::endl; osg::notify(osg::NOTICE) input height too large.std::endl; return false; } Thanks for any help you can provide, Donny ___ 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
Re: [osg-users] CAD style rotation
I tried compiling this into the released 2.8 code and it complained about _horizontalLock and _verticalLock not being defined. Which source tree were you compiling against? Cory Martin Beckett wrote: I cleaned up the code a little to fit osg naming. Removed the Visual Studio pre-compiled headers so it will build anywhere Added mouse wheel zoom and the ability to select the mod keys (horizontal and vertical rotate only) programmatically. Can you check out the 'usage' function and note any other features I missed. Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10659#10659 ___ 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
Re: [osg-users] CAD style rotation
Should be bool _horizontalLock; bool _verticalLock; at the bottom of the SphericalManipulator definition. Sorry - I changed the name in the .h but the zip had the no-h version. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10676#10676 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
Mojtaba and Martin, I like this manipulator and I think it is worthy of inclusion in OSG. Do you plan on submitting it to the submissions list? Cory Martin Beckett wrote: Should be bool _horizontalLock; bool _verticalLock; at the bottom of the SphericalManipulator definition. Sorry - I changed the name in the .h but the zip had the no-h version. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10676#10676 ___ 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
Re: [osg-users] RecordCameraPathHandler where is the saved_animation.path file?
Felix, did you achieve to replay the animation? I recorded a animation in a saved_animation.path file, but what I want is to play it in a external player. Does OSG save the animation with another kind of file, like .wmv? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10678#10678 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
It's Moji's code so he should probably be the one to submit it. There seems to be a few functions that aren't necessary (perhaps for some other code) which could be cleaned up. It would be nice if there was a method to set a rotation origin in the model - or is there some general way to do this? Martin ps. There seems to be a lot of cut+paste code between the different manipulators - perhaps somebody who understands them better could look at how much could be moved to MatrixManipulator. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10679#10679 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
If you want to pick an object by a single click, you can use a line segment. If you want to pick by drawing a box, you can use a polytope. You _can_ use a line segment for mouse click picking, but in a perspective view, polytope is really better suited for this task. Also, polytope will pick point and line primitives, while line segment intersection will miss them. Polytope intersection has traditionally been used for mouse click picking. See gluPickMatrix in the GLU library, dating back over 15 years. It is useful for OpenGL 1.x/2.x GL_SELECTION render mode. It restricts the perspective projection matrix to a small box around the mouse click, producing a narrow view frustum. The net result is essentially a polytope intersection. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Picking Problem PolytopeIntersector
Paul Martz wrote: If you want to pick an object by a single click, you can use a line segment. If you want to pick by drawing a box, you can use a polytope. Err, that wasn't Paul, that was me... You _can_ use a line segment for mouse click picking, but in a perspective view, polytope is really better suited for this task. Also, polytope will pick point and line primitives, while line segment intersection will miss them. But PolytopeIntersection is really slow, and does not allow (easily) getting the first intersection. If all you want to do is select the object under the cursor, LineSegment is more than enough and is really fast with the kdtree support. Polytope intersection has traditionally been used for mouse click picking. See gluPickMatrix in the GLU library, dating back over 15 years. It is useful for OpenGL 1.x/2.x GL_SELECTION render mode. Dinosaur! :-) J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
Hi all Thanks Martin for his excellent work on SphericalManipulator. I will be so glad if this can be added to the submission list. But there are a few notes and questions: 1 - you have commented the body of zoomOn function, but it's declaration exits in the class. 2 - I think zoomOn function offers a good and useful functionality. Is it necessary to remove it from the manipulator? 3 - I haven't implemented the setByMatrix function, because I don't need it. But this should be done. 4 - There is an small issue in getInverseMatrix and getMatrix functions. Both compute the matrix even if it hasn't changed from the previous step. Maybe it is better to compute it when needed and just return the computed one otherwise. 5 - The member variable named _dragged is not necessary and can be removed. I use it in my specialized version only. Regards, Moji the Great --- On Thu, 4/23/09, Martin Beckett m...@mgbeckett.com wrote: From: Martin Beckett m...@mgbeckett.com Subject: Re: [osg-users] CAD style rotation To: osg-users@lists.openscenegraph.org Date: Thursday, April 23, 2009, 12:18 AM It's Moji's code so he should probably be the one to submit it. There seems to be a few functions that aren't necessary (perhaps for some other code) which could be cleaned up. It would be nice if there was a method to set a rotation origin in the model - or is there some general way to do this? Martin ps. There seems to be a lot of cut+paste code between the different manipulators - perhaps somebody who understands them better could look at how much could be moved to MatrixManipulator. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10679#10679 ___ 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
Re: [osg-users] DBPager continuously reloading tiles
Ryan, Thank you for the suggestion. When I call setTargetMaximumNumberOfPagedLOD(0) on the database pager, as you suggested and then set the expiry delay to DBL_MAX and the expiry frames to 10, as Jason Suggested the problem seems to go away. I'm not really sure why this works. It seems like the default behavior should work in my usage case, but at least it is working now. -Evan On Tue, Apr 21, 2009 at 9:25 AM, Kawicki, Ryan H ryan.h.kawi...@boeing.comwrote: As in your case, we also have high resolution insets which exhibit this problem, but our applications are centered around a continuous render update. Robert can correct me if I am wrong, but the new mechanism for controlling how nodes are paged in and out of memory is defaulted to ( I think ) 300 for the target maximum number of page lods. Because this value is set, removing of expired subgraphs will go down the path of removing capped paged lods instead of the expiry. To use the expiry system of old, make sure to call setTargetMaximumNumberOfPageLOD(0) on the database pager, and the expiry values you have set should kick in. We have tried increasing the target maximum, but we run a greater risk of consuming too much memory for a 32 bit application on Windows. Because of time restraints, I have not been able to follow-up on this problem. Sorry. *Ryan H. Kawicki* The Boeing Company Training Systems Services Software Engineer -- *From:* Evan Andersen [mailto:andersen.e...@gmail.com] *Sent:* Monday, April 13, 2009 10:08 AM *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] DBPager continuously reloading tiles I tried the settings you suggested Jason, but I still get the same behavior. -Evan On Fri, Apr 10, 2009 at 5:57 PM, Jason Beverage jasonbever...@gmail.comwrote: Hi Evan, What happens if you set the expiry frame to something like 10 and the expiry time to DBL_MAX? I haven't tried running the DatabasePager without non-continuous rendering, so I'm not sure how well it works. Jason On Fri, Apr 10, 2009 at 5:20 PM, Evan Andersen andersen.e...@gmail.comwrote: Thanks for your response Robert. I just tried setting the expiry delay of the database pager to 10, 100, and 1000, but still have the same problem. I also tried increasing the expiry frames count to 60, but that didn't help either. -Evan On Fri, Apr 10, 2009 at 2:33 PM, Robert Osfield robert.osfi...@gmail.com wrote: On Fri, Apr 10, 2009 at 6:43 PM, Evan Andersen andersen.e...@gmail.com wrote: Sorry, I forgot to mention that. I'm using version 2.9.2 from the trunk. Thanks for the clarification. Changes in DatabasePager in 2.8 onwards should make it easier to do what you are doing. The DatabasePager and PagedLOD were still designed around continuous rendering though so you are running a bit off usual usage model so might need to tweak a few things. My guess is that the PageLOD are expiring their children as they haven't been traversed for a given amount of time. You can adjust the expiry delay via the DatabaePager API so have a browse. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
modjtabaf wrote: 1 - you have commented the body of zoomOn function, but it's declaration exits in the class. I was just playing with. ZoomOn is intended to zoom fullscreen on a selected node ? That would be useful. You can submit it by simply posting the files to the submission forum. (zip the header/cpp - the forum has a problem with files without an extention). You will need to clean up a few things - like adding explanation comments for docgen for each function declaration - to get past Robert. But I was wondering if it would be better as an extention to TrackBallManipulator? The spherical mode is really just a set of constraints to the regular trackball which you might want to turn on and off. For a CAD app being able to lock and free individual rotation axes is certainly useful. Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10685#10685 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Deploying on Vista vs. Deploying on XP
Hi I've deployed a few apps across platforms now, and the best advise I can give is to make sure that if you change dev environment (i.e. vs2003 to vs2005) make sure you recompile everything with the new dev env (even stuff like alut :( ) On a worse note. I did once deploy a simple proof of concept app on XP then got asked to quickly ( lol) get it working on vista. It kept on crashing, in the end I never found out the real cause, but building my scene graph in a slightly different way made it work (no idea). So good luck, but vista appears to be a beast in itself (bring on windows 7 :) ) Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] CAD style rotation
thanks very much - that's just what I was after. Richard On Wed, Apr 22, 2009 at 6:37 PM, Mojtaba Fathi modjta...@yahoo.com wrote: Hi I have a developed a manipulator like the one you want. It has some extra code specialized for my needs. Let me clean extra codes and send it to you. Maybe it can help. Regards, Moji the Great --- On *Wed, 4/22/09, Richard Baron Penman richardbp+...@gmail.comrichardbp%2b...@gmail.com * wrote: From: Richard Baron Penman richardbp+...@gmail.comrichardbp%2b...@gmail.com Subject: [osg-users] CAD style rotation To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Date: Wednesday, April 22, 2009, 11:14 AM hello, I am after an osgManipulator with CAD style rotation. In a typical CAD program the rotation keeps the roll fixed and orbits around the centre of the screen. In contrast the TrackballManipulator allows the roll to change and rotates around the origin. Has anyone come across code that implements this type of rotation? thanks, Richard -Inline Attachment Follows- ___ osg-users mailing list osg-users@lists.openscenegraph.orghttp://mc/compose?to=osg-us...@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
Re: [osg-users] DoomLike manipulator
'collision handling' - oh wow! I eagerly await. Richard On Wed, Apr 22, 2009 at 7:59 AM, Simon Loic simon1l...@gmail.com wrote: Hi, In fact I've struggled quite a while to handle collision in a way that apparently doesn't work, and finally I had to postpone coding on it for work reason. I'll try to post a version of this manipulator with simple collision tests soon , let's say by the week end. On Tue, Apr 21, 2009 at 3:51 AM, Richard Baron Penman richardbp+...@gmail.com richardbp%2b...@gmail.com wrote: hi, I'm interested in using this manipulator. Have any updates been posted or should I use the originally posted one? Richard 2009/3/24 Simon Loic simon1l...@gmail.com In fact I didn't have enough time to finish this week-end. So It will be postponed to next week. On Fri, Mar 20, 2009 at 9:10 AM, Simon Loic simon1l...@gmail.comwrote: All right, I'll certainly finish during the week-end and post it on osg-users for testing. 2009/3/20 Robert Osfield robert.osfi...@gmail.com Hi Loic, Great little discussion :-) 2009/3/19 Simon Loic simon1l...@gmail.com Maybe when I will have finished to implement the GROUNDED/HORIZONTAL mode you can give it a try and decide which name best fits. In my concern I clearly incline towars grounded as the implementation I was about to propose allows step over small obstacles like stairs. If you have remarks on the implementation so far, go ahead... to sukender : I didn't exacly get your remarks while I'm sure they are founded. Anyway I think that when I wil have finished to code both mode, things will become clearer for me and for you. Get you informed as soon as the manipulator is ready. When you ready just post the changes to either osg-submissions if it's ready to merge, or to osg-users if you feel it still needs more discussion. Cheers, Robert, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Loïc Simon -- Loïc Simon ___ 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 -- Loïc Simon ___ 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
Re: [osg-users] [vpb] osgdem gui 0.3 dev
download the zip file, unzip a folder, delete the osgdemgui_zh.qm file, then the language is english. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10689#10689 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
Hi I bit know about the concept of quad tree. But I want to know applying the concept on OSG construction. Can I get any reference for organizing the scenegraph in quad tree form? Pls help me out. Akilan A -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10690#10690 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] what is the GDAL_INCLUDE and GDAL_INCLUDE?
Hi,Everyone I get some errors when I build VirtualPlanetBuilder . Cmake show me the error GDAL_INCLUDE NOTFOUND and GDAL_INCLUDE NOTFOUND. I am a newbie ,so I donnot know anything. who can help me !Thanks very much! And the error picture is Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10691#10691 attachment: error.bmp___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] what is the GDAL_INCLUDE and GDAL_INCLUDE?
Hi, Maybe you could search the web before posting here ? Type GDAL in google and the first result is : http://www.gdal.org/ You could get binaries from http://fwtools.maptools.org/ Regards -- Loustaunau Christophe Déclic Création 49, rue des remparts 03380 Huriel On Thu, Apr 23, 2009 at 7:40 AM, Cuiqingshan 287170...@qq.com wrote: Hi,Everyone I get some errors when I build VirtualPlanetBuilder . Cmake show me the error GDAL_INCLUDE NOTFOUND and GDAL_INCLUDE NOTFOUND. I am a newbie ,so I donnot know anything. who can help me !Thanks very much! And the error picture is Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.phLoustaunau pLoustaunau ?p=10691#10691http://forum.openscenegraph.org/viewtopic.php?p=10691#10691 ___ 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
Re: [osg-users] [vpb] what is the GDAL_INCLUDE and GDAL_INCLUDE?
Thank you very much! I am sorry for my lazy! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10693#10693 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org