Re: [osg-users] ImageStream current frame
I'm happy to extend ImageStream if my changes could be fed back. The changes will need to be to base class and the ImageStream implementations. Frame information would only be relevant to a stream so why would the base Image class need to be changed? Richard Hi Richard, Chasing after PixelBufferObject usage will just waste your time on something that really won't lead to much benefit. What you are after is a value that the OSG doesn't at present provide, but the OSG is open source, so you can take the source extended it to do what you need to do and then get these changes make into the main trunk. The changes will need to be to base class and the ImageStream implementations. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] extracting camera path from model
hello, I have a model and camera animation path exported from 3ds max to osg format. In OpenSceneGraph I want to jump to any point along this animation, so I'm trying to extract the AnimationPath ControlPoints. Here is the relevant part of the osg file: PositionAttitudeTransform { DataVariance DYNAMIC name Camera01 nodeMask 0xff cullingActive TRUE UpdateCallbacks { AnimationPathCallback { DataVariance DYNAMIC pivotPoint 0 0 0 timeOffset 0 timeMultiplier 1 AnimationPath { DataVariance DYNAMIC LoopMode LOOP ControlPoints { 0 235.432098388672 9.58514785766602 0 0.500558972358704 0.499440401792526 0.499440401792526 0.500559031963348 1.0011920929 0.99761581421 1.0023841858 ... So you can see the AnimationPath is stored within a callback within a Transform. My problem is I haven't figured out how to extract this path. There was a similar thread on this earlier ( http://groups.google.com/group/osg-users/browse_thread/thread/f89d14baf366385b/1c9e025662bf2544) but the author was just after an initial position. I looked at getUpdateCallback() but the interface of its return type NodeCallback looks like a dead end. Has anyone done this before? regards, Richard ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 2.6.1 release
Hi Paul Sorry if that last email from me appeared a bit curt; No worries, you should see me when I fall out of bed on a morning or maybe you shouldn't :-) Attached is a batch file from Mike's svn tree that contains the package version numbers. Thanks, I wasn't aware of that. I was aware of some discussions on the mailing list regarding moving to different versions of 3rd party libs, but was unable to find the threads again. I'd also noticed that some of the 3rd party lib suppliers had withdrawn earlier versions - such as zlib 1.2.2 due to security issues. Do you have these same [compilation issues] when you build OSG v2.6 with these dependencies? LibTiff - yes. I was kind-of hoping that someone would have a config.h/makefile/whatever that would allow this to compile for OSG. ReaderWriterGif - yes. I think it's something to do with the function calling convention specified by libgif that doesn't work with OSG's calling convention. I couldn't see a way to fix this, but I'll take a look at the version of libgif used by Mike to see if that has the answer. GenWrapper - no. I've just done a rebuild on OSG 2.6.0 to check, and didn't get a genwrapper error message. Assuming you're on Windows... Many will warn you to not mix Release libs with Debug builds. However, I have found that you can mix them if the library meets two criteria: 1) the library interface must not use STL, and 2) don't mix the heap (don't alloc memory in Release code and free it in Debug, for example). LibTiff appears to meet these criteria, as far as I know, so you should be able to mix a Release libTiff with your Debug OSG. Cool - sounds like I can ignore that... for now. Thanks for your time. Gary. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Thanks to OSG !
Hi, Thanks for your comments ! When are you having an iPhone release?;) As soon as there is an OpenGL ES version of OSG. :) I would also say: thanks to the ImageStreamer functionality ;))) Yeah, thanks to ImageStream and FFmpeg ! I'm mostly interested in what you used for the UI? Something custom? Something custom yes, osgWidget wasn't out when we started working on it, but as soon as I can I'll have a look at it. And to finish, many thanks to Robert and it's impressive support and work on OSG ! :) -- Serge Lages http://www.tharsis-software.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ImageStream current frame
Hi Richard, On Thu, Sep 25, 2008 at 7:10 AM, Richard Baron Penman [EMAIL PROTECTED] wrote: I'm happy to extend ImageStream if my changes could be fed back. The changes will need to be to base class and the ImageStream implementations. Frame information would only be relevant to a stream so why would the base Image class need to be changed? You'd put the methods in the ImageStream base class so that the implementations would implementation it, and you could just interface with the ImageStream intereface without needing to know the implementation details, this is basic OO. You wouldn't put the additional method into osg::Image though, just osg::ImageStream. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] extracting camera path from model
Hi Richard, You find the node with animation path callback on and then you use dynamic_cast: osg::AnimationPathCallback* apc = dynamic_castosg::AnimationPathCallback*(node-getUpdateCallback()); Robert. On Thu, Sep 25, 2008 at 8:38 AM, Richard Baron Penman [EMAIL PROTECTED] wrote: hello, I have a model and camera animation path exported from 3ds max to osg format. In OpenSceneGraph I want to jump to any point along this animation, so I'm trying to extract the AnimationPath ControlPoints. Here is the relevant part of the osg file: PositionAttitudeTransform { DataVariance DYNAMIC name Camera01 nodeMask 0xff cullingActive TRUE UpdateCallbacks { AnimationPathCallback { DataVariance DYNAMIC pivotPoint 0 0 0 timeOffset 0 timeMultiplier 1 AnimationPath { DataVariance DYNAMIC LoopMode LOOP ControlPoints { 0 235.432098388672 9.58514785766602 0 0.500558972358704 0.499440401792526 0.499440401792526 0.500559031963348 1.0011920929 0.99761581421 1.0023841858 ... So you can see the AnimationPath is stored within a callback within a Transform. My problem is I haven't figured out how to extract this path. There was a similar thread on this earlier (http://groups.google.com/group/osg-users/browse_thread/thread/f89d14baf366385b/1c9e025662bf2544) but the author was just after an initial position. I looked at getUpdateCallback() but the interface of its return type NodeCallback looks like a dead end. Has anyone done this before? regards, Richard ___ 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] Problems getting a model to render using OSG in an MFC application
Hi all, first posting here, so be gentle. I'm trying to integrate OSG in an existing MFC application in place of a temporary custom OpenGL renderer. I have looked at the osgviewermfc example and based my code on that. So far I have got a viewer up and running with a single master camera. I have tested that the camera is being redrawn by changing the clear-color to a random value every frame. When I assign scenedata to the viewer there is nothing being drawn however. I am using the following code in my CView::Oncreate: // Create a trackball manipulator trackball = new osgGA::TrackballManipulator(); // Create a Manipulator Switcher keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; // Add our trackball manipulator to the switcher keyswitchManipulator-addMatrixManipulator( '1', Trackball, trackball); // Init the switcher to the first manipulator (in this case the only manipulator) keyswitchManipulator-selectMatrixManipulator(0); // Zero based index Value // Init the main Root Node/Group mRoot = new osg::Group; // Load the Model from the model name mModel = osgDB::readNodeFile(c:/cow.osg); Optimize the model //osgUtil::Optimizer optimizer; //optimizer.optimize(mModel); //optimizer.reset(); // Add the model to the scene mRoot-addChild(mModel); // Local Variable to hold window size data RECT rect; // Create the viewer for this window mViewer = new osgViewer::Viewer(); // Add a Stats Handler to the viewer mViewer-addEventHandler(new osgViewer::StatsHandler); // Get the current window size ::GetWindowRect(m_hWnd, rect); // Init the GraphicsContext Traits traits = new osg::GraphicsContext::Traits; // Init the Windata Variable that holds the handle for the Window to display OSG in. windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd); // Setup the traits parameters traits-x = 0; traits-y = 0; traits-width = rect.right - rect.left; traits-height = rect.bottom - rect.top; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext = 0; traits-setInheritedWindowPixelFormat = true; traits-inheritedWindowData = windata; // Create the Graphics Context gc = osg::GraphicsContext::createGraphicsContext(traits); // Init a new Camera (Master for this View) osg_camera = new osg::Camera; // Assign Graphics Context to the Camera osg_camera-setGraphicsContext(gc); // Set the viewport for the Camera osg_camera-setViewport(new osg::Viewport(traits-x, traits-y, traits-width, traits-height)); // Add the Camera to the Viewer mViewer-addSlave(osg_camera); // Add the Camera Manipulator to the Viewer mViewer-setCameraManipulator(keyswitchManipulator); // Set the Scene Data mViewer-setSceneData(mRoot); // Realize the Viewer mViewer-realize(); - And in my views OnDraw I use the following: float r = (float) rand()/RAND_MAX; float g = (float) rand()/RAND_MAX; float b = (float) rand()/RAND_MAX; float a = (float) rand()/RAND_MAX; osg_camera-setClearColor( osg::Vec4(r,g,b,a) ); mViewer-frame(); As far as I can tell the osgviewermfc uses pretty much the same code. Any and all help and hint as to what I'm doing wrong would be much appreciated. Regards, and thanks in advance. Jesper D. Thomsen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Problems getting a model to render using OSG in an MFC application
Hi Jesper, Anyone couldn't find your problem by this way, but problem looks like simple. I advice you to look at cOSG class and Render threads activation way in osgviewerMFC example. I think there is render thread activation problem. You can change clear color but can't render scene. So I think problem is threading activation. I hope have answered your question. Best Regards. Umit Uzun 2008/9/25 Jesper D. Thomsen [EMAIL PROTECTED] Hi all, first posting here, so be gentle. I'm trying to integrate OSG in an existing MFC application in place of a temporary custom OpenGL renderer. I have looked at the osgviewermfc example and based my code on that. So far I have got a viewer up and running with a single master camera. I have tested that the camera is being redrawn by changing the clear-color to a random value every frame. When I assign scenedata to the viewer there is nothing being drawn however. I am using the following code in my CView::Oncreate: // Create a trackball manipulator trackball = new osgGA::TrackballManipulator(); // Create a Manipulator Switcher keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; // Add our trackball manipulator to the switcher keyswitchManipulator-addMatrixManipulator( '1', Trackball, trackball); // Init the switcher to the first manipulator (in this case the only manipulator) keyswitchManipulator-selectMatrixManipulator(0); // Zero based index Value // Init the main Root Node/Group mRoot = new osg::Group; // Load the Model from the model name mModel = osgDB::readNodeFile( c:/cow.osg); Optimize the model //osgUtil::Optimizer optimizer; //optimizer.optimize(mModel); //optimizer.reset(); // Add the model to the scene mRoot-addChild(mModel); // Local Variable to hold window size data RECT rect; // Create the viewer for this window mViewer = new osgViewer::Viewer(); // Add a Stats Handler to the viewer mViewer-addEventHandler( new osgViewer::StatsHandler); // Get the current window size ::GetWindowRect(m_hWnd, rect); // Init the GraphicsContext Traits traits = new osg::GraphicsContext::Traits; // Init the Windata Variable that holds the handle for the Window to display OSG in. windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd); // Setup the traits parameters traits-x = 0; traits-y = 0; traits-width = rect.right - rect.left; traits-height = rect.bottom - rect.top; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext = 0; traits-setInheritedWindowPixelFormat = true; traits-inheritedWindowData = windata; // Create the Graphics Context gc = osg::GraphicsContext::createGraphicsContext(traits); // Init a new Camera (Master for this View) osg_camera = new osg::Camera; // Assign Graphics Context to the Camera osg_camera-setGraphicsContext(gc); // Set the viewport for the Camera osg_camera-setViewport( new osg::Viewport(traits-x, traits-y, traits-width, traits-height)); // Add the Camera to the Viewer mViewer-addSlave(osg_camera); // Add the Camera Manipulator to the Viewer mViewer-setCameraManipulator(keyswitchManipulator); // Set the Scene Data mViewer-setSceneData(mRoot); // Realize the Viewer mViewer-realize(); - And in my views OnDraw I use the following: float r = (float) rand()/RAND_MAX; float g = (float) rand()/RAND_MAX; float b = (float) rand()/RAND_MAX; float a = (float) rand()/RAND_MAX; osg_camera-setClearColor( osg::Vec4(r,g,b,a) ); mViewer-frame(); As far as I can tell the osgviewermfc uses pretty much the same code. Any and all help and hint as to what I'm doing wrong would be much appreciated. Regards, and thanks in advance. Jesper D. Thomsen ___ 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] matrix transformation order
up! From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Wed, 24 Sep 2008 14:51:28 +0200 Subject: [osg-users] matrix transformation order Hi, right now i have a matrix which contains N transformations. One of these is a scale, and i want to modify that scale i call the decompose method of the matrix matrix.decompose(traslation, rotation_quat, scale, scale_orientation); then i modify the scale with the new value and when i try to compose the matrix back i´m not sure about the order of matrix multiplying i should use to get the same transformated object than before with the new scale applied what looks ok to me is osg::Matrix(scale_orientation) * scale * osg::Matrix(rotation_quat) * traslation, but this is not working so if anyone have any idea it will be appreciated i´ve also tried with scale * osg::Matrix(rotation_quat) * traslation the rotation and scale should both be around the object space origin and the original object matrix was built using scale * rotation * translate thanks La cartera, las gafas. ¿te falta algo? Ahora llévate Messenger en tu móvil _ ¿Sigue el calor? Consulta MSN El tiempo http://eltiempo.es.msn.com/___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 3ds plugin scale bug?
Hi user, There seems to be a minor bug in the 3ds plugin ... I have an example where the wheels on a landrover have been scaled negative but when loaded in OpenSceneGraph with the 3ds format... they are not scaled negative. Here is a .max anad .3ds example http://osghelp.com/downloads/Recon_LandRover.zip can anyone confirm this bug? and who maintains the 3ds plugin format for OpenSceneGraph? and sorry if this is the wrong maillist -- 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] extracting camera path from model
oh now I see it - thanks very much! Hi Richard, You find the node with animation path callback on and then you use dynamic_cast: osg::AnimationPathCallback* apc = dynamic_castosg::AnimationPathCallback*(node-getUpdateCallback()); Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bounding box issue
http://www.vis-sim.com/osg/osg_faq_1.htm#f22 http://www.vis-sim.com/osg/osg_faq_1.htm#f17 __ Gordon Tomlinson [EMAIL PROTECTED] IM: [EMAIL PROTECTED] www.vis-sim.com www.gordontomlinson.com __ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gianluca Natale Sent: Thursday, September 25, 2008 5:19 AM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] bounding box issue Actually I'm using the old Producer::camera, and I cannot find such a way to disable the SMALL FEATURE CULLING. Is there a way to do that with Producer, or the default cannot be changed at all! Thanks, Gianluca -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gianluca Natale Sent: mercoledì 24 settembre 2008 16.28 To: 'OpenSceneGraph Users' Subject: Re: [osg-users] bounding box issue Thank you Robert, I will try. Gianluca. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: mercoledì 24 settembre 2008 16.02 To: OpenSceneGraph Users Subject: Re: [osg-users] bounding box issue Hi Gianluca, The OSG by defaults has small feature culling enabled, try disabling this: viewer.getCamera()-setCullingMode( viewer.getCamera()-getCullingMode() ~ osg::CullSettings::SMALL_FEATURE_CULLING); Robert. On Wed, Sep 24, 2008 at 2:52 PM, Gianluca Natale [EMAIL PROTECTED] wrote: Hi All. I have this very strange issue related to bounding boxes. I derived a class MyDrawable, from osg::Drawable. And I'm trying to make some experiments with it. I have a model containing two objects: - a cylinder, made by a bunch of points, defined as an instance of MyDrawable; - an object made by just one vertex, defined as an instance of MyDrawable. When I try to draw the model, just the cylinder is shown. I implemented the method GetBoundingBox()in MyDrawable. So, obviously, it returns a void BB for the second drawable. Does it depend on the void BB? I mean, does OSG check the dimension of the BB of an object before drawing it, and discard the object if its BB, in screen coords, becomes less than some threshold (expressed in pixels)? I suspect this behavior because, if I try to artificially enlarge the BB of the second drawable, once I zoom in I can see it on the screen. And disappear when I zoom out again. Thank you in advance. Regards, Gianluca Natale ___ 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 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.7.1/1687 - Release Date: 9/23/2008 6:32 PM ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.7.1/1687 - Release Date: 9/23/2008 6:32 PM ___ 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] matrix transformation order
On Thu, Sep 25, 2008 at 10:48 AM, David _ [EMAIL PROTECTED] wrote: up! left! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Thanks to OSG !
Hi Serge, I just booted my 32bit linux laptop to have a look at the youtube video's - very impressive demo, clearly you've been putting a lot of effort making things slick, kudos for showing the OSG the off in a very good light :-) On Thu, Sep 25, 2008 at 9:15 AM, Serge Lages [EMAIL PROTECTED] wrote: As soon as there is an OpenGL ES version of OSG. :) It just so happens I have a submission awaiting review that does an initial port of OSG to OpenGL ES. It's not a submission that will be easy to integrate so I'll probably take it bit by bit. I would also say: thanks to the ImageStreamer functionality ;))) Yeah, thanks to ImageStream and FFmpeg ! Curious... have you written a ImageStream implementation that integrates with FFmpeg? I look at this in a past be decided that xine-lib would be the a line of lesser ressistance (FFmpeg was pretty esoteric code back when I first looked at it). I'm mostly interested in what you used for the UI? Something custom? Something custom yes, osgWidget wasn't out when we started working on it, but as soon as I can I'll have a look at it. And to finish, many thanks to Robert and it's impressive support and work on OSG ! :) Thanks for the compliment ;-) It's nice to see the OSG being deployed in a way that really shows off what it's capable of when in expert hands. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Tangent, Binormal and Normal Calculation to GLSL on OSG
Hi All, I am playing RenderMonkey to create a caustics effect by morphing DiscoLighing sample. I have created something as expected and now I want to port this vertex and fragment shader to OSG. At that point RenderMonkey can automaticaly calculate Binormal and Tangent value and passes them vertex shader in attribute vec3 rm_Tangent; attribute vec3 rm_Binormal; What can I do to pass this value to vertex shader on OSG? Best Regards. Umit Uzun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Thanks to OSG !
Hi Robert, On Thu, Sep 25, 2008 at 1:22 PM, Robert Osfield [EMAIL PROTECTED]wrote: It just so happens I have a submission awaiting review that does an initial port of OSG to OpenGL ES. It's not a submission that will be easy to integrate so I'll probably take it bit by bit. It's a good news ! I would also say: thanks to the ImageStreamer functionality ;))) Yeah, thanks to ImageStream and FFmpeg ! Curious... have you written a ImageStream implementation that integrates with FFmpeg? I look at this in a past be decided that xine-lib would be the a line of lesser ressistance (FFmpeg was pretty esoteric code back when I first looked at it). I'm not the author of this code but yes it's an ImageStream implementation which use FFmpeg, and it seems it was not too hard to make it work for movies, we just had more problems with the sound. FFmpeg is really a powerfull toolkit for reading movies, but also for creating or converting them. It's nice to see the OSG being deployed in a way that really shows off what it's capable of when in expert hands. Thanks ! :) What are the specs of the hardware, OS, OSG version etc that you deployed on these touch screen systems? What API's did you use to get the touch screen data? For the two applications we have Intel Core 2 Quad processors with 2 GeForce 8900GT cards (in SLI on the single screen setup and with one screen per card on the dual screen setup - the one with the Earth -). Behind that it's a WinXP with the SVN version (from yesterday) of OSG. The screens are 46 and 57 from NEC (all full HD), with a touch capacitive film on them. And we don't use any specific API for the events, it's just like a mouse. The next step will be to handle multi-touch events, but here it will need some special API's. :) -- Serge Lages http://www.tharsis-software.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] bounding box issue
Thank you Robert, it does work! Gianluca P.S.=I will pass to newer OSG version ASAP. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: giovedì 25 settembre 2008 13.11 To: OpenSceneGraph Users Subject: Re: [osg-users] bounding box issue Hi Gianluca, I don't recall the exact details, but you'll need to get the OsgSceneHandler form the Producer::Camera, then from this get it's osgUtil::SceneView and then CullingMode on this SceneView. It's a bit convoluted but it's possible. You other route would be to just port to osgViewer, there are other examples like this one that you'll find more straight forward when using osgViewer than Producer as osgViewer doesn't need an abstraction layer ontop the OSG to integrate it - it's all native OSG code. Robert. On Thu, Sep 25, 2008 at 10:18 AM, Gianluca Natale [EMAIL PROTECTED] wrote: Actually I'm using the old Producer::camera, and I cannot find such a way to disable the SMALL FEATURE CULLING. Is there a way to do that with Producer, or the default cannot be changed at all! Thanks, Gianluca -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gianluca Natale Sent: mercoledì 24 settembre 2008 16.28 To: 'OpenSceneGraph Users' Subject: Re: [osg-users] bounding box issue Thank you Robert, I will try. Gianluca. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: mercoledì 24 settembre 2008 16.02 To: OpenSceneGraph Users Subject: Re: [osg-users] bounding box issue Hi Gianluca, The OSG by defaults has small feature culling enabled, try disabling this: viewer.getCamera()-setCullingMode( viewer.getCamera()-getCullingMode() ~ osg::CullSettings::SMALL_FEATURE_CULLING); Robert. On Wed, Sep 24, 2008 at 2:52 PM, Gianluca Natale [EMAIL PROTECTED] wrote: Hi All. I have this very strange issue related to bounding boxes. I derived a class MyDrawable, from osg::Drawable. And I'm trying to make some experiments with it. I have a model containing two objects: - a cylinder, made by a bunch of points, defined as an instance of MyDrawable; - an object made by just one vertex, defined as an instance of MyDrawable. When I try to draw the model, just the cylinder is shown. I implemented the method GetBoundingBox()in MyDrawable. So, obviously, it returns a void BB for the second drawable. Does it depend on the void BB? I mean, does OSG check the dimension of the BB of an object before drawing it, and discard the object if its BB, in screen coords, becomes less than some threshold (expressed in pixels)? I suspect this behavior because, if I try to artificially enlarge the BB of the second drawable, once I zoom in I can see it on the screen. And disappear when I zoom out again. Thank you in advance. Regards, Gianluca Natale ___ 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 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.7.1/1687 - Release Date: 9/23/2008 6:32 PM ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.7.1/1687 - Release Date: 9/23/2008 6:32 PM ___ 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 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.7.2/1689 - Release Date: 9/24/2008 6:51 PM ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] matrix transformation order
On Thu, Sep 25, 2008 at 10:48 AM, David _ [EMAIL PROTECTED] wrote: up! left! Right! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] matrix transformation order
I'll beat you all: up! left! Right! Frustum! Ha! I got all your answers and 3 more! J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] Thanks to OSG !
Cool, Nice looking stuff Serge, BTW the first vid was not there when I checked last night, ( sadly cannot access youtube from work ) Gordon __ Gordon Tomlinson Product Manager 3D Email : gtomlinson @ overwatch.textron.com __ (C): (+1) 571-265-2612 (W): (+1) 703-437-7651 Self defence is not a function of learning tricks but is a function of how quickly and intensely one can arouse one's instinct for survival - Master Tambo Tetsura From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Serge Lages Sent: Wednesday, September 24, 2008 1:39 PM To: OpenSceneGraph Users Subject: [osg-users] Thanks to OSG ! Hi all, Just a quick message to show you two applications we've just made thanks to OSG : http://www.youtube.com/watch?v=r-ydFPHL2z0 http://www.youtube.com/watch?v=P1VipShcuc0 PS : yeah, it's me on the first video... :) PS2 : for the frenchies here, you can see the walls in real at the CNES Paris (near Chatelet). -- Serge Lages http://www.tharsis-software.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgscreencapture to videobuffer async
Hi All In our application we have added the option of capturing video from our playback stream. It works fine but performance is problematic. We are currently using a simple glReadPixels call to get the immage from the videocard, this takes around 5-6 ms in addition we append the immage to an AVI video stream this takes another 12 ms. It should be possible to put the 12 in another thread, but I was vondering if it would be possible to do the same with part of the glReadPixels call using PBO's. This is what I have in mind: From the Draw thread on initialrendercallback I would: glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, read_pbo) glReadPixels() //ASYNC SignalVideoThread() //Async and the in the video recorder thread when signaled glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo); GLubyte* src = (GLubyte*)ext-glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB); AVIStream.addframe(src) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB); glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); Can someone tell me if this is feasable?, I was thinking that it would be problematic to do the gl calls from another thread? or should I use a compleately different approach? This is run on windowsXP, Core2 quad, Nvidia GX280 Brgs. Ralf Stokholm Arenalogic www.arenalogic.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgscreencapture to videobuffer async
Hi Ralf, It should be possible to put the 12 in another thread, but I was vondering if it would be possible to do the same with part of the glReadPixels call using PBO's. Check out the osgscreencapture example, I think it does exactly what you're thinking and will show you the details. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] osgscreencapture to videobuffer async
Hi Ralf, It should be possible to put the 12 in another thread, but I was vondering if it would be possible to do the same with part of the glReadPixels call using PBO's. Check out the osgscreencapture example, I think it does exactly what you're thinking and will show you the details. Err, sorry I read your message quickly and didn't see the subject, which would have told me you *did* see the osgscreencapture example! *sheepish grin* I'll let others answer your question then, but I suspect using PBOs instead of glReadPixels will be significantly faster even if you can't multithread it (which you may be able to do, not sure). Sorry for the confusion... J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] Wrong vertex count when loading OBJ files.
Hi guys, I see a strange problem when I load OBJ files. I use osg::readfilenode() to load an .obj with a known number of vertices, and then inspect the resulting node to see how many vertices was loaded, like so: //debug osg::Node* node = osgDB::readNodeFile( C:/Data/Meshes/Hand3DIS/Hand3.obj ); osg::Geode* g = dynamic_cast osg::Geode* ( node-asGroup()-getChild(0) ); osg::Geometry * gm = g-getDrawable(0)-asGeometry(); osg::Vec3Array * v = (osg::Vec3Array*) gm-getVertexArray(); std::cout verts: v-size() std::endl; I know my model has 7570 vertices (I inspected the contents of the file, and this is also reported by other obj loaders I tried). but when osg loads this file, it reports 'verts: 8369' in the code above. I need a one to one mapping between osg's vertices and the ones specified in the obj file. Does osg somehow try to automatically optimise the geometry when it is loaded, i.e create triangle strips, etc. Funny thing though, when I subsequently save the node to .obj using osg, it saves it with the correct no of vertices. Any ideas? Thanks, Morne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgscreencapture to videobuffer async
Hi Ralf, You can only do the glReadPixel call from the graphics thread so you can't thread this, all you can do is hide the cost of download from the GPU by using a double buffered PBO, as the osgscreencapture example illustrates. To thread the writing of data you'll need to have a ring buffer of imagers that the draw thread writes to, and a background writing thread reads from. Robert. On Thu, Sep 25, 2008 at 2:57 PM, Ralf Stokholm [EMAIL PROTECTED] wrote: Hi All In our application we have added the option of capturing video from our playback stream. It works fine but performance is problematic. We are currently using a simple glReadPixels call to get the immage from the videocard, this takes around 5-6 ms in addition we append the immage to an AVI video stream this takes another 12 ms. It should be possible to put the 12 in another thread, but I was vondering if it would be possible to do the same with part of the glReadPixels call using PBO's. This is what I have in mind: From the Draw thread on initialrendercallback I would: glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, read_pbo) glReadPixels() //ASYNC SignalVideoThread() //Async and the in the video recorder thread when signaled glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo); GLubyte* src = (GLubyte*)ext-glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,GL_READ_ONLY_ARB); AVIStream.addframe(src) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB); glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); Can someone tell me if this is feasable?, I was thinking that it would be problematic to do the gl calls from another thread? or should I use a compleately different approach? This is run on windowsXP, Core2 quad, Nvidia GX280 Brgs. Ralf Stokholm Arenalogic www.arenalogic.com ___ 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] matrix transformation order
i hate you all ;) Date: Thu, 25 Sep 2008 09:19:19 -0400 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] matrix transformation order I'll beat you all: up! left! Right! Frustum! Ha! I got all your answers and 3 more! J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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 _ ¿Eres un cotilla? Disfruta de todas las novedades en MSN Corazón http://entretenimiento.es.msn.com/corazon/___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] matrix transformation order
On Thu, Sep 25, 2008 at 3:24 PM, David _ [EMAIL PROTECTED] wrote: i hate you all ;) I'm afraid we know more about joking around that Matrix::decompose :-) Looking at the svn log the code is from Vivek Rajan, back in Februrary 2007, so if he's still lurking on the list he'd be the best person to answer your question. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] cullcallback and visitor ?
Hi, I'm looking at a way to determine if a node is visible (in the frustum) or not. I saw something about cullvisitor and isCulled() But, I do not understand how to implement that visitor. I saw a osg::Drawable::cullcallback ... Do I have to make my callbak ingerit from this class ? What operator do I have to define (operator()(node*, nodevisitor*) ) ? thanks a lot. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] cullcallback and visitor ?
Hi Robert, How is it possible to test directly against the view frustum ? manually ? or is there a method still implemented ? thanks. Vincent. 2008/9/25 Robert Osfield [EMAIL PROTECTED] Hi Vincent, The ways to track whether a drawable or node is in the view frustum are: 1) Attach a cull callback, if it get's called during the cull traversal then it hasn't been culled (yet). 2) Traverse the rendering back data structures (RenderStage etc) after the cull traversal so see what drawables. 3) Test the object in question directly against the view frustum. Robert. On Thu, Sep 25, 2008 at 4:15 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi, I'm looking at a way to determine if a node is visible (in the frustum) or not. I saw something about cullvisitor and isCulled() But, I do not understand how to implement that visitor. I saw a osg::Drawable::cullcallback ... Do I have to make my callbak ingerit from this class ? What operator do I have to define (operator()(node*, nodevisitor*) ) ? thanks a lot. 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] cullcallback and visitor ?
On Thu, Sep 25, 2008 at 4:23 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, How is it possible to test directly against the view frustum ? manually ? or is there a method still implemented ? thanks. You create an osg::Polytope from the Camera's view and projection matrix which will be your frustum, then transform by any transforms in the parent path to place the frustum in local coordinate, then test the objects bounding sphere/bound box against this frustum. The osgUtil::PolytopeVisitor does most of this so could learn a lot form this. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] cullcallback and visitor ?
Okay, it sound more complicated ... Just to be sure : class tileVisibleCallback : public osg::Drawable::CullCallback{ public: tileVisibleCallback(); virtual void operator()(osg::Node* node, osgUtil::CullVisitor* nv); bool isCulled(); private: bool _cull; }; Does it sound good for you ? (the mix between Cullcallback and osgUtil looks strange for me... but...) Thanks, Regards. Vincent 2008/9/25 Robert Osfield [EMAIL PROTECTED] On Thu, Sep 25, 2008 at 4:23 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, How is it possible to test directly against the view frustum ? manually ? or is there a method still implemented ? thanks. You create an osg::Polytope from the Camera's view and projection matrix which will be your frustum, then transform by any transforms in the parent path to place the frustum in local coordinate, then test the objects bounding sphere/bound box against this frustum. The osgUtil::PolytopeVisitor does most of this so could learn a lot form this. 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] 3rdParty Plugins Visual Studio 2008
Mattias Helsing [EMAIL PROTECTED] writes: Hi all,My first tries often seem to fail ;) This works and is tested with wget ftp://ftp+helsing.org at ftp.helsing.org/3rdParty_Win32Binaries_vc90.zip Mattias Hi, I'm trying to download your files but with no success - filesize of the zip is always 0... is there another location to download from? thanks rob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] cullcallback and visitor ?
So, ... it is not good : I added my visitor on a drawable : _mainChild-getDrawable(0)-setCullCallback(new tileVisibleCallback()); *** tileVisibleCallback::tileVisibleCallback(){ _cull = false; }; void tileVisibleCallback::operator()(osg::Node* node, osgUtil::CullVisitor* nv){ _cull = nv-isCulled(*node); osg::notify(osg::NOTICE)Cull _cull\n; }; bool tileVisibleCallback::isCulled(){ return _cull; }; Nothing is return as cull state... the visitor seem do be visiting nothing... Any Idea ? experience ? Thanks. Regards, Vincent. 2008/9/25 Vincent Bourdier [EMAIL PROTECTED] Okay, it sound more complicated ... Just to be sure : class tileVisibleCallback : public osg::Drawable::CullCallback{ public: tileVisibleCallback(); virtual void operator()(osg::Node* node, osgUtil::CullVisitor* nv); bool isCulled(); private: bool _cull; }; Does it sound good for you ? (the mix between Cullcallback and osgUtil looks strange for me... but...) Thanks, Regards. Vincent 2008/9/25 Robert Osfield [EMAIL PROTECTED] On Thu, Sep 25, 2008 at 4:23 PM, Vincent Bourdier [EMAIL PROTECTED] wrote: Hi Robert, How is it possible to test directly against the view frustum ? manually ? or is there a method still implemented ? thanks. You create an osg::Polytope from the Camera's view and projection matrix which will be your frustum, then transform by any transforms in the parent path to place the frustum in local coordinate, then test the objects bounding sphere/bound box against this frustum. The osgUtil::PolytopeVisitor does most of this so could learn a lot form this. 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] 2.6.1 release
GenWrapper - no. I've just done a rebuild on OSG 2.6.0 to check, and didn't get a genwrapper error message. I'm trying to reproduce this issue, and here's what I've found so far. In 2.6.1, if I right click on the 'wrappers' target and select 'build', then genwrapper is found and runs normally -- no error. However, if I remove the genwrapper executable from my system PATH and try to build 'wrappers' again, then I get an error like you describe. So, the first thing for you to check is that the genwrapper executable is in your PATH. Did you build it from a genwrapper svn tree? Where did you put the executable after you built it? Compounding this mystery, you say you tried this on 2.6, but the wrappers target didn't exist in 2.6. So I'm wondering: what is it exactly that you are doing on 2.6.1 that generates the error? If you're right clicking on 'wrappers' and selecting 'build', there's no way you could do an equivalent operation on 2.6 -- the 'wrappers' target didn't exist. In general, you shouldn't need to build the 'wrappers' target, they should already be built and checked in. However, I see they are out of date on 2.6.1 due to an osgTerrain change that I merged, so I'll work to update them before I tag the release. Thanks, -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] loading vrml segfault
Hello, There is some header information that identifies the file type. So just looking at the first few lines should identify the version. Editing the type information can make a VRML 1.0 file believe that it is a VRML 97 file. However, if there are serious errors in loading files then there is a node with a field that has changed between VRML 1.0 and VRML 97. The best place to find out such information is in the VRML 97 specification and by looking at the various documents at www.web3d.org. You have to search because the focus is on 3-D XML = X3D. So, some of the VRML stuff is buried. But all the specs are there and probably archives of the old stuff (like VRML 1.0). One simple strategy is to preprocess and input files. This can be done manually by inputting the file to Chisel [vrml syntax checker] http://www2.hrp.no/vr/tools/chisel/install.htm This will tell you what statements in the file are invalid. Then you have to just replace them with the VRML 2 equivalent. I thought that there was a VRML 1.0 to VRML 97 translator on the consortium site but can't find it. John F. Richardson -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Axelrod Sent: Wednesday, September 24, 2008 11:41 AM To: OpenSceneGraph Users Subject: Re: [osg-users] loading vrml segfault This page indicates that OpenInventor only supports VRML 1.0 files. (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Plugins) And from my own experience, OpenVRML only supports VRML 2.0 files. Can OSG handle both of these libraries at the same time? I am a little doubtful since the VRML file must be parsed before it can be determined if it is VRML 1.0 or VRML 2.0. And OpenVRML segfaults when trying to load a VRML 1.0 file. Does anyone have any experience supporting both VRML 1.0 and VRML 2.0 file types? Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bob Huebert Sent: Thursday, September 18, 2008 6:20 PM To: OpenSceneGraph Users Subject: Re: [osg-users] loading vrml segfault Hi Ben, I tried your wrl files using osg with the coin3d plugin (alternate for some of what openvrml does) and got predictable results, given your post. When bombing on the Bad.wrl file, coin kindly provided the following: % osgviewer Bad.wrl Coin read error: Unknown field mesh in VRMLShape Occurred at line 5 in Bad.wrl osgviewer: No data loaded Maybe this will help? -bob On Thu, 18 Sep 2008, Ben Axelrod wrote: When I try to load a VRML 1.0 file in OpenSceneGraph, it segfaults. I am using OpenSceneGraph 2.6, and OpenVRML 0.14.3. I have attached the file that causes the segfault, as well as the same file with some minor changes to make it run properly. The segfault happens inside: osgDB::readNodeFile(filename). It would be great if OSG could detect the error, and return properly with an invalid node. But I understand if the fault is inside of OpenVRML. Thanks, -Ben ___ 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] openGL extensions
Thank you Jean and Gordon. I put those functions in my draw callback and now I get some information. However, the behavior is very strange. It only works the first time through. The rest of the time, they return null. Even weirder is that if I click on another window, they work again for one iteration, then go back to being null. Every time I click off and on again of my OSG application, the info appears. Why is this? FYI: OSG 2.6.0 on Debian Etch with an NVidia 7300 card. Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Monday, September 22, 2008 8:12 PM To: OpenSceneGraph Users Subject: Re: [osg-users] openGL extensions Hi Ben, I would like to detect if the user has the appropriate openGL extensions in order to do shadowing. However, when I do: glGetString(GL_VERSION) glGetString(GL_EXTENSIONS) They return null. How can I get a list of the available extensions? Is there an easy way to get this info from OSG? For the first part of your question, they return NULL if they were called from a thread that does not have a graphics context. The safest way to do this is to create a camera predraw/postdraw/finaldraw callback or a node cull callback or a drawable draw callback. In each of these points you will have a graphics context. What I generally do is assume support is present and start the viewer with a detection callback attached (camera predraw callback on the main camera) which will check extensions and then remove itself from the camera. Then after the first frame, if I see that some feature is not supported, I disable the relevant options. There are other valid strategies of course. As for detecting actual extensions, instead of calling glGetString(GL_EXTENSIONS) and parsing it yourself, you can use #include osg/GLExtensions #include osg/GL2Extensions osg::isGLExtensionSupported(contextID, extensionName) Also, how do I know which extensions I need for the different shadow techniques? I'm personally not sure which extensions are required for all of them, perhaps someone else will know (it might be good to add that info to the osgShadow page on the wiki). I can tell you what I test for in the case of osgShadow::ShadowMap: _shadowsSupported = osg::isGLExtensionSupported(contextID, GL_EXT_framebuffer_object) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program)) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program_shadow) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program_shadow)); Not sure if that's totally correct, but in most cases where shadow maps were not supported (they fell back to software and so were extremely slow) it was the first (GL_EXT_framebuffer_object) which was not supported. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] Wrong vertex count when loading OBJ files.
At rendering time every polygon attribute must correspond to the polygon, so (I guess that) if a vertex of your mesh have two normal (or two color) the loader have to split in the vertexes in two. Try to load a mesh with only smooth edges and the vertexes count should be correct, than try to load a Cube, and if I'm right it should have 24 vertexes. At save time the vertexes can be grouped again. Morné Pistorius ha scritto: Hi guys, I see a strange problem when I load OBJ files. I use osg::readfilenode() to load an .obj with a known number of vertices, and then inspect the resulting node to see how many vertices was loaded, like so: //debug osg::Node* node = osgDB::readNodeFile( C:/Data/Meshes/Hand3DIS/Hand3.obj ); osg::Geode* g = dynamic_cast osg::Geode* ( node-asGroup()-getChild(0) ); osg::Geometry * gm = g-getDrawable(0)-asGeometry(); osg::Vec3Array * v = (osg::Vec3Array*) gm-getVertexArray(); std::cout verts: v-size() std::endl; I know my model has 7570 vertices (I inspected the contents of the file, and this is also reported by other obj loaders I tried). but when osg loads this file, it reports 'verts: 8369' in the code above. I need a one to one mapping between osg's vertices and the ones specified in the obj file. Does osg somehow try to automatically optimise the geometry when it is loaded, i.e create triangle strips, etc. Funny thing though, when I subsequently save the node to .obj using osg, it saves it with the correct no of vertices. Any ideas? Thanks, Morne ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org begin:vcard fn:Rosario Leonardi n:Leonardi;Rosario email;internet:[EMAIL PROTECTED] x-mozilla-html:TRUE version:2.1 end:vcard ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgscreencapture to videobuffer async
Hi Robert / Jean Thanks for the responce I realise that glReadPixel has to be called by the drawthread, but as I understand it the advantage in using pixel buffer objects should be that glReadPixel would be async and therefore return in wery short time. The actual download and cost is then put on the glMapBuffer call. If this (glMapBuffer) was possible to do this in another thread then it would safe me 5-6 ms in my primary thread. If this is not possible then the value of the async glReadPixel seams to fall. Especially since it in many cases seams to be a bit slower than a simple glReadPixel; Brgs. Ralf 2008/9/25 Robert Osfield [EMAIL PROTECTED] Hi Ralf, You can only do the glReadPixel call from the graphics thread so you can't thread this, all you can do is hide the cost of download from the GPU by using a double buffered PBO, as the osgscreencapture example illustrates. To thread the writing of data you'll need to have a ring buffer of imagers that the draw thread writes to, and a background writing thread reads from. Robert. On Thu, Sep 25, 2008 at 2:57 PM, Ralf Stokholm [EMAIL PROTECTED] wrote: Hi All In our application we have added the option of capturing video from our playback stream. It works fine but performance is problematic. We are currently using a simple glReadPixels call to get the immage from the videocard, this takes around 5-6 ms in addition we append the immage to an AVI video stream this takes another 12 ms. It should be possible to put the 12 in another thread, but I was vondering if it would be possible to do the same with part of the glReadPixels call using PBO's. This is what I have in mind: From the Draw thread on initialrendercallback I would: glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, read_pbo) glReadPixels() //ASYNC SignalVideoThread() //Async and the in the video recorder thread when signaled glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, copy_pbo); GLubyte* src = (GLubyte*)ext-glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB,GL_READ_ONLY_ARB); AVIStream.addframe(src) glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB); glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); Can someone tell me if this is feasable?, I was thinking that it would be problematic to do the gl calls from another thread? or should I use a compleately different approach? This is run on windowsXP, Core2 quad, Nvidia GX280 Brgs. Ralf Stokholm Arenalogic www.arenalogic.com ___ 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] Svn server problems?
Is anyone else getting can't connect to openscenegraph.org messages when trying to do an svn update? Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com http://www.skew-matrix.com/ +1 303 859 9466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Svn server problems?
Hi Paul, Is anyone else getting can't connect to openscenegraph.org messages when trying to do an svn update? Yep, even the web site and wiki (makes sense if they're on the same server). J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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] openGL extensions
Ben Axelrod wrote: Thank you Jean and Gordon. I put those functions in my draw callback and now I get some information. However, the behavior is very strange. It only works the first time through. The rest of the time, they return null. Even weirder is that if I click on another window, they work again for one iteration, then go back to being null. Every time I click off and on again of my OSG application, the info appears. Why is this? Draw callbacks are only called when the node is drawn. If you are using display lists (OSG does by default), then the draw is called only on the first draw or when the context is initialized. All other draws are done using the cached display list. You need to disable display lists on your drawable with setUseDisplayList( false ). Hope this helps, --Will FYI: OSG 2.6.0 on Debian Etch with an NVidia 7300 card. Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Monday, September 22, 2008 8:12 PM To: OpenSceneGraph Users Subject: Re: [osg-users] openGL extensions Hi Ben, I would like to detect if the user has the appropriate openGL extensions in order to do shadowing. However, when I do: glGetString(GL_VERSION) glGetString(GL_EXTENSIONS) They return null. How can I get a list of the available extensions? Is there an easy way to get this info from OSG? For the first part of your question, they return NULL if they were called from a thread that does not have a graphics context. The safest way to do this is to create a camera predraw/postdraw/finaldraw callback or a node cull callback or a drawable draw callback. In each of these points you will have a graphics context. What I generally do is assume support is present and start the viewer with a detection callback attached (camera predraw callback on the main camera) which will check extensions and then remove itself from the camera. Then after the first frame, if I see that some feature is not supported, I disable the relevant options. There are other valid strategies of course. As for detecting actual extensions, instead of calling glGetString(GL_EXTENSIONS) and parsing it yourself, you can use #include osg/GLExtensions #include osg/GL2Extensions osg::isGLExtensionSupported(contextID, extensionName) Also, how do I know which extensions I need for the different shadow techniques? I'm personally not sure which extensions are required for all of them, perhaps someone else will know (it might be good to add that info to the osgShadow page on the wiki). I can tell you what I test for in the case of osgShadow::ShadowMap: _shadowsSupported = osg::isGLExtensionSupported(contextID, GL_EXT_framebuffer_object) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program)) (osg::isGLExtensionSupported(contextID, GL_ARB_fragment_program_shadow) || osg::isGLExtensionSupported(contextID, GL_EXT_fragment_program_shadow)); Not sure if that's totally correct, but in most cases where shadow maps were not supported (they fell back to software and so were extremely slow) it was the first (GL_EXT_framebuffer_object) which was not supported. Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] 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 smime.p7s Description: S/MIME Cryptographic Signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Thanks to OSG !
Serge Lages wrote: Hi all, Just a quick message to show you two applications we've just made thanks to OSG : http://www.youtube.com/watch?v=r-ydFPHL2z0 http://www.youtube.com/watch?v=P1VipShcuc0 PS : yeah, it's me on the first video... :) PS2 : for the frenchies here, you can see the walls in real at the CNES Paris (near Chatelet). looks great, gratulation! :) whats up with your http://www.magrathea-engine.org/v2/ best regards ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Update a texture's pixels contents, using apply or glTexSubImage2D
Hi I have set up a DirectShow graph that grabs frames from a web cam. This graph executes asynchronously from Open Scene Graph, and the idea is to copy the output to the pixels of a TextureRectangle's image (so that each rendered frame shows the webcam feed on a 3d plane). I would have done this by calling glTexSubImage2D before binding the TextureRectangle, but being new to OSG, some of its functionality still eludes me, especially everything related to the apply() function, which I believe is what I have to do (?). In short, how could I update the texture's pixels with whatever the webcam graph has ready at each frame? Thank in advance, Guillaume Langlois ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] loading vrml segfault
Hello, Probably windows only but Octaga has a free tool for converting from vrml1 to vrml 97 : http://www.octaga.com/freedownloads/Vrml10to20/VRML10To20.zip It comes with absolutely no guarantees and no warranty. John F. Richardson -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John F. Richardson Sent: Thursday, September 25, 2008 10:15 AM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] loading vrml segfault Hello, There is some header information that identifies the file type. So just looking at the first few lines should identify the version. Editing the type information can make a VRML 1.0 file believe that it is a VRML 97 file. However, if there are serious errors in loading files then there is a node with a field that has changed between VRML 1.0 and VRML 97. The best place to find out such information is in the VRML 97 specification and by looking at the various documents at www.web3d.org. You have to search because the focus is on 3-D XML = X3D. So, some of the VRML stuff is buried. But all the specs are there and probably archives of the old stuff (like VRML 1.0). One simple strategy is to preprocess and input files. This can be done manually by inputting the file to Chisel [vrml syntax checker] http://www2.hrp.no/vr/tools/chisel/install.htm This will tell you what statements in the file are invalid. Then you have to just replace them with the VRML 2 equivalent. I thought that there was a VRML 1.0 to VRML 97 translator on the consortium site but can't find it. John F. Richardson -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Axelrod Sent: Wednesday, September 24, 2008 11:41 AM To: OpenSceneGraph Users Subject: Re: [osg-users] loading vrml segfault This page indicates that OpenInventor only supports VRML 1.0 files. (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Plugins) And from my own experience, OpenVRML only supports VRML 2.0 files. Can OSG handle both of these libraries at the same time? I am a little doubtful since the VRML file must be parsed before it can be determined if it is VRML 1.0 or VRML 2.0. And OpenVRML segfaults when trying to load a VRML 1.0 file. Does anyone have any experience supporting both VRML 1.0 and VRML 2.0 file types? Thanks, -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bob Huebert Sent: Thursday, September 18, 2008 6:20 PM To: OpenSceneGraph Users Subject: Re: [osg-users] loading vrml segfault Hi Ben, I tried your wrl files using osg with the coin3d plugin (alternate for some of what openvrml does) and got predictable results, given your post. When bombing on the Bad.wrl file, coin kindly provided the following: % osgviewer Bad.wrl Coin read error: Unknown field mesh in VRMLShape Occurred at line 5 in Bad.wrl osgviewer: No data loaded Maybe this will help? -bob On Thu, 18 Sep 2008, Ben Axelrod wrote: When I try to load a VRML 1.0 file in OpenSceneGraph, it segfaults. I am using OpenSceneGraph 2.6, and OpenVRML 0.14.3. I have attached the file that causes the segfault, as well as the same file with some minor changes to make it run properly. The segfault happens inside: osgDB::readNodeFile(filename). It would be great if OSG could detect the error, and return properly with an invalid node. But I understand if the fault is inside of OpenVRML. Thanks, -Ben ___ 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] cullcallback and visitor ?
Vincent Bourdier wrote: _mainChild-getDrawable(0)-setCullCallback(new tileVisibleCallback()); *** tileVisibleCallback::tileVisibleCallback(){ _cull = false; }; void tileVisibleCallback::operator()(osg::Node* node, osgUtil::CullVisitor* nv){ _cull = nv-isCulled(*node); osg::notify(osg::NOTICE)Cull _cull\n; }; bool tileVisibleCallback::isCulled(){ return _cull; }; You're mixing up osg::Drawable::CullCallback and osg::NodeCallback and consequently osg::Node::setCullCallback and osg::Drawable::setCullCallback. osg::Drawable::CullCallback has a virtual cull() function that tells if the Drawable *should* be culled by returning true or false. osg::NodeCallback has a virtual operator() that does what you want. You need to derive your callback from osg::NodeCallback, implement operator() (as you already do), and call: _mainChild-setCullCallback(...) instead of _mainChild-getDrawable(0)-setCullCallback(...) Hope this helps, /ulrich 2008/9/25 Vincent Bourdier [EMAIL PROTECTED] class tileVisibleCallback : public osg::Drawable::CullCallback{ public: tileVisibleCallback(); virtual void operator()(osg::Node* node, osgUtil::CullVisitor* nv); bool isCulled(); private: bool _cull; }; Does it sound good for you ? (the mix between Cullcallback and osgUtil looks strange for me... but...) ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 2d texture messed up in big scene using OSG 2.6
Hi, All I meet a weird problem when using OSG 2.6. Some texture messed up when the scene contains lots of node( osg::Geode ). If the main camera is near the node, its texture shows OK, but when the camera comes far, the node's texture turn to be others' texture which is wrong. I wonder if there is a num limit of texture 2d in OpenGL , OSG or Graphics Card? Or it occured by incrrect memeroy allocation? I'm using OSG 2.6 in VC 2003, Windows XP SP3. Any kind of help or hint would be appreciated. 2008-09-26 Leeten ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org