[osg-users] osg exporter, blender problems
Hi, I have finally completed simple geometry and texture tutorial and now I try to load complex geometry like character. Everything works OK with .obj file but it is loaded extremely slow. But I have another question. I've tried both plugins by Cedric Pinson and from Blender Projects Page (http://projects.blender.org/frs/?group_id=19release_id=335#osgexport-2-42-title-content). In Blender 2.63 I go to the preferences window and choose addons tab, then click install addon and choose .py file. Then I look through the filter and exporters/importers section and can't find it. I tried to copy the file to scripts/addons folder of Blender but it doesn't appear. There were also such problems with OGRE exporter. What is wrong? Thank you! Cheers, Dmitry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50702#50702 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Using the notification API with multi-threading - heap corruption errors
Hi, Your test program has bug in it. std::rand() is not threadsafe nor reentrant. I don't think it can corrupt heap, but it will be better to use something else or use mutex around rand(); Cheers, Filip -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50707#50707 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Increasing line width
Chris Hanson wrote: On Wed, Oct 17, 2012 at 9:18 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC () wrote: Take a look at the createAxis() in the osgbillboard.cpp file for the osgbillboard example. There's code in there to set linewidth... Rather than altering the model (which break displaylists or other compiled geometry representations and requires DYNAMIC datavariance) I recommend re-drawing the highlighted part one more time, after the rest of the model has drawn itself. You can usually use a nodemask to perform this trick. You may wish to clone the original entity, set the line width wider, and draw that clone, so you don't disrupt the state of the original. Set your Z-buffer depth test to GL_LEQUAL so that re-drawing the same part actually draws it again, over top of the copy already represented in the Z-buffer. -- Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/ (http://www.alphapixel.com/) Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android -- Post generated by Mail2Forum Yes, cloning entity and setting linewidth to higher number works, only problem is with cloning big entity, its slow operation for realtime highlighting. I was wondering if this can be achieved without cloning entire entity. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50708#50708 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg exporter, blender problems
Hi Dmitry, You want to download: https://github.com/cedricpinson/osgexport/blob/master/blender-2.5/build/osgexport-0.13.0.zip And use install addon on the .zip file. You will also need to enable it after you install it. By the way, I have a fork with some additional features related to armatures and animation, but you'll have to copy the scripts into your blender scripts folder yourself: https://github.com/tetron/osgexport On 10/21/2012 2:38 PM, Dmitry K. wrote: Hi, I have finally completed simple geometry and texture tutorial and now I try to load complex geometry like character. Everything works OK with .obj file but it is loaded extremely slow. But I have another question. I've tried both plugins by Cedric Pinson and from Blender Projects Page (http://projects.blender.org/frs/?group_id=19release_id=335#osgexport-2-42-title-content). In Blender 2.63 I go to the preferences window and choose addons tab, then click install addon and choose .py file. Then I look through the filter and exporters/importers section and can't find it. I tried to copy the file to scripts/addons folder of Blender but it doesn't appear. There were also such problems with OGRE exporter. What is wrong? Thank you! Cheers, Dmitry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50702#50702 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Peter Amstutz Senior Software Engineer Technology Solutions Experts Natick, MA 02131 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problem with picking a manipulator in a HUD
Hi all, I am trying to get a Dragger on my HUD display, but I am not able to manipulate it at all. If I add it the identical dragger to the normal scene, it works as expected. Any insight in this is appreciated as I have reached the end of trying to traverse the scene trying to gain understanding in this matter. The core of my code is: #include QtGui/QApplication #include osgViewer/Viewer #include osgGA/TrackballManipulator #include osgQt/GraphicsWindowQt #include osg/ShapeDrawable #include osg/MatrixTransform #include osgManipulator/TabBoxDragger int main( int argc, char** argv ) { QApplication app(argc, argv); osgQt::initQtWindowingSystem(); osg::Group* sceneroot = new osg::Group; osg::Camera* hudcamera = new osg::Camera; sceneroot-addChild( hudcamera ); hudcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); hudcamera-setViewMatrix(osg::Matrix::identity()); hudcamera-setClearMask(GL_DEPTH_BUFFER_BIT); hudcamera-setRenderOrder(osg::Camera::POST_RENDER); hudcamera-setAllowEventFocus(false); hudcamera-setName(HUD Camera ); osg::Matrix mat; mat.makeTranslate( 200, 200, -200 ); mat.preMult( osg::Matrix::scale( 200, 200, 200 ) ); osgManipulator::TabBoxDragger* tbd = new osgManipulator::TabBoxDragger; hudcamera-addChild( tbd ); tbd-setupDefaultGeometry(); tbd-setMatrix( mat ); tbd-setHandleEvents( true ); osg::Geode* geode = new osg::Geode; geode-addDrawable( new osg::ShapeDrawable(new osg::Box) ); sceneroot-addChild( geode ); osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer; viewer-setSceneData( sceneroot ); viewer-setCameraManipulator( new osgGA::TrackballManipulator ); osgQt::setViewer( viewer.get() ); osgQt::GLWidget* glw = new osgQt::GLWidget; osgQt::GraphicsWindowQt* graphicswin = new osgQt::GraphicsWindowQt( glw ); hudcamera-setProjectionMatrix(osg::Matrix::ortho2D(0,glw-width(),0,glw-height())); viewer-getCamera()-setViewport( new osg::Viewport(0, 0, glw-width(), glw-height() ) ); viewer-getCamera()-setGraphicsContext( graphicswin ); glw-show(); return app.exec(); } - Kristofer -- Kristofer Tingdahl, Ph. D. dGB Earth Sciences ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] slave camera render to texture.
Hi Peterakos, You seem to be having more problems than you should for what is usually a straight forward task. Rather than try to understand what you've done wrong in your program I think it would be best for you to have a look at the osg examples that are relevant - for example have a look at osgprerender, osgprerenercubemap and osgdistortion. Robert. On 14 October 2012 21:50, Peterakos hay...@gmail.com wrote: Hello. My task is to have 2 cameras being exactly the same. The first one will render to my window and the second one to texture. First i tried to create a camera as child to scene data and add the same model as child. So i used the following code: Viewer viewer; Camera* camera = new Camera(*viewer.getCamera(), CopyOp::DEEP_COPY_ALL); ref_ptrImage image = new Image(); image-allocateImage(width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE); camera-setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT ); camera-attach(Camera::BufferComponent(Camera::COLOR_BUFFER0), image.get()); camera-setPostDrawCallback(new MyCameraPostDrawCallback(image.get())); The post callback will writes image to file. I couldnt make it work and i have no idea why. All i see in the texture is an empty scene. What more should i do ? After that i decided to use slave camera. I noticed that i had to use 2 different graphics context. But the problem is that i dont want the second window to appear. What configuration should i pass to the second context to not appear any window ? I assume is something based on WindowingSystemInterface but i couldnt find what exactly. Thank you for your time. ___ 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] How to copy an FBO used as RTT target ?
Hi, I have a scene graph with multiple cameras as follow : Camera 1 : - clear mask : color and depth - use FBO_Camera_1_Color as color buffer attachment - use FBO_Camera_1_Depth as depth buffer attachment Camera 2 : - clear mask : none - use FBO_Camera_2_Color as color buffer attachment - use FBO_Camera_2_Depth as depth buffer attachment Now, I would like the Camera 2 : - to use FBO_Camera_1_Color as an INPUT color buffer (do not write into this buffer, write into FBO_Camera_2_Color) - to use FBO_Camera_1_Depth as an INPUT depth buffer (do not write into this buffer, write into FBO_Camera_2_Depth) So this way : - FBO_Camera_1_Color and FBO_Camera_1_Depth remains intact even after camera 2 rendering. - everywhere the camera 2 do not write data, data from camera 1 are visible The first solution would probably to copy FBOs before camera 2 rendering : - FBO_Camera_1_Color into FBO_Camera_2_Color - FBO_Camera_1_Depth into FBO_Camera_2_Depth How to do that ? Should I use another camera and a renderquad to perform the copy, or is there any OSG functionnality to copy FBO ? Even better, is there a second solution to provide an input buffer attachement to a camera ? Thank you! Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50713#50713 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Mutex for Uniform::addParent and removeParent?
Hi Tim. On 14 October 2012 18:46, Tim Lowery t...@computer.org wrote: Question: Shouldn't the mutex be required to control access to _parentList in Uniform::addParent and removeParent? Thanks for highlighting this issue, I believe it would be appropriate to add a mutex lock, and have added this and checked it into the svn/trunk version of Uniform.cpp in keeping with the way it's already done in StateSet/Drawable. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Uniforms per MasterCamera in a ThreadPerContext threading model
Hi Anish, You can assign an osg::StateSet with require osg::Uniform the to each osg::Camera. Robert. On 9 October 2012 12:59, Anish Thomas thomas.an...@gmail.com wrote: Hi, I need to render the same geodes in multiple views (one master-camera per view). The geode rendering is controlled by uniforms whose values change based on the camera's attributes. Each master camera can move independently. With a 'ThreadPerContext' threading model, how can I supply different values to shader uniforms of the same (geode's) stateset in each view? Thank you! Cheers, Anish -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50516#50516 ___ 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] Regarding Database Pager
Hi Abhinav, There isn't any way to know what is wrong with the details you've given. For starters what you you mean by unload the project? Do you mean scene graph? How might you be unloading it. Robert. On 15 October 2012 12:12, Abhinav abhi...@vizexperts.com wrote: Dear All, I have an application which has the project loading and unloading support. Sometimes when I unload the project It crashes inside createHeightField inside database pager thread. To resolve the issue, I am disabling the database pager when I am unloading the Project. This is how I am unloading the project if(_view) { osgDB::DatabasePager *pager = _view-getDatabasePager(); if(pager) { pager-setAcceptNewDatabaseRequests(false); pager-cancel(); pager-clear(); } } Now When the new project loads, I start the database pager as if(_view) { osgDB::DatabasePager *pager = _view-getDatabasePager(); if(pager) { pager-registerPagedLODs(getOSGNode()); pager-setAcceptNewDatabaseRequests(true); _dirty = true; } } But Starting is not working properly. I am seeing artifacts when I zoom in to the earth. Globe is not smooth rather I can see the sharp edges. Am I missing something to start the database pager? Please help me out. Thanks and Regards Abhinav Goyal 3D Engineer VizExperts ___ 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] Increasing line width
Yes, cloning entity and setting linewidth to higher number works, only problem is with cloning big entity, its slow operation for realtime highlighting. I was wondering if this can be achieved without cloning entire entity. Well, if you can use shaders or stencil buffers, you could write to a separate mask channel (multiple render targets) during the original render pass, and then do some sort of post-processing operation afterward. But it's probably just as easy to stick a stateset with an osg::LineWidth ( http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00391.html ) above the selected model, with the stateset set to OVERRIDE. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Distribution, Viewer osgCluster
Hi Kleber, I''m rather confused by what you've written in your email so can't really work out what you are specically trying to achieve or how you are actually trying to go about it. The best I can do is suggest you take things slowly - first work on understanding basic viewer functionality, then once you have mastered this move on to the clustering. Also as a general comment you don't usually mix two osgViewer::Viewer in a single application, instead you'd normally use a osgViewer::CompositeViewer that has two osgViewer::View. Please have a look at the osgcamera, osgwindow and osgcompositeviewer examples. Robert. On 15 October 2012 16:53, Kleber Jacome osgfo...@tevs.eu wrote: Hi, I'm new in OSG, I'm using root/OpenSceneGraph/trunk/examples/osgcluster/osgcluster.cpp code #1 and this works perfect with one compute node tiled display. My problem is when I mix with the following code # 2. Open 2 windows, obviously. Because I need to use the mouse pick and keyboard to change color with the use of a few keys, This allows me to code #2. The tutorials don't help me, weren't helpful. #1. Group *scene = startupScene(); osgViewer::Viewer viewer; viewer.setSceneData(scene); return viewer.run(); #2. osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer; viewer-setUpViewInWindow( 0, 0, 512, 512 ); viewer-setSceneData( CreateScene() ); return viewer-run(); Questions? - What is the difference between these codes? - Can I mix this codes? - How I can mix this codes to see on one frame or one window? - Still works with the option of looking at the computer node with osgCluster same as before? - Can I run on the head node the application and I see their movements on a Tiled display nodes? I am sorry if the answer is very simple or obvious. I'm starting with this topic. PD. In abstract, I'm doing a project for distribution and parallelization, with compute nodes and tiled display wall nodes. I use OpenMPI, too. If I can solve my problems upload the code so you can see the code mixes that I did with the /OpenSceneGraph/trunk/examples codes of OSG. Thank you! Cheers, Kleber xD -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50611#50611 ___ 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] LineSegmentIntersector gives incorrect results (intersections missing)
Hi Peter, I can't specifically say what you are seeing a problem, but it does rather sound like a precision issue with projecting the mouse poistion into clip space and then to world and final object coordinates. Robert. On 17 October 2012 14:19, Peter Bako osgfo...@tevs.eu wrote: Hi, I've got a problem with line segment intersector. Sometimes I get only one intersection (on the bootom side of the table), while I should get two. Please check the screenshot. Do you have any idea why this happens? What should I do? STLFILE.stl (ZIPPED) is attached Thank you! Cheers, Peter Hold CTRL key to activate intersection output. This is the code I use: Code: #include stdafx.h #include osgViewer/Viewer #include osgDB/ReadFile #include osgUtil/LineSegmentIntersector class PickHandler : public osgGA::GUIEventHandler { public: virtual bool handle( const osgGA::GUIEventAdapter ea, osgGA::GUIActionAdapter aa ) { if ( ea.getEventType()!=osgGA::GUIEventAdapter::RELEASE || ea.getButton()!=osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON || !(ea.getModKeyMask()osgGA::GUIEventAdapter::MODKEY_CTRL) ) return false; osgViewer::Viewer* viewer = dynamic_castosgViewer::Viewer*(aa); if ( viewer ){ osg::ref_ptrosgUtil::LineSegmentIntersector intersector = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, ea.getX(), ea.getY()); osgUtil::IntersectionVisitor iv( intersector.get() ); iv.setTraversalMask( ~0x1 ); viewer-getCamera()-accept( iv ); if ( intersector-containsIntersections() ){ const osgUtil::LineSegmentIntersector::Intersection result = *(intersector-getIntersections().begin()); printf(Intersection count:%d. Coordinates: %.2f, %.2f, %.2f\n, intersector-getIntersections().size(), result.getWorldIntersectPoint().x(),result.getWorldIntersectPoint().y(),result.getWorldIntersectPoint().z()); } } return false; } }; int main( int argc, char** argv ) { osg::ref_ptrosg::Node model1 = osgDB::readNodeFile( STLFILE.stl ); osg::ref_ptrosg::Group root = new osg::Group; root-addChild( model1.get() ); osg::ref_ptrPickHandler picker = new PickHandler; osgViewer::Viewer viewer; viewer.setSceneData( root.get() ); viewer.addEventHandler( picker.get() ); return viewer.run(); } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50644#50644 Attachments: http://forum.openscenegraph.org//files/intersection_errors_639.png http://forum.openscenegraph.org//files/stlfile_974.zip ___ 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] nVidia bug with multiple windows
Hi Leigh, Thanks for the pointer to that revision, however our issue persists at revision 13170. I posted that repro case to their dev support email address, and they let me know they're taking a look at it. I'll update this thread with any progress made. Thanks- Baker Searles -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50720#50720 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] intersection of lines: line widths?
I know that intersections are about 3d world coordinates, and line widths are about pixels. But is there a way to use line widths in calculating intersections with the polytope intersector? In other words, I want a wider line to be easier to pick. I could just expand the polytope a bit, except that the lines are just one kind of thing in the scene, and they could have different line widths. thanks, andy ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] speed up the loading
i have hundreds of millions of points to render.i think the Geometry 's setVertexArray (Vec3Array) is time consuming . for every point , it must construct a Vec3 class, and put it into the array. so i want to modified it to setVertexArray (float*) , so that i can read a block of data from the disk and provide it to osg. to do so. the first thing is i must figure out how the osg interact with opengl. unfortunately i see a lot of arraydispatcher which is complecated . can someone tell me how can i do ? Shawl___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org