Re: [osg-users] How can I obtain the osgQt library?
Mark Green hlgamead...@hotmail.com writes: Hi, This is probably a stupid question, but how do I obtain the osgQt lib file? From what I understand such a file should exist and it's probably needed to erase some linker errors which I've been getting (in osgQt::GraphicsWindowQt). But unlike the other libraries I needed, this osgQt library did not seem to be supplied in my original install, and I have been unable to locate the lib file in any of the downloads on this site or anywhere else on the net. I was also unable to find any ways to generate this lib file myself. If someone could explain how I can obtain this file, or if someone who has it could even upload it, then I would be very grateful. How did you install osg? Some linux distributions don't enable osgQt by default to not impose the Qt dependency on osg users. They usually provide a separate osgQt package. This is at least the case for ArchLinux. I've tried asking this question in the build forums before but didn't get any replies that got me any closer, as that was quite a slow board I was hoping for some more visibility here (work has mostly grinded to a halt meanwhile). Thank you! Cheers, Mark Cheers, Philipp Moeller GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Google Summer of Code
Chris Hanson xe...@alphapixel.com writes: A number of project I've worked with have made good use of the Google Summer of Code to make useful improvements. http://googleblog.blogspot.com/2012/03/new-kind-of-summer-job-open-source.html Do we feel like there are useful tasks to be done that might be do-able by a Summer of Code student? Has anyone here worked within the SoC process before? I have been a student and maybe I'm going to be a mentor this year. I'm not really involved with OpenSceneGraph but could give some advice for how to organize participation. The dead-line for organization applications for this year is over already and the deadline for student applications is in 2 days, so nothing can happen this year. Cheers, Philipp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Controlling osgViewer through QScriptEngine
Hello, has anybody tried to integrate osgViewer with a QScriptEngine? I'm currently adding scripting support to a Qt based application and wanted to see if anybody else has experience with it. Currently I see only one option: write a class derived from QObject that has the necessary slots to forward everything to the corresponding Qt functions. A prime candidate for such a wrapper would be osg::Camera or a osgGA::CameraManipulator or possibly a GUIEventHandler. Manipulating the scene graph itself through a QScript should be possible by wrapping the graph in a QAbstractItemModel and exposing this model to the QScriptEnginge. Did someone do something similar yet that could be reused or serve as an example? Any roadblocks I don't see (thread safety probably)? -- Philipp Moeller GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering an OpenSceneGraph scene in Qt QuickRendering an OpenSceneGraph scene in QML Rendering an OpenSceneGraph scene in QML
Preet prismatic.proj...@gmail.com writes: Hey all. I have an OpenSceneGraph tree I'd like to have displayed in QtQuick. I'd like the user to be able to interact with the scene where the mouse can zoom/pan/rotate the camera, just like osgViewer allows. I saw that there were a couple of examples (osgQtWidgets and osgQtBrowser), but they're a little over my head. I think the right way to start trying this is by starting with the QtDeclarative model (http://doc.qt.nokia.com/4.7-snapshot/qtdeclarative.html)... but I'm not too sure where to go from here. Does anyone have any suggestions? Regards, Pris Hi Preet, I've looked into integrating OpenSceneGraph into QML. You might want to start with the osgviewerQt to get started with a viewer integrated into Qt. Then you should have a look at [1] to see how you can expose your osg widget to QML. If I ever get something reusable up and running, I'll let the list know. If you go down the route of exposing scene graph functionality in your Qt application you will need to roll some implementation of QAbstractItemModel, which is a real pain. It get's easier if you restrain yourself to graphs where each element only has a single parent. If you can throw something together I would be really interested in it, so let me know. [1] : http://developer.qt.nokia.com/doc/qt-4.8/gettingstartedqml.html#exposing-c-classes-to-qml -- Philipp Moeller GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Segmentation fault when I try to assign MatrixD
Maciej Ciemborowicz p...@ciemborowicz.pl writes: Hello, I have a class (Car) which extends|osg::PositionAttitudeTransform|. Now I want to create camera which has the same position. So I get car's matrix in Camera's getMatrix() method: |matrix= car-asMatrixTransform()-getMatrix(); // osg::Matrixd* matrix| At this point I get stack overflow. This is call stack from debugger: osg::Matrixd::set (this=0x64da90, ptr=0xd8) osg::Matrixd::Matrixd (this=0x64da90, mat=@0xd8: error reading variable) Camera::update (this=0x64d970) Camera::Camera (this=0x64d970, car=0x64b270) main (argc=1, argv=0x7fffe5d8) What am I doing wrong? How can I get matrix from PAT in different way? Does asMatrixTransform return a non-NULL pointer? PositionAttidudeTransform does not inherit from MatrixTransform so that should not work. HTH, Philipp Moeller GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgQt] Opening a QMenu with an event send to GLWidget breaks event handling
Marius Kintel mar...@kintel.net writes: On Feb 13, 2012, at 11:41 AM, Philipp Moeller wrote: I ran into a strange problem with osgQt, where setting the contextMenuPolicy to Qt::CustomContextMenu for a GLWidget and spawning a QMenu from a slot that is connected to the event breaks the event handling inside the viewer. I've seen similar behavior, but haven't had the opportunity to dig deep enough into osgQt yet to address it properly. My immediate fix turned out to be QCoreApplication::sendEvent from the place that calls QMenu::exec (I haven't tested this on Windows, yet). The real problem is, that this is not a problem of the event handling in osgQt per se, but related to the weird behavior of QMenu (which seems to be in place to provide for truly blocking menus and to prevent other slots/signals to be triggered after the menu has been exec'd). I don't see much that could be done inside the widget itself. -- Philipp Moeller GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 3D osgManipulator in HUD
Hi list, I've tried to use a custom manipulator in an osghud. The picking and manipulation works but I'm a little stumped about the clipping of the Translate1DAxisDragger. The surrounding geometry of the TrackballDragger seems perfectly clipped but I can't get the clipping for the inner axis right. Do I have a fundamental misunderstanding of glOrtho or is that actually a bug? Cheers, Philipp Moeller /* OpenSceneGraph example, osghud. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include osgUtil/Optimizer #include osgDB/ReadFile #include osgViewer/Viewer #include osgViewer/CompositeViewer #include osgGA/TrackballManipulator #include osg/Material #include osg/Geode #include osg/BlendFunc #include osg/Depth #include osg/PolygonOffset #include osg/MatrixTransform #include osg/Camera #include osg/RenderInfo #include osgDB/WriteFile #include osgText/Text #include osgManipulator/TabBoxDragger #include osgManipulator/Translate1DDragger #include osgManipulator/TrackballDragger // a TrackballDragger without the sphere class SpherelessTrackballDragger : public osgManipulator::TrackballDragger { public: SpherelessTrackballDragger() : osgManipulator::TrackballDragger(false) { } void setupDefaultGeometry() { osgManipulator::TrackballDragger::setupDefaultGeometry(); _xyzDragger-removeChildren(0, _xyzDragger-getNumChildren()); } virtual ~SpherelessTrackballDragger() {} }; osg::Camera* createHUD() { // create a camera to set up the projection and model view matrices, and the subgraph to draw in the HUD osg::Camera* camera = new osg::Camera; // set the projection matrix // camera-setProjectionMatrix(osg::Matrix::ortho(0,1280,0,1024,-1.0f,1.0)); camera-setProjectionMatrix(osg::Matrix::ortho(-1.5, 20.0, -1.5, 20.0, -1.0, 1.0)); // set the view matrix camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera-setViewMatrix(osg::Matrix::identity()); // only clear the depth buffer camera-setClearMask(GL_DEPTH_BUFFER_BIT); // draw subgraph after main camera view. camera-setRenderOrder(osg::Camera::POST_RENDER); // we don't want the camera to grab event focus from the viewers main camera(s). camera-setAllowEventFocus(true); return camera; } struct SnapImage : public osg::Camera::DrawCallback { SnapImage(const std::string filename): _filename(filename), _snapImage(false) { _image = new osg::Image; } virtual void operator () (osg::RenderInfo renderInfo) const { if (!_snapImage) return; osg::notify(osg::NOTICE)Camera callbackstd::endl; osg::Camera* camera = renderInfo.getCurrentCamera(); osg::Viewport* viewport = camera ? camera-getViewport() : 0; osg::notify(osg::NOTICE)Camera callback camera viewportstd::endl; if (viewport _image.valid()) { _image-readPixels(int(viewport-x()),int(viewport-y()),int(viewport-width()),int(viewport-height()), GL_RGBA, GL_UNSIGNED_BYTE); osgDB::writeImageFile(*_image, _filename); osg::notify(osg::NOTICE)Taken screenshot, and written to '_filename'std::endl; } _snapImage = false; } std::string _filename; mutable bool_snapImage; mutable osg::ref_ptrosg::Image_image; }; struct SnapeImageHandler : public osgGA::GUIEventHandler { SnapeImageHandler(int key,SnapImage* si): _key(key), _snapImage(si) {} bool handle(const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter) { if (ea.getHandled()) return false; switch(ea.getEventType()) { case(osgGA::GUIEventAdapter::KEYUP): { if (ea.getKey() == _key) { osg::notify(osg::NOTICE)event handlerstd::endl; _snapImage-_snapImage = true; return true; } break
Re: [osg-users] Best usage of function: return ref_ptr or standard ptr?
Juan Herrera juan...@gmail.com writes: Hi, I have a function which I want to return a group, with two alternatives: Code: osg::ref_ptr osg::Group returnGroup() { osg::ref_ptr osg::Group group = new osg::Group; ... return group; } Code: osg::Group * returnGroup() { osg::Group * group = new osg::Group; ... return group; } Which usage is better if garbage collection is desired? There is no garbage collection in osg. Objects are deleted through reference counting, but that is probably what you mean. I'd go with the second style if nothing in returnGroup stores the pointer. It is certainly safe, if the pointer is assigned to a ref_ptr in another object. In general, use ref_ptr when you need to store something for a longer duration and a plain pointer for short-lived access and creation. Cheers, Philipp Thank you! Cheers, Juan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45134#45134 ___ 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] Backing up osg State
I'd like to back-up some osg::StateAttribute for the simple purpose of restoring it, if some dialog in my application is rejected. I'd would like to have something as easy as Light* light; ref_ptrLight backup = new Light(*light, osg::CopyOp(osg::CopyOp::DEEP_COPY_ALL)); //back up *light = *backup; This obviously does not work, as Light has no assigment operator. Copying every attribute and resetting them manually seems like an easy work-around but is not forward compatible or maintainable. Copying the state and using the copy in case of rejection is also possible but quite ugly. Is there something I'm missing or is working around that the only way to do it? -- Philipp Moeller, GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Backing up osg State
Robert Osfield robert.osfi...@gmail.com writes: Hi Philipp On 25 January 2012 15:37, Philipp Moeller philipp.moel...@geometryfactory.com wrote: I'd like to back-up some osg::StateAttribute for the simple purpose of restoring it, if some dialog in my application is rejected. I'd would like to have something as easy as Light* light; ref_ptrLight backup = new Light(*light, osg::CopyOp(osg::CopyOp::DEEP_COPY_ALL)); //back up *light = *backup; This obviously does not work, as Light has no assigment operator. It should work as it has a copy constructor, it doesn't need a copy operator for this task. The copy is not the problem the assignment is (The operator= is needed here as this is not the point of declaration). osg::Objects operator= is private which default deletes the assignment operator in all base classes and I don't really get why. So it looks like this is by design although it would be nice to have. You can also call clone() if you want. 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] New QT 4.8 integration ?
Remo Eichenberger remo.eichenber...@gmail.com writes: Hi, Nobody really works on this ? There is an osgviewerQt example which works pretty nicely with Qt-4.8. What would you expect to be different? Cheers, Philipp Cheers, Remo -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44932#44932 ___ 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] osgViewer::RecordAnimationPath without file
Hello list, osgViewer::RecordAnimationPath will always store the AnimationPath to a file. This looks very limited to me. For my use-case extracting a osg::AnimationPath would be enough and it seems possible to extend the current interface with this functionality. Otherwise it would be nice, if osg::RecordAnimationPath could be used with a stringstream to allow me to store the produced string. Am I overlooking some functionality here? Otherwise I could contribute the modifications. Cheers, Philipp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Distance point to geometry
Vincent Bourdier vincent.bourd...@gmail.com writes: Hi Robert, Sorry if I was not clear : I'm just looking for a way to compute the smallest distance between a point and a geometry, not just a point to vertex distance, but also a point to edge or point to face (orthogonal projection). That is a common problem in robotics and computational geometry. This should get you started with a choice of algorithms that might suit you: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.46.8005rep=rep1type=pdf Cheers, Philipp Moeller Due to the few days I have I think this won't be possible and safe... Thanks. Regards, Vincent. Le 16/01/2012 10:26, Robert Osfield a écrit : Hi Vincent, I'm not clear on what you are after, but I can say that there isn't anything close to resembling what you are talking about in the OSG so you'll need to roll your own visitor. Robert On 16 January 2012 08:36, Vincent Bourdiervincent.bourd...@gmail.com wrote: Hi all, Looking in the archives I didn't get any interesting answer so here is the question : Is there any way using OSG to compute the distance between a graph and a point ? (not just with the vertices but also with edges and the triangles) I could implement my own visitor to traverse all element (vertex, ege and face) but I'm looking for something more optimized or more easy to do in a few days if possible... Thanks. 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help: LineSegmentIntersector operates in GPU or CPU?
wang shuiying shuiying.w...@fu-berlin.de writes: Hello, I am really sorry to trouble you again with my naive questions. :-) (1)Where does LineSegmentIntersector carry out its intersection? In GPU or CPU? Looking at the implementation of operator() in LineSegmentIntersection.cpp shows that it performs everything on the CPU. I could only find a CUDA implementation for the 2D case. (2) How can I know which processes happen in GPU, which ones in CPU? (perhaps only draw traversal happens in GPU?) (3)How can I check the rendering rates of my osg programm? Is it invariant during run time or does it remain constant? osg::Viewer has a osg::Stats property and also comes with osgViewer::StatsHandler which can print timings as a HUD display. Thank you very much in advance! Shuiying ___ 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] Dragger::setupDefaultGeometry changes lighting
I want to add a TrackballDragger to a simple geometry (triangles, normals calculated by SmoothingVisitor, colors, no other state set). My viewer is configured with setLightingMode(osg::View::SKY_LIGHT). And my graph looks really just like this: root /\ / \ / MatrixTransform / \ Dragger \ Geometry Dragging works perfectly but the lighting for the Geometry changes (goes dark) and even setting GL_LIGHTING to ON | PROTECTED does not change anything. The change is introduced by TrackballDragger::setupDefaultGeometry but I cannot see where the code should set a StateAttribute that would affect lighting in my geometry. Any hints how to debug this further or which StateAttributes need to be enabled in my geometry? Cheers, Philipp Moeller ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Dragger::setupDefaultGeometry changes lighting
Robert Osfield robert.osfi...@gmail.com writes: Hi Philip, Check your geometry to see if it has normal and colour arrays, it could be that these are missing so it's inheriting the values from the manipulator geometry. Indeed my normals were missing. I had an updateCallback set on my Geometry that didn't apply SmoothingVisitor to the parents. Although the way I do it now looks highly inefficient to me. // g is the geometry the visitor is acting upon auto parents = g-getParents(); for(auto x : parents) if(Geode* geo = x-asGeode()) geo-apply(smoothingVisitor); Is there a subcomponent of SmoothingVisitor that can be applied to a Drawable instead of a Geode? I image it should be somewhere in the eternals already, but this seems useful to me. Philipp Robert. On 13 January 2012 11:21, Philipp Moeller philipp.moel...@geometryfactory.com wrote: I want to add a TrackballDragger to a simple geometry (triangles, normals calculated by SmoothingVisitor, colors, no other state set). My viewer is configured with setLightingMode(osg::View::SKY_LIGHT). And my graph looks really just like this: root / \ / \ / MatrixTransform / \ Dragger \ Geometry Dragging works perfectly but the lighting for the Geometry changes (goes dark) and even setting GL_LIGHTING to ON | PROTECTED does not change anything. The change is introduced by TrackballDragger::setupDefaultGeometry but I cannot see where the code should set a StateAttribute that would affect lighting in my geometry. Any hints how to debug this further or which StateAttributes need to be enabled in my geometry? Cheers, Philipp Moeller ___ 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] Out-dated documentation
Hi, Is there any plan to update the doxygen on openscenegraph.org any time soon? Having to get a tarball just to build the documentation seems to be a little overkill and prevents the usual `google osg + classname` approach. Cheers, Philipp Moeller, GeometryFactory ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Extending Geode or Geometry
Hi list, my use-case is this: I have data structures that cannot be rendered directly but can be transformed to something that is renderable. All algorithms manipulating data work on my own data structures. After the algorithms are done, I would like to update the geometry to reflect the changed data. I'm unsure if I should extend a osg::Geode, add my datastructure as a member and a rebuild() member funtion or if it makes more sense to extend a osg::Drawable and go from there. Basically, the setUserData() function already does what I want but it lacks a way to issue an update. Alternatively, I can just store my data separately and use setUserData to have to keep pointers to the associated data and work from there. Cheers, Philipp ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org