[osg-users] Optimizer FLATTEN_STATIC_TRANSFORMS not all transforms are flattened
Hello, osg folks! I've used FLATTEN_STATIC_TRANSFORMS and it works quite good. However, now I need to rotate the scene, so I added a MatrixTransform on top of the root node. But it does not get flattened for SOME models. I properly set DataVariance of every Transform to STATIC before running the Optimizer. Can somebody point out where issue could come from and how to debug or solve it? -- Regards, Sergey. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
"Maxim Senin" writes: > Yes, I found the necessary node, what should I do next? It depends: do you want to completely detach the door, or just rotate it around its hinges? -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image capture in memory
Hi, osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; ... camera->setRenderTargetImplementation( renderImplementation ); By default it is using FBO, osgposter.cpp line 259 & 315 This example is created with windows in mind I guess, I want a pure example without osgViewer::Viewer being used. Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75890#75890 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image capture in memory
Hi Catalin, I don't have build env at the moment but looking into the code, can you try this: osgposter.cpp, Ln: 377 just add: viewer_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); this shouldn't open any window On Wed, Apr 24, 2019 at 11:12 AM Catalin Flower wrote: > Hi Alberto, > > This example is half baked as I see it: > > if you run it: > > osgposter.exe cow.osg --inactive --use-pbuffer > > --inactive - suppose to be without windows but it creates a window anyway > --use-pbuffer still creates a window > > This is the code path that I tried to import in my app but no image is > generated and it creates a black .bmp image. > > if you run it: > > osgposter.exe cow.osg > > if you can see the cow in a window and you can press 'P' and it captures > an image fine to the disk > > I need a simple example to capture an image off-screen without any windows > popping up on screen. This is a basic feature that should be simple > implement and understand. > > Does OSG even support such a basic feature? > > > Thank you! > > Cheers, > Catalin > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=75884#75884 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
icf80 wrote: > Hi, > > Get this book, it learns basic stufff: > > https://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825 > > Thank you! > > Cheers, > Catalin this is a bad answer. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75888#75888 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image capture in memory
Hi, pbuffer seems to be the old way of doing offscreen rendering. Pbuffers and Frame buffer objects (FBO) are two methods for rendering to an offscreen buffer The major difference between a Pbuffer and an FBO is that each Pbuffer needs its seperate OpenGL context, as opposed to FBOs where you can have as many FBOs as (sanely) possible in one OpenGL context. Pbuffers are older and considered obsolete, the FBO extension is the best method for rendering to textures as of now, in my opinion. By default osgposter uses frame buffer objects: osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75887#75887 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
Hi, Get this book, it learns basic stufff: https://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825 Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75886#75886 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
Hi, You should have your scene graph as follow root - osg::MatrixTransform - osg:Node The matrix is controlling the position of the node. Modify the matrix to modify the node position. Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75885#75885 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image capture in memory
Hi Alberto, This example is half baked as I see it: if you run it: osgposter.exe cow.osg --inactive --use-pbuffer --inactive - suppose to be without windows but it creates a window anyway --use-pbuffer still creates a window This is the code path that I tried to import in my app but no image is generated and it creates a black .bmp image. if you run it: osgposter.exe cow.osg if you can see the cow in a window and you can press 'P' and it captures an image fine to the disk I need a simple example to capture an image off-screen without any windows popping up on screen. This is a basic feature that should be simple implement and understand. Does OSG even support such a basic feature? Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75884#75884 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
icf80 wrote: > Hi, > > You have to find the node associated to your object by intersection: > > osgUtil::LineSegmentIntersector::Intersections ints; > bool bHasIntersections = > viewer->computeIntersections(viewer->getCamera(), > osgUtil::Intersector::WINDOW, x, y, ints, CULL_MASK_HERE); > > if (bHasIntersections) > { > const osgUtil::LineSegmentIntersector::Intersection& inter = > *(ints.begin()); > > const osg::NodePath& nodePath = inter.nodePath; > unsigned int idx = nodePath.size(); > while (idx--) > { > osg::Node*node =nodePath[idx]; > > > > > Thank you! > > Cheers, > Catalin Yes, I found the necessary node, what should I do next? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75883#75883 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Dragging individual model nodes
Hi, You have to find the node associated to your object by intersection: osgUtil::LineSegmentIntersector::Intersections ints; bool bHasIntersections = viewer->computeIntersections(viewer->getCamera(), osgUtil::Intersector::WINDOW, x, y, ints, CULL_MASK_HERE); if (bHasIntersections) { const osgUtil::LineSegmentIntersector::Intersection& inter = *(ints.begin()); const osg::NodePath& nodePath = inter.nodePath; unsigned int idx = nodePath.size(); while (idx--) { osg::Node*node =nodePath[idx]; Thank you! Cheers, Catalin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75881#75881 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image capture in memory
"Catalin Flower" writes: > 2) It creates windows, I don't want to see windows flashing on the screen > while the capture happens If I recall correctly, this is what the pbuffer option does, setting renderImplementation = osg::Camera::PIXEL_BUFFER; You can try the others to see the effect, though. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org