[osg-users] How to delete a NodeCallback*?
Hi, //simply define a node and a NodeCallback osg::Node* node = new osg::Node; osg::NodeCallback* nc = new osg::NodeCallback; //setup the nodecallback,no problem node - setUpdateCallBack(nc ); //remove the nodecallback,no problem node - setUpdateCallBack(NULL); or node - removeUpdateCallBack(nc ); //want to release the osg::NodeCallback* memory ,crash every time! if (nc ) delete nc; Don't know why,need help! ... Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33283#33283 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to delete a NodeCallback*?
On 2/11/10 17:40 , Lv Qing wrote: //setup the nodecallback,no problem node - setUpdateCallBack(nc ); //remove the nodecallback,no problem node - setUpdateCallBack(NULL); or node - removeUpdateCallBack(nc ); //want to release the osg::NodeCallback* memory ,crash every time! if (nc ) delete nc; Yeah, don't do that. Don't know why,need help! You're holding a raw pointer to a reference counted object. The reference count drops to zero when you call 'setUpdateCallback(NULL)' or 'removeUpdateCallback()' which deletes the object. When you then call 'delete nc' you try to delete an already deleted object. Use osg::ref_ptr. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to delete a NodeCallback*?
Hi Lv, You will never need to manually delete your node callback object, because it is manged by ref_ptr when added with setUpdateCallback(). It will be automatically released when no nodes referencing it (that is why your application crashes when you explicitly deleted it again, which is already a dangling pointer). Cheers, Wang Rui 2010/11/2 Lv Qing donlvq...@msn.com: Hi, //simply define a node and a NodeCallback osg::Node* node = new osg::Node; osg::NodeCallback* nc = new osg::NodeCallback; //setup the nodecallback,no problem node - setUpdateCallBack(nc ); //remove the nodecallback,no problem node - setUpdateCallBack(NULL); or node - removeUpdateCallBack(nc ); //want to release the osg::NodeCallback* memory ,crash every time! if (nc ) delete nc; Don't know why,need help! ... Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33283#33283 ___ 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] OT: VS2010 LNK2005 problem related to ostringstream
I don't think MS considers this to be a problem. It is by design. Not being able to derive from ANY stl classes is quite serious if you ask me. Fiddling around with allowing multiple symbols and other hacks does not really present it self as a stable and viable solution. I managed to get around deriving from std::string by making it a pure template implementation, not using any dllimport/dllexport directives. That worked (of course). But as soon as you derive the interface, export it in a dll-file, it does not work. Unless you instantiate all symbols inside the dll. Then it get the correct linkage. Its really the mix between template and non-template code that causes the problem. I don't think we can expect a solution for this any time soon. Unless someone has a brother working as a manager at the vs2010 team? :-) Also, Incredibuild is heavily delayed for vs2010 (~4 months still encounting), seems that they have problems of the port over to vs2010 too. /Anders ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setUpdateCallback fails under slave-camera
Hi Timm, I ran into a similar problem to what you have and solved it without having to modify the OSG Core source code. The problem is that osgViewer does not do eventTraversal and updateTraversal on the slave's subgraph regardless if they are using the mastersSceneData or not. I'm submitting a fix to this on osg-submission today, so hopefully it will be a part of the next OSG release. To get around the problem you can add an eventCallback and a updateCallback to the slave camera that is not using the mastersSceneData and modify the traversal mode of the visitor within the callback to traverse the camera's subgraph. class SlaveCameraUpdateCallback : public osg::NodeCallback { public: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { if(nv-getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) { osg::NodeVisitor::TraversalMode tm = nv-getTraversalMode(); nv-setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN); traverse(node,nv); nv-setTraversalMode(tm); } else { traverse(node,nv); } } }; { //Rigging up slave camera with it's own subgraph viewer.addSlave(camera,false); //Set updateCallback for camera to ensure subgraph updateTraversal camera-setUpdateCallback(new SlaveCameraUpdateCallback); } Filip On Mon, Jul 20, 2009 at 5:25 PM, Timm Linder timmlin...@yahoo.de wrote: Hi Robert, I'm picking up this somewhat outdated topic since we are having a similar problem. We need to render some of our geometry with a separate depth buffer because of precision issues: In the first pass, we are rendering a very large landscape that was created using VirtualPlanetBuilder. This puts the far clipping plane very far away from the viewer. Then, however, we need to draw some objects that are flying very close to the camera and need a lot of precision here. This is what makes us require a second rendering pass with a separate depth buffer and projection matrix (where the far plane is very close to the eye point). It is guaranteed that this geometry is always above the landscape, so we need no further sorting here. In both passes, we require our update callbacks to work. As should have become clear from my description, the master and slave camera do not share their geometry. Do you think there is a way of making the update callbacks work in the slave camera *without* tampering with the original OSG Core source code? Any hint would be greatly appreciated. Thanks a lot for your help, Timm -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15145#15145 ___ 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] glGetString(GL_VENDOR) return null
Hi, I've been reading similar problems, but I have not Found the solution ... the viewer is set in singlethreaded, and I added the GraphicsContext at the camera properly ... Code: // construct the viewer. int width = 800; int height = 600; osgViewer::Viewer viewer; viewer.addEventHandler(keh); viewer.setCameraManipulator(new osgGA::TrackballManipulator()); viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); int xoffset = 40; int yoffset = 40; osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = xoffset + 0; traits-y = yoffset + 0; traits-width = 600; traits-height = 480; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setGraphicsContext(gc.get()); camera-setViewport(new osg::Viewport(0,0, traits-width, traits-height)); GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT; camera-setDrawBuffer(buffer); camera-setReadBuffer(buffer); // add this slave camera to the viewer, with a shift left of the projection matrix viewer.setCamera(camera.get()); viewer.setSceneData(scene); viewer.realize(); const char* vendorString = reinterpret_castconst char*(glGetString(GL_VENDOR)); //return NULL Why I can't access the graphics card info? Thank you! Cheers, Aitor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33289#33289 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG ActiveX + IFC - looking for developer
Hi, On 29 October 2010 17:03, Chris 'Xenon' Hanson xe...@alphapixel.com wrote: I spoke to the person I'd previously been contacted by, concerning the IFC loader. They have not moved forward on the project yet, so as far as I know, there is not an IFC loader project for OSG. There is at least a closed source one I know about. The main issue is in handling the CSG part in the IFC geometrical definitions. Regards, Mathieu ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetString(GL_VENDOR) return null
Hi Ardanza, Try makeCurrent() before any OpenGL calls: gc-makeCurrent(); glGetString(...); gc-releaseContext(); Cheers, Wang Rui ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetString(GL_VENDOR) return null
Not work... the same problem. Thanks for the reply! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33293#33293 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hiding objects from a cloned scenegraph hides the original...
Hi Ted, A shallow copy will share as much as possible of the data below the object you are calling clone on. Only a deep copy will force the data itself to be copied. As a general note, you want to avoid duplicating data as much as possible, so share as much as possible. In you case it might not be necessary to clone anything and share the whole scene graph between views. You can use a combination of NodeMask and Camera CullMask (see osg::CullSetting from which osg::Camera is derived), to enable each view to just see a portion of the scene. Robert. On Mon, Nov 1, 2010 at 9:34 PM, Ted Morris ted.mor...@gmail.com wrote: Hi, I am cloning a scenegraph for a 2nd viewer for osgCompositeView. Everytime I setNodeMask(0x0) to some objects that is part of the cloned node the objects in the original disappears as well, unless it is a CopyOp::DEEP_COPY_ALL. The problem with using DEEP_COPY_ALL is that it makes the UpdateCallback process a mess-- since I then have to contrive other mechanisms to tie in the existing, callbacks for objects in the original scene with the 'secondary' view's cloned scene graph. Or, I have to end up walking the scenegraph tree, and doing appropriate clone level flags, one by one?? Thanks to all in advance! Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33279#33279 ___ 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] Real-Time geometry editing - changing positions
Hi Simon, OpenGL doesn't allow you to change state in the middle of rendering a primitive, let alone per vertex. The only way to change material per vertex would be to have a single vertex per osg::Geometry, but this isn't going to work if you want you vertices to be meshed in anyway... What it really sounds like what you need to focus on modifying the osg::Image assocaited with a Texture that is applied to the geometry. You could use multi-texturing if you wish to overlay you painted texture on top. The osgmovie example has an example of how to get the texture coordinates from the current mouse position, you could use this to index into an osg::Image. Another approach might be to use an FrameBufferObject + Texture combination where you render into the Texture the brush stroke and then apply this Texture over the geometry. This approach you keep everything down on the GPU until you finally want to read back the result. Robert. On Mon, Nov 1, 2010 at 10:45 PM, Simon Kolciter simon@gmail.com wrote: Hi, I have another problem with this. In a vertices array assigned to a Geometry object, I want to assign different materials to vertices = use a brush to give this texture to this vertex, that textrue to that vertex etc...just like you in the Crysis Editor, for example. 1. Is there a way to configure the StateSet object or the Geometry object to somehow tell each vertex what texture it should use (given I don't want to change the order of the vertices - which I fear I will have to)? 2. Won't this be a bit of a problem for the performance? 3. The edited model has a spherical shape, so I would like the textures to be displayed as in a spherical environment. Is there a way to compute the TexCoord Vec2's in a similar way as UVW Map modifier for max, but in real time? I know that doing this stuff would be easier in an existing editor and just exporting, but I am making an editor that is supposed to this real time. Btw thanks Skylark for the answer earlier Thank you! Cheers, Simon -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33281#33281 ___ 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] glGetString(GL_VENDOR) return null
HI Aitor, It sounds like you are trying to do an OpenGL call without a context current. Using makeCurrent sound solve this. Personally I find the approach of stick OpenGL calls directly in a main thread not idea. It's not flexible and make assumptions that will easily be broken by small changes in code elsewhere. I would recommend using a RealizeOperation, this will get called for each context on your viewer when they get realized, this approach works just fine with multiple context and threading. Robert. On Tue, Nov 2, 2010 at 8:45 AM, Aitor Ardanza aitoralt...@terra.es wrote: Hi, I've been reading similar problems, but I have not Found the solution ... the viewer is set in singlethreaded, and I added the GraphicsContext at the camera properly ... Code: // construct the viewer. int width = 800; int height = 600; osgViewer::Viewer viewer; viewer.addEventHandler(keh); viewer.setCameraManipulator(new osgGA::TrackballManipulator()); viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); int xoffset = 40; int yoffset = 40; osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = xoffset + 0; traits-y = yoffset + 0; traits-width = 600; traits-height = 480; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setGraphicsContext(gc.get()); camera-setViewport(new osg::Viewport(0,0, traits-width, traits-height)); GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT; camera-setDrawBuffer(buffer); camera-setReadBuffer(buffer); // add this slave camera to the viewer, with a shift left of the projection matrix viewer.setCamera(camera.get()); viewer.setSceneData(scene); viewer.realize(); const char* vendorString = reinterpret_castconst char*(glGetString(GL_VENDOR)); //return NULL Why I can't access the graphics card info? Thank you! Cheers, Aitor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33289#33289 ___ 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] How to delete a NodeCallback*?
Hi, ... Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33297#33297 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGs OpenGLES 2.0 status
Hi Christian, On Fri, Oct 29, 2010 at 2:25 PM, Christian Ruzicka c.ruzi...@gmx.de wrote: I also saw the thread regarding the ShaderComposer, its design and the feature set: Shader composition, OpenGL modes and custom modes (I'm not allowed to post links yet) The last post in this thread was in July. Are there any news regarding the implementation? Sorry for not replying sooner, I've been rather rushed off my feet at home and with work. Due to client work commitments over the last couple of months I haven't been able to tackle the completion of my Shader Composition work. There is the beginnings already checked into svn/trunk and the osgshadercomposition provides a little glimpse into some the classes. The work is far from finished though and isn't for prime time usage, and doesn't yet fulfill the role of a flexible shader composition or a means of seamlessly implementing the old fixed function pipeline functionality in shaders. I have previous set this features as must have features for the next stable release, and it'll likely take me another month of my time entirely focused on the issue of shader composition to put it bed. When I get this month is hard to pin down right now as I continue to have client commitments that pay the roof over my head and the food on the table ;-) In next couple of days I will be writing about the topic of next release and will mention shader composition there. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetString(GL_VENDOR) return null
Hi robertosfield! Ok, I find a good example on osgShaderTerrain code! Thanks!!! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33299#33299 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Video capture with 3D augmented reality
I am trying to solve this problem more or less as you proposed: * I have a quad with a texture that is my input video (input images are 640 x 480) * The first camera (with depth and color clear masks) looks at the quad and renders to the same image (I'm not sure if this is useful; it feels like an extra unnecessary step to me). The projection matrix is an orthogonal 640 x 480 matrix, the view matrix is an identity matrix. * The second camera (with only depth clear mask) looks at the scene and renders this to the same image. The projection and view matrices were recorded during the recording of the input video. Both camera's use the COLOR_BUFFER. I use a NodeCallback as an UpdateCallback to my quad. This callback refreshes the quad texture with a new video image and updates the projection and view matrices of the second camera. I also set two final draw callbacks for each camera; just to see the contents of the image (i.e. I call writeImageFile). For the first camera (this final draw callback is called first), I write to file1.bmp and for the second camera I write to file2.bmp. My scene consists of a cylinder and a 2D picture that cuts the cylinder in the middle. I see that file1.bmp is what I expected: a video stream image is rendered into the image. file2.bmp is another case (this one is saved when the second camera has done drawing). I don't see my video stream (input) image anymore (has been cleared somehow) and the 3D data is rendered on top of each other (due to disabling of GL_COLOR_BUFFER_BIT ?). I have the impression that somehow two color buffers are used at the same time; one for the first camera and one for the second camera. Still, it's clear in the code that I attach both camera's to osg::Camera::COLOR_BUFFER with the same image (m_VideoImage). How is this possible ? Here is the code: Code: void VideoRecThread::setupTexture() { m_RenderTexture = new osg::Texture2D; m_RenderTexture-setTextureSize(640, 480); m_RenderTexture-setInternalFormat(GL_RGBA); m_RenderTexture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); m_RenderTexture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); m_RenderTexture-setDataVariance(osg::Object::DYNAMIC); } void VideoRecThread::setupGeometry() { osg::Geometry* polyGeom = new osg::Geometry(); osg::ref_ptrosg::Geometry screenQuad; screenQuad = createTexturedQuadGeometry(osg::Vec3(), osg::Vec3(640, 0.0, 0.0), osg::Vec3(0.0, 480, 0.0), 0.0f, 1.0f, 1.0f, 0.0); m_QuadGeode = new osg::Geode; m_QuadGeode-addDrawable(screenQuad.get()); screenQuad-setName(PolyGeom); screenQuad-setDataVariance( osg::Object::DYNAMIC ); screenQuad-setSupportsDisplayList(false); osg::StateSet* stateset = new osg::StateSet; stateset-setTextureAttributeAndModes(0, m_RenderTexture,osg::StateAttribute::ON); screenQuad-setStateSet(stateset); } void VideoRecThread::setupImages() { m_VideoImage = new Image(); m_VideoImage-allocateImage(640,480,1, GL_RGBA, GL_UNSIGNED_BYTE); } void VideoRecThread::setupHudCamera() { m_pHudCamera = new osg::Camera; m_pHudCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pHudCamera-setProjectionMatrix(osg::Matrix::ortho2D(0, 640, 0, 480)); m_pHudCamera-setViewMatrix(osg::Matrix::identity()); m_pHudCamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pHudCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); m_pHudCamera-setViewport(0,0,640,480); m_pHudCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); m_pHudCamera-attach(osg::Camera::COLOR_BUFFER, m_VideoImage); m_pVideoRecGroup-addChild(m_pHudCamera.get()); m_pHudCamera-addChild(m_QuadGeode); m_TextureUpdateCallback = new TextureCallback(); m_TextureUpdateCallback-updateTexture.connect(boost::bind(VideoRecThread::updateTexture,this)); m_QuadGeode-setUpdateCallback(m_TextureUpdateCallback); m_TextureCallback = new VideoPostDrawCallback(); m_TextureCallback-renderingCompleted.connect(boost::bind(VideoRecThread:videoRenderingCompleted,this)); m_pHudCamera-setFinalDrawCallback(m_TextureCallback); } void VideoRecThread::setupSnapshotCamera() { m_pSnapshotcamera = new osg::Camera(); m_pSnapshotcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pSnapshotcamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pSnapshotcamera-setClearMask(GL_DEPTH_BUFFER_BIT); m_pSnapshotcamera-setViewport(0,0,640,480); m_pSnapshotcamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); m_pSnapshotcamera-attach(osg::Camera::COLOR_BUFFER, m_VideoImage); osg::ref_ptrosg::Node pScene = getSceneManager()-getSceneData(); m_pSnapshotcamera-addChild(pScene);
Re: [osg-users] [forum] Video capture with 3D augmented reality
Hi, On 02/11/10 13:05, benedikt naessens wrote: I am trying to solve this problem more or less as you proposed: * I have a quad with a texture that is my input video (input images are 640 x 480) * The first camera (with depth and color clear masks) looks at the quad and renders to the same image (I'm not sure if this is useful; it feels like an extra unnecessary step to me). The projection matrix is an orthogonal 640 x 480 matrix, the view matrix is an identity matrix. yes, you can probably get away with a quad geometry absolutely aligned and disabled depth writing. * The second camera (with only depth clear mask) looks at the scene and renders this to the same image. The projection and view matrices were recorded during the recording of the input video. Both camera's use the COLOR_BUFFER. I use a NodeCallback as an UpdateCallback to my quad. This callback refreshes the quad texture with a new video image and updates the projection and view matrices of the second camera. I also set two final draw callbacks for each camera; just to see the contents of the image (i.e. I call writeImageFile). For the first camera (this final draw callback is called first), I write to file1.bmp and for the second camera I write to file2.bmp. My scene consists of a cylinder and a 2D picture that cuts the cylinder in the middle. I see that file1.bmp is what I expected: a video stream image is rendered into the image. file2.bmp is another case (this one is saved when the second camera has done drawing). I don't see my video stream (input) image anymore (has been cleared somehow) and the 3D data is rendered on top of each other (due to disabling of GL_COLOR_BUFFER_BIT ?). No, the bit only affects the clearing of the buffer. I have the impression that somehow two color buffers are used at the same time; one for the first camera and one for the second camera. Still, it's clear in the code that I attach both camera's to osg::Camera::COLOR_BUFFER with the same image (m_VideoImage). How is this possible ? Here is the code: Code: void VideoRecThread::setupTexture() { m_RenderTexture = new osg::Texture2D; m_RenderTexture-setTextureSize(640, 480); m_RenderTexture-setInternalFormat(GL_RGBA); m_RenderTexture-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR); m_RenderTexture-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR); m_RenderTexture-setDataVariance(osg::Object::DYNAMIC); } void VideoRecThread::setupGeometry() { osg::Geometry* polyGeom = new osg::Geometry(); osg::ref_ptrosg::Geometry screenQuad; screenQuad = createTexturedQuadGeometry(osg::Vec3(), osg::Vec3(640, 0.0, 0.0), osg::Vec3(0.0, 480, 0.0), 0.0f, 1.0f, 1.0f, 0.0); m_QuadGeode = new osg::Geode; m_QuadGeode-addDrawable(screenQuad.get()); screenQuad-setName(PolyGeom); screenQuad-setDataVariance( osg::Object::DYNAMIC ); screenQuad-setSupportsDisplayList(false); osg::StateSet* stateset = new osg::StateSet; stateset-setTextureAttributeAndModes(0, m_RenderTexture,osg::StateAttribute::ON); screenQuad-setStateSet(stateset); } void VideoRecThread::setupImages() { m_VideoImage = new Image(); m_VideoImage-allocateImage(640,480,1, GL_RGBA, GL_UNSIGNED_BYTE); } void VideoRecThread::setupHudCamera() { m_pHudCamera = new osg::Camera; m_pHudCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pHudCamera-setProjectionMatrix(osg::Matrix::ortho2D(0, 640, 0, 480)); m_pHudCamera-setViewMatrix(osg::Matrix::identity()); m_pHudCamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pHudCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); m_pHudCamera-setViewport(0,0,640,480); m_pHudCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); m_pHudCamera-attach(osg::Camera::COLOR_BUFFER, m_VideoImage); m_pVideoRecGroup-addChild(m_pHudCamera.get()); m_pHudCamera-addChild(m_QuadGeode); m_TextureUpdateCallback = new TextureCallback(); m_TextureUpdateCallback-updateTexture.connect(boost::bind(VideoRecThread::updateTexture,this)); m_QuadGeode-setUpdateCallback(m_TextureUpdateCallback); m_TextureCallback = new VideoPostDrawCallback(); m_TextureCallback-renderingCompleted.connect(boost::bind(VideoRecThread:videoRenderingCompleted,this)); m_pHudCamera-setFinalDrawCallback(m_TextureCallback); } void VideoRecThread::setupSnapshotCamera() { m_pSnapshotcamera = new osg::Camera(); m_pSnapshotcamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pSnapshotcamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pSnapshotcamera-setClearMask(GL_DEPTH_BUFFER_BIT); m_pSnapshotcamera-setViewport(0,0,640,480); m_pSnapshotcamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
Re: [osg-users] Performance problem with osgTerrain
Hi Brad, Your changes and merged and submitted to svn/trunk. I changed the Terrain method name to getEqualizeBoundaries() to fit with the variable name and make the reading of code flow better when the method is used in an if statement. I've also commented in your if (terrain and terrain-getEqualizeBoundaries()) code so that it's now functional, and added a comment to the Terrain header explaining EqualizeBoundaries and the database condition under which is can operate. For the time being I've left the default value of Terrain::_equalizeBoundaries to false as per your submission, which is change from the original behavior where the boundary equalization was always on if the TileID's were in the database. My plan is sort out the performance issues with doing boundary equalization and then re-enable this feature, I won't be able to tackle this right away though. Robert. On Thu, Oct 7, 2010 at 5:22 PM, Christiansen, Brad brad.christian...@thalesgroup.com.au wrote: Hi Robert, I have added the new function as suggested. The change was made against trunk from an hour or so ago. I haven't tested the performance yet (and probably won't get a chance till next week) but I have checked my terrains still work. I defaulted the equalization to off as I thought this was best until we can look into why there is the performance hit. I have sent this message to submissions as well. Cheers, Brad -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Wednesday, 6 October 2010 10:33 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Performance problem with osgTerrain Hi Fabien, On Wed, Oct 6, 2010 at 2:13 PM, Fabien Lavignotte fabien.lavigno...@vegatechnologies.fr wrote: We are testing in release build. And we have the same result on windows and linux. The high cost is a little bit surprising but i didn't have time to investigate further. So, the idea is add a flag on osgTerrain (hum set/getProcessNeigbours maybe?) Terrain::set/getBoundaryEqualization(bool) would be my choice for naming. I'm busy with other tasks right now so can't tackle this, feel free to dive and add it ;-) On the performance side, one thing I've planned for osgTerrain::GeometryTechnique is to split off the boundary mesh parts from the central mesh for each tile, so that when you have to rebuild the boundaries you don't need to rebuild the central mesh. This change should make it possible to keep the cost of boundary equalization much lower. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -- ___ 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] Video capture with 3D augmented reality
Already thanks for all the effort you have put in this ! I set the threading model of my viewers (I have two in my application) to osgViewer::ViewerBase::SingleThreaded. Is this what you meant with forcing OSG to singlethreaded ? I also introduced now a snapshot image where the first and second camera write to (using the aforementioned techniques : attached with the COLOR_BUFFER component). Both (at the same time or not) didn't help. I have set the clear color of the second camera (m_Snapshotcamera) to red (using the setClearColor function of the camera). I don't see any red in file2.bmp, so I think there is no clearing issue. About your remark about the clearing of the buffer: if the buffer is not cleared, then this translates into the output image, right ? Or am I mistaken ? This could explain somehow the overlapping 3D data ? On the other hand, I am sure that both final drawing callbacks are called (and in the right order), so this still doesn't explain why my input video image is gone in file2.bmp. Strange. I'm a bit without ideas right now. Any other ideas ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33311#33311 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Video capture with 3D augmented reality
Can this thread be moved to the general OSG forum ? I made the mistake of putting this in the OpenSceneGraph forum forum. Thank you! Cheers, benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33313#33313 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to catch openGL errors
Hi, What is the best way to catch openGL errors? My scenegraph uses osg::PagedLOD nodes and in some cases it happens that GPU goes out-of-memory and I can see this message on std::cout. I would like to catch this error and adjust PagedLOD settings to have less nodes in the scene. My idea is to catch the error, change the osg::PagedLOD::setRange and clear the scene to free currently used GPU memory. How can I catch the error and free occupied memory? Can the openGL error be catched by subclassed osg::Drawable::DrawCallback to all drawables ? Thank you! Tomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33314#33314 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Hi all, i correctly installed osg 2.8.1 (by apt - ubuntu/debian package manager) and bullet physics 2.76 building the sources. When i tried to load a sketuchup file (.skp) osgviewer reported an error. I read that i need collada-dom to load this kind of model. Is it right? However, i also tried to build collada, but there are a lot of bugs for linux and seem to be no more supported... i fixed some of them but not all. So i seen that bulet physics 2.75 (an older version) have collada included in its sources and i tried to build it too :P (hope successfully). Now i think i have to re-installe the osg by sources selecting also the collada plugin. Is this right? Since i installed in past also osgWorks and osgBullet, and had some problem with bullet physics, i think there's a lot of garbage in my libraries and maybe i need to reinstall the whole Ubuntu... To prevent future problems can anyone answer to next questions? 1) Does OSG need collada to load sketchup files? 2) Is there anyone who succesfully installed collada-dom on ubuntu/linux? 3) can anyone provide me a link to a really good tutorial to install collada-dom and load sketchup files using osg? I'm quite desperate, i've lost a lot of days... :-( Thank you! Cheers, Axel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33315#33315 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to catch openGL errors
Hi Thomas, There isn't presently a mechanism for throwing an OSG exception or calling a callback when GL errors happen. By default the OSG checks for GL Errors every frame and reports these to the console. You can however, write your own camera post draw callback, or drawable draw callback to check for GL errors. However, trying to fix a problem after you've already run out of memory is trying to close the barn door after the horse has already bolted. What you should be looking at is ways of better load balancing so that the GL memory is never exhausted. The latest dev and sev/trunk version or the OSG has support for GL buffer objects pools that you can assign limits to, when enabled the object pool will expand till it's full and then restart automatically reusing GL objects to prevent the usage going above the user defined limit. Have a look at OSG_TEXTURE_POOL_SIZE env var for setting the maximum size in bytes of the pool, setting it to 0 disable it. Also can set it via osg::State::setMaxTexturePoolSize(uint); Robert. On Tue, Nov 2, 2010 at 2:14 PM, Tomas Hnilica tomas.hnil...@webstep.net wrote: Hi, What is the best way to catch openGL errors? My scenegraph uses osg::PagedLOD nodes and in some cases it happens that GPU goes out-of-memory and I can see this message on std::cout. I would like to catch this error and adjust PagedLOD settings to have less nodes in the scene. My idea is to catch the error, change the osg::PagedLOD::setRange and clear the scene to free currently used GPU memory. How can I catch the error and free occupied memory? Can the openGL error be catched by subclassed osg::Drawable::DrawCallback to all drawables ? Thank you! Tomas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33314#33314 ___ 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] OSG, bullet physics, collada and sketchup models on Ubuntu
Hi Axel, OSG can't load .skp files with collada plugin, you must use collada models (.dae) also downloadables form google wharehouse. About compiling the plugin you have to pay attention to the dom version used, take a look to [1] to get collada plugin compiled. We are using collada models on Ubuntu without problems. W.r.t. bullet I can't say anything, sorry :(. [1] http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/Collada 2010/11/2 Axel Spirtaat loginv...@gmail.com Hi all, i correctly installed osg 2.8.1 (by apt - ubuntu/debian package manager) and bullet physics 2.76 building the sources. When i tried to load a sketuchup file (.skp) osgviewer reported an error. I read that i need collada-dom to load this kind of model. Is it right? However, i also tried to build collada, but there are a lot of bugs for linux and seem to be no more supported... i fixed some of them but not all. So i seen that bulet physics 2.75 (an older version) have collada included in its sources and i tried to build it too :P (hope successfully). Now i think i have to re-installe the osg by sources selecting also the collada plugin. Is this right? Since i installed in past also osgWorks and osgBullet, and had some problem with bullet physics, i think there's a lot of garbage in my libraries and maybe i need to reinstall the whole Ubuntu... To prevent future problems can anyone answer to next questions? 1) Does OSG need collada to load sketchup files? 2) Is there anyone who succesfully installed collada-dom on ubuntu/linux? 3) can anyone provide me a link to a really good tutorial to install collada-dom and load sketchup files using osg? I'm quite desperate, i've lost a lot of days... :-( Thank you! Cheers, Axel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33315#33315 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Real-Time geometry editing - changing
Hi Simon 1. Is there a way to configure the StateSet object or the Geometry object to somehow tell each vertex what texture it should use (given I don't want to change the order of the vertices - which I fear I will have to)? The easiest way I can think to do this is with shaders and creating a new vertex attribute array of integers that stores the texture unit used for each vertex. Or you could store the data in a texture and use vertex texture lookups if you have support for those. 2. Won't this be a bit of a problem for the performance? If you use the shader method I don't see it impacting that heavily. Any fixed function multi pass stuff might have a bigger impact 3. The edited model has a spherical shape, so I would like the textures to be displayed as in a spherical environment. Is there a way to compute the TexCoord Vec2's in a similar way as UVW Map modifier for max, but in real time? Look at reflection map shaders, they show how to use the objects normal to compute a texture cord in a 2d map. You essentially want 3d spherical coords (or normal dir) to 2d cartesian coords. Hope that helps Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetString(GL_VENDOR) return null
Hi Aitor You need to use a drawCallback to make sure you have access to the glContext (the context has been made current). I use the attached to gather lots of gl info in one shot. Most of the infomation is avaliable through other osg structures I just find it's nice to have it all in one place. Attach the GLSupportCallback as te final draw callback of you viewers camera. Then after calling frame the info will have been gathered. Cheers Tom Message: 9 Date: Tue, 02 Nov 2010 09:45:33 +0100 From: Aitor Ardanza aitoralt...@terra.es To: osg-users@lists.openscenegraph.org Subject: [osg-users] glGetString(GL_VENDOR) return null Message-ID: 1288687533.m2f.33...@forum.openscenegraph.org Content-Type: text/plain; charset=UTF-8 Hi, I've been reading similar problems, but I have not Found the solution ... the viewer is set in singlethreaded, and I added the GraphicsContext at the camera properly ... Code: // construct the viewer. int width = 800; int height = 600; osgViewer::Viewer viewer; viewer.addEventHandler(keh); viewer.setCameraManipulator(new osgGA::TrackballManipulator()); viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); int xoffset = 40; int yoffset = 40; osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = xoffset + 0; traits-y = yoffset + 0; traits-width = 600; traits-height = 480; traits-windowDecoration = true; traits-doubleBuffer = true; traits-sharedContext = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setGraphicsContext(gc.get()); camera-setViewport(new osg::Viewport(0,0, traits-width, traits-height)); GLenum buffer = traits-doubleBuffer ? GL_BACK : GL_FRONT; camera-setDrawBuffer(buffer); camera-setReadBuffer(buffer); // add this slave camera to the viewer, with a shift left of the projection matrix viewer.setCamera(camera.get()); viewer.setSceneData(scene); viewer.realize(); const char* vendorString = reinterpret_castconst char*(glGetString(GL_VENDOR)); //return NULL Why I can't access the graphics card info? Thank you! Cheers, Aitor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33289#33289 SystemInfo.h Description: Binary data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Video capture with 3D augmented reality
Hi, I've hacked up an example that you can study. This is a merge of osgmovie and osgprerender. Run like this e.g. (it assumes the second argument is a movie file) ./test -e ffmpeg cessna.osg mymovie.avi I hope you have the ffmpeg plugin :/ The only thing that I had to modify that you can check in your code is to turn off lighting for the hud camera. HTH jp PS. This works for me on screen, but I've just tried enabling image readback an then it breaks... mmm On 02/11/10 16:01, benedikt naessens wrote: Already thanks for all the effort you have put in this ! I set the threading model of my viewers (I have two in my application) to osgViewer::ViewerBase::SingleThreaded. Is this what you meant with forcing OSG to singlethreaded ? I also introduced now a snapshot image where the first and second camera write to (using the aforementioned techniques : attached with the COLOR_BUFFER component). Both (at the same time or not) didn't help. I have set the clear color of the second camera (m_Snapshotcamera) to red (using the setClearColor function of the camera). I don't see any red in file2.bmp, so I think there is no clearing issue. About your remark about the clearing of the buffer: if the buffer is not cleared, then this translates into the output image, right ? Or am I mistaken ? This could explain somehow the overlapping 3D data ? On the other hand, I am sure that both final drawing callbacks are called (and in the right order), so this still doesn't explain why my input video image is gone in file2.bmp. Strange. I'm a bit without ideas right now. Any other ideas ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33311#33311 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. render_over_existing.tar.gz Description: GNU Zip compressed data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGs OpenGLES 2.0 status
Hi Christian/Robert Christian about your questions - Which nodekits/plugins run without modifications on OpenGLES 2.0? I have built every plugin and node kit that does not require any external libs. i havn't tested them all but have tested. IVE, OSG, IMAGEIO, FREETYPE (but think this might have recently broken), BMP. I am also actively using core libs OSG, OSGUTILS, OSGDB, OSGVIEWER, OSGGA, OSGANIMATION and some others I think. - What if a nodekit/plugin composes a subgraph which is not compatible with OpenGLES 2.0 (e.g. uses FFP or the shader source cannot be converted)? Do I have to manually attach an OpenGLES 2.0 compatible shader program to every node/subgraph? Will the ShaderComposer automatically insert shader programs to the nodes/subgraphs to emulate the FFP in the future? At the moment you have to manually attched shaders as the current ShaderGen uses some features that only exist with the fixed function pipeline and does not use the precision stuff required by glsles shaders. - I?m having problems with the HW mipmap generation. I get only black textures when activating the HW support. Mipmaps generated by SW are working fine. Does HW mipmap generation work on the IPhone with OSG? Harware mipmapping in OSG uses the GLU lib. This isn't available on iOS so won't work. - Does the IPhone git branch have more adaptions regarding OpenGLES 2.0 or is the main branch up to date? Not at the moment, but i do have a little proposal below. I too have been keen to learn about ShaderComposition. I noticed traces of it in the last checkout I did. As I'm now using GLES 2 full time I was wondering if I should modify ShaderGen to work with GLES 2 and add it to the IPhone branch to help ease things till Robert finds time to complete ShadeComposition. I have a fair bit of free time at the moment so could do it now and would probably save you being hassled too much Robert. What do you think? Would only take an a few hours I recon, but we would loose lights etc for a short while. Maybe the we can tell everyone to always attach a myLightPos uniform to the root of their graph and use that in the shaders for now? i now this would save be a lot of time at the moment. Cheers Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Thank you jordi, now i begin to read the link you've suggested. Unluckily on Google warehouse i can find only skp files for the model i look for :-( However, with a quick search i've seen that the is some tool to convert skp fines in 3ds format... maybe i could convert skp in 3ds and 3ds in dae :P I hope to be more lucky now :-) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33322#33322 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Hi Axel, I am not sure, but I think you can convert your .skp model to .dae with sketch up of google. Cheers. 2010/11/2 Axel Spirtaat loginv...@gmail.com Thank you jordi, now i begin to read the link you've suggested. Unluckily on Google warehouse i can find only skp files for the model i look for :-( However, with a quick search i've seen that the is some tool to convert skp fines in 3ds format... maybe i could convert skp in 3ds and 3ds in dae :P I hope to be more lucky now :-) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33322#33322 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Video capture with 3D augmented reality
Sorry, forgot to say that for saving image you have to add --image. E.g. ./test -e ffmpeg --texture-rectangle --image cessnafire.osg ~/stuff/f22langley.flv jp On 02/11/10 17:27, J.P. Delport wrote: Here's one that saves JPGs as well. See screenshot in tar.gz. Attached both a texture and image. jp On 02/11/10 17:16, J.P. Delport wrote: Hi, I've hacked up an example that you can study. This is a merge of osgmovie and osgprerender. Run like this e.g. (it assumes the second argument is a movie file) ./test -e ffmpeg cessna.osg mymovie.avi I hope you have the ffmpeg plugin :/ The only thing that I had to modify that you can check in your code is to turn off lighting for the hud camera. HTH jp PS. This works for me on screen, but I've just tried enabling image readback an then it breaks... mmm On 02/11/10 16:01, benedikt naessens wrote: Already thanks for all the effort you have put in this ! I set the threading model of my viewers (I have two in my application) to osgViewer::ViewerBase::SingleThreaded. Is this what you meant with forcing OSG to singlethreaded ? I also introduced now a snapshot image where the first and second camera write to (using the aforementioned techniques : attached with the COLOR_BUFFER component). Both (at the same time or not) didn't help. I have set the clear color of the second camera (m_Snapshotcamera) to red (using the setClearColor function of the camera). I don't see any red in file2.bmp, so I think there is no clearing issue. About your remark about the clearing of the buffer: if the buffer is not cleared, then this translates into the output image, right ? Or am I mistaken ? This could explain somehow the overlapping 3D data ? On the other hand, I am sure that both final drawing callbacks are called (and in the right order), so this still doesn't explain why my input video image is gone in file2.bmp. Strange. I'm a bit without ideas right now. Any other ideas ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33311#33311 ___ 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 -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGs OpenGLES 2.0 status
Hi Thomas and Christian, On Tue, Nov 2, 2010 at 3:17 PM, Thomas Hogarth thomas.hoga...@googlemail.com wrote: - I?m having problems with the HW mipmap generation. I get only black textures when activating the HW support. Mipmaps generated by SW are working fine. Does HW mipmap generation work on the IPhone with OSG? Harware mipmapping in OSG uses the GLU lib. This isn't available on iOS so won't work. With the svn/trunk version of the OSG GLU has been directly integrated and should be fully supported under OpenGLES code paths. The IPhone git branch may well not have these changes yet. - Does the IPhone git branch have more adaptions regarding OpenGLES 2.0 or is the main branch up to date? Not at the moment, but i do have a little proposal below. I too have been keen to learn about ShaderComposition. I noticed traces of it in the last checkout I did. As I'm now using GLES 2 full time I was wondering if I should modify ShaderGen to work with GLES 2 and add it to the IPhone branch to help ease things till Robert finds time to complete ShadeComposition. Updating ShaderGen to work with GLES2 would be very useful. I'd also like to the the IPhone git branch changes merged into core the OSG as well, but I don't know the status of these so can't say how easily they will integrate. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGs OpenGLES 2.0 status
Hi Tom, hi Robert, Am 02.11.10 16:29, schrieb Robert Osfield: I'd also like to the the IPhone git branch changes merged into core the OSG as well, but I don't know the status of these so can't say how easily they will integrate. The changes should be easy to integrate, most of the changes are in new files. Before sending the files to you, I'd like to fix FBO-support but I can't get it to work on my end. @Tom: does FBOs work on your end now? If yes, please send me your sources, so I can integrate them with the git branch. There's one remaining issue with display sizes, but this should be fixable. After these issues are fixed, I can send you the changed files over osg.submissions. Do you want them all-together or bundled by topic (e.g. multitouch for osgGA, iphone support for osgviewer, etc) cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGs OpenGLES 2.0 status
Hi Stephan, On Tue, Nov 2, 2010 at 4:03 PM, Stephan Maximilian Huber ratzf...@digitalmind.de wrote: There's one remaining issue with display sizes, but this should be fixable. After these issues are fixed, I can send you the changed files over osg.submissions. Do you want them all-together or bundled by topic (e.g. multitouch for osgGA, iphone support for osgviewer, etc) Bundled by topic would probably be best. This way if parts need revision then they needn't hold up other submissions, and also it's easier to track down change sets at a later date. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Integrated graphics chipset: Drawing GL_LINES with multiple PrimitiveSets beneath a single Geometry
I'm doing some testing of osg 2.8.2 on a laptop with an integrated graphics chipset (Intel 4 Series Express) with the latest drivers from Dell. I'm finding that the hardware has trouble drawing line geometry when the lines are arranged in multiple PrimitiveSets underneath a single Geometry. I only see the line from the first PrimitiveSet drawn and the others are seemingly skipped. Disabling hardware acceleration fixes the problem; i.e. all lines are drawn. I've created a simple osg executable that reproduces the problem on my hardware. The code can be found below. Of course, both lines are drawn as expected on more capable hardware. Is there anything we can do in osg to fix or workaround this driver bug short of splitting up the lines into separate Geometrys rather than separate PrimitiveSets? Thank you, Jesse Stimpson Here is the sample code: #include osgViewer/Viewer #include osg/Geode #include osg/Geometry #include osg/Array int main(int argc, char* argv[]) { osg::ArgumentParser arguments(argc,argv); osgViewer::Viewer viewer(arguments); osg::Geode* geode = new osg::Geode; osg::Geometry* geom = new osg::Geometry; osg::Vec3Array* verts = new osg::Vec3Array; osg::Vec4Array* color = new osg::Vec4Array; verts-push_back(osg::Vec3(0,0,0)); verts-push_back(osg::Vec3(0,0,1)); verts-push_back(osg::Vec3(1,0,0)); verts-push_back(osg::Vec3(1,0,1)); color-push_back(osg::Vec4(1,0,0,1)); geom-setVertexArray(verts); geom-setColorArray(color); geom-setColorBinding(osg::Geometry::BIND_OVERALL); geom-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 0, 2)); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 2, 2)); geode-addDrawable(geom); viewer.setSceneData( geode ); viewer.realize(); return viewer.run(); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Integrated graphics chipset: Drawing GL_LINES with multiple PrimitiveSets beneath a single Geometry
Hi Jesse, I'm amazed that such a simple example is able to reveal a driver bug, it really makes wonder how much testing the driver underwent before being let out in the wild. Clearly Intel/Dell need to informed about this problem, your example is simple enough that they should be able to reproduce the problem easily themselves. As for workarounds, you could try using osg::DrawElementsUShort rather than a DrawArray primitive set, or merging the DrawArrays into a single DrawArrays. Robert. On Tue, Nov 2, 2010 at 4:22 PM, Jesse Stimpson jesse.stimp...@gmail.com wrote: I'm doing some testing of osg 2.8.2 on a laptop with an integrated graphics chipset (Intel 4 Series Express) with the latest drivers from Dell. I'm finding that the hardware has trouble drawing line geometry when the lines are arranged in multiple PrimitiveSets underneath a single Geometry. I only see the line from the first PrimitiveSet drawn and the others are seemingly skipped. Disabling hardware acceleration fixes the problem; i.e. all lines are drawn. I've created a simple osg executable that reproduces the problem on my hardware. The code can be found below. Of course, both lines are drawn as expected on more capable hardware. Is there anything we can do in osg to fix or workaround this driver bug short of splitting up the lines into separate Geometrys rather than separate PrimitiveSets? Thank you, Jesse Stimpson Here is the sample code: #include osgViewer/Viewer #include osg/Geode #include osg/Geometry #include osg/Array int main(int argc, char* argv[]) { osg::ArgumentParser arguments(argc,argv); osgViewer::Viewer viewer(arguments); osg::Geode* geode = new osg::Geode; osg::Geometry* geom = new osg::Geometry; osg::Vec3Array* verts = new osg::Vec3Array; osg::Vec4Array* color = new osg::Vec4Array; verts-push_back(osg::Vec3(0,0,0)); verts-push_back(osg::Vec3(0,0,1)); verts-push_back(osg::Vec3(1,0,0)); verts-push_back(osg::Vec3(1,0,1)); color-push_back(osg::Vec4(1,0,0,1)); geom-setVertexArray(verts); geom-setColorArray(color); geom-setColorBinding(osg::Geometry::BIND_OVERALL); geom-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 0, 2)); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 2, 2)); geode-addDrawable(geom); viewer.setSceneData( geode ); viewer.realize(); return viewer.run(); } ___ 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 can I calculate a matrix via a MatrixManipulator
Hello, is it possible to use a osgGA::MatrixManipulator to calculate a ViewMatrix on demand? I won't put the manipulator in the viewer like this: viewer-setCameraManipulator(new TrackballManipulator); I want to use it like: TrackballManipulator* tm = new TrackballManipulator() tm-calculateViewMatrix(eventAdapter, ActionAdapter); The reason is, I have already a GUIEventHandler and this event handler should use the TrackballManipulator to calculate a view matrix. Also I want to make a delegation. How can I do this? Cheers Martin -- GMX DSL Doppel-Flat ab 19,99 euro;/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hiding objects from a cloned scenegraph hides the original...
ah! -- it is so obvious once you said it. ;) thanks. t On Tue, Nov 2, 2010 at 4:34 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Ted, A shallow copy will share as much as possible of the data below the object you are calling clone on. Only a deep copy will force the data itself to be copied. As a general note, you want to avoid duplicating data as much as possible, so share as much as possible. In you case it might not be necessary to clone anything and share the whole scene graph between views. You can use a combination of NodeMask and Camera CullMask (see osg::CullSetting from which osg::Camera is derived), to enable each view to just see a portion of the scene. Robert. On Mon, Nov 1, 2010 at 9:34 PM, Ted Morris ted.mor...@gmail.com wrote: Hi, I am cloning a scenegraph for a 2nd viewer for osgCompositeView. Everytime I setNodeMask(0x0) to some objects that is part of the cloned node the objects in the original disappears as well, unless it is a CopyOp::DEEP_COPY_ALL. The problem with using DEEP_COPY_ALL is that it makes the UpdateCallback process a mess-- since I then have to contrive other mechanisms to tie in the existing, callbacks for objects in the original scene with the 'secondary' view's cloned scene graph. Or, I have to end up walking the scenegraph tree, and doing appropriate clone level flags, one by one?? Thanks to all in advance! Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33279#33279 ___ 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] How can I calculate a matrix via a MatrixManipulator
Hi Martin, TrackballManipulator* tm = new TrackballManipulator() tm-calculateViewMatrix(eventAdapter, ActionAdapter); Well, inside your own handle(ea, aa) you can always call the manipulator's handle(ea, aa). Is that what you mean? And when you want the view matrix you call the manipulator's getInverseMatrix() method. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Excuse me Jordi, i continue to have the same errors building building collada (also following the tutorial you've suggested me). Did you have a problem like this building it? a...@axel-desktop:~/osg/collada-dom$ make os=linux project=minizip make os=linux project=minizip -C dom make os=linux project=dom -C dom make os=linux project=fx -C fx make os=linux project=rt -C rt make os=linux project=viewer -C viewer make[1]: ingresso nella directory «/home/axel/Scrivania/OSG/collada-dom/viewer» Linking build/linux-1.4/viewer /usr/bin/ld: skipping incompatible ../rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a when searching for -lbulletopenglsupport /usr/bin/ld: cannot find -lbulletopenglsupport collect2: ld returned 1 exit status make[1]: *** [build/linux-1.4/viewer] Errore 1 make[1]: uscita dalla directory «/home/axel/Scrivania/OSG/collada-dom/viewer» make: *** [all] Errore 2 a...@axel-desktop:~/osg/collada-dom$ find . -iname libbulletopenglsupport.a ./rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a I ask this here because on SourceForge the project seems to be inactive... Thank you[/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=5#5 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Integrated graphics chipset: Drawing GL_LINES with multiple PrimitiveSets beneath a single Geometry
Robert, Thanks for the quick reply. Using osg::DrawElementsUShort worked. Could you go into short detail why you think that would work over the osg::DrawArrays? If I do report the bug to Intel/Dell, I'd like to be armed with as much information as possible. ;) Thanks again, Jesse On Tue, Nov 2, 2010 at 12:29 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Jesse, I'm amazed that such a simple example is able to reveal a driver bug, it really makes wonder how much testing the driver underwent before being let out in the wild. Clearly Intel/Dell need to informed about this problem, your example is simple enough that they should be able to reproduce the problem easily themselves. As for workarounds, you could try using osg::DrawElementsUShort rather than a DrawArray primitive set, or merging the DrawArrays into a single DrawArrays. Robert. On Tue, Nov 2, 2010 at 4:22 PM, Jesse Stimpson jesse.stimp...@gmail.com wrote: I'm doing some testing of osg 2.8.2 on a laptop with an integrated graphics chipset (Intel 4 Series Express) with the latest drivers from Dell. I'm finding that the hardware has trouble drawing line geometry when the lines are arranged in multiple PrimitiveSets underneath a single Geometry. I only see the line from the first PrimitiveSet drawn and the others are seemingly skipped. Disabling hardware acceleration fixes the problem; i.e. all lines are drawn. I've created a simple osg executable that reproduces the problem on my hardware. The code can be found below. Of course, both lines are drawn as expected on more capable hardware. Is there anything we can do in osg to fix or workaround this driver bug short of splitting up the lines into separate Geometrys rather than separate PrimitiveSets? Thank you, Jesse Stimpson Here is the sample code: #include osgViewer/Viewer #include osg/Geode #include osg/Geometry #include osg/Array int main(int argc, char* argv[]) { osg::ArgumentParser arguments(argc,argv); osgViewer::Viewer viewer(arguments); osg::Geode* geode = new osg::Geode; osg::Geometry* geom = new osg::Geometry; osg::Vec3Array* verts = new osg::Vec3Array; osg::Vec4Array* color = new osg::Vec4Array; verts-push_back(osg::Vec3(0,0,0)); verts-push_back(osg::Vec3(0,0,1)); verts-push_back(osg::Vec3(1,0,0)); verts-push_back(osg::Vec3(1,0,1)); color-push_back(osg::Vec4(1,0,0,1)); geom-setVertexArray(verts); geom-setColorArray(color); geom-setColorBinding(osg::Geometry::BIND_OVERALL); geom-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 0, 2)); geom-addPrimitiveSet(new osg::DrawArrays(GL_LINES, 2, 2)); geode-addDrawable(geom); viewer.setSceneData( geode ); viewer.realize(); return viewer.run(); } ___ 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] OSG, bullet physics, collada and sketchup models on Ubuntu
Hi Axel, I don't remember exactly what problems we had, but of course we had. The Skipping incompatible error means that the libraries you are linking are in the wrong architecture. It seems that you are mixing 32 bits and 64 bits libraries. We only have built collada-plugin in a static way without bullet support. You can download our compiled plugin here [1], and release it in your osgPlugins directory (BTW it is in 32 bits). Cheers. [1] https://svn.forge.osor.eu/svn/gvsig-3d/1.10/tags/gvSIG_3D_Animation_1_10_build_15/binaries/linux/3D/osgPlugins-2.8.3/osgdb_dae.so 2010/11/2 Axel Spirtaat loginv...@gmail.com Excuse me Jordi, i continue to have the same errors building building collada (also following the tutorial you've suggested me). Did you have a problem like this building it? a...@axel-desktop:~/osg/collada-dom$ make os=linux project=minizip make os=linux project=minizip -C dom make os=linux project=dom -C dom make os=linux project=fx -C fx make os=linux project=rt -C rt make os=linux project=viewer -C viewer make[1]: ingresso nella directory «/home/axel/Scrivania/OSG/collada-dom/viewer» Linking build/linux-1.4/viewer /usr/bin/ld: skipping incompatible ../rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a when searching for -lbulletopenglsupport /usr/bin/ld: cannot find -lbulletopenglsupport collect2: ld returned 1 exit status make[1]: *** [build/linux-1.4/viewer] Errore 1 make[1]: uscita dalla directory «/home/axel/Scrivania/OSG/collada-dom/viewer» make: *** [all] Errore 2 a...@axel-desktop:~/osg/collada-dom$ find . -iname libbulletopenglsupport.a ./rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a I ask this here because on SourceForge the project seems to be inactive... Thank you[/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=5#5 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Video capture with 3D augmented reality
Why has the format been changed from GL_RGBA to GL_RGB ? Is it not working with the alpha channel or is that just a coincidence ? Also, why do you attach the second camera to the texture and not to the image ? The example image is great :) Thank you! Cheers, Benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=7#7 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Sorry I did not remeber to say that this plugin is compiled for osg-2.8.3 version. :( 2010/11/2 Jordi Torres jtorresfa...@gmail.com Hi Axel, I don't remember exactly what problems we had, but of course we had. The Skipping incompatible error means that the libraries you are linking are in the wrong architecture. It seems that you are mixing 32 bits and 64 bits libraries. We only have built collada-plugin in a static way without bullet support. You can download our compiled plugin here [1], and release it in your osgPlugins directory (BTW it is in 32 bits). Cheers. [1] https://svn.forge.osor.eu/svn/gvsig-3d/1.10/tags/gvSIG_3D_Animation_1_10_build_15/binaries/linux/3D/osgPlugins-2.8.3/osgdb_dae.so 2010/11/2 Axel Spirtaat loginv...@gmail.com Excuse me Jordi, i continue to have the same errors building building collada (also following the tutorial you've suggested me). Did you have a problem like this building it? a...@axel-desktop:~/osg/collada-dom$ make os=linux project=minizip make os=linux project=minizip -C dom make os=linux project=dom -C dom make os=linux project=fx -C fx make os=linux project=rt -C rt make os=linux project=viewer -C viewer make[1]: ingresso nella directory «/home/axel/Scrivania/OSG/collada-dom/viewer» Linking build/linux-1.4/viewer /usr/bin/ld: skipping incompatible ../rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a when searching for -lbulletopenglsupport /usr/bin/ld: cannot find -lbulletopenglsupport collect2: ld returned 1 exit status make[1]: *** [build/linux-1.4/viewer] Errore 1 make[1]: uscita dalla directory «/home/axel/Scrivania/OSG/collada-dom/viewer» make: *** [all] Errore 2 a...@axel-desktop:~/osg/collada-dom$ find . -iname libbulletopenglsupport.a ./rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a I ask this here because on SourceForge the project seems to be inactive... Thank you[/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=5#5 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es -- Jordi Torres Fabra gvSIG 3D blog http://gvsig3d.blogspot.com Instituto de Automática e Informática Industrial http://www.ai2.upv.es ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How can I calculate a matrix via a MatrixManipulator
Hi Martin, The osgViewer::Viewer/CompositeViewer doesn't actually require the use of a CameraManipualtor/MatrixManipulator at all so you can set the View(er)'s Camera directly on each new frame. This approach would precluded using a camera manipulator of your own design, or reusing the existing osgGA's in ways that they aren't normally utilized. Robert. 2010/11/2 Martin Großer grosser.mar...@gmx.de: Hello, is it possible to use a osgGA::MatrixManipulator to calculate a ViewMatrix on demand? I won't put the manipulator in the viewer like this: viewer-setCameraManipulator(new TrackballManipulator); I want to use it like: TrackballManipulator* tm = new TrackballManipulator() tm-calculateViewMatrix(eventAdapter, ActionAdapter); The reason is, I have already a GUIEventHandler and this event handler should use the TrackballManipulator to calculate a view matrix. Also I want to make a delegation. How can I do this? Cheers Martin -- GMX DSL Doppel-Flat ab 19,99 euro;/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl ___ 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] Integrated graphics chipset: Drawing GL_LINES with multiple PrimitiveSets beneath a single Geometry
Hi Jesse, On Tue, Nov 2, 2010 at 5:15 PM, Jesse Stimpson jesse.stimp...@gmail.com wrote: Thanks for the quick reply. Using osg::DrawElementsUShort worked. Could you go into short detail why you think that would work over the osg::DrawArrays? If I do report the bug to Intel/Dell, I'd like to be armed with as much information as possible. ;) There isn't any logical reason why one core OpenGL feature will work and another not, is just shoddy driver development and testing. A guess might be that they only tested a very small set of apps that exclusively use DrawElementsUShort and thought that somehow that was a good enough test for all OpenGL primitive usage. We are talking about the one of the dumbest driver errors I've come across in over almost two decades of coding on IrisGL then OpenGL, it's pretty inexplicable just how low a hurdle this driver is unable to surmount. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG, bullet physics, collada and sketchup models on Ubuntu
Hello Axel, Unfortunately, I have bad news for you. The collada inside Bullet and the Collada as used by OSG are two different versions. If you try to link the libraries, it will fail, even after you get the library problem solved (32bit vs 64bit architecture issue?). The problem gets worse because it is not possible to just simply port bullet code to the same Collada OSG has (different API!). When I was trying to use Collada with Bullet and OSG to load models including physics, I had to do extensive changes to both Bullet and osgBullet to make this work :( If you do not absolutely need physics support for Collada, just disable Collada in Bullet, it will save you a lot of headaches. Good luck, you will need it :( Jan On Tue, Nov 2, 2010 at 6:01 PM, Axel Spirtaat loginv...@gmail.com wrote: Excuse me Jordi, i continue to have the same errors building building collada (also following the tutorial you've suggested me). Did you have a problem like this building it? a...@axel-desktop:~/osg/collada-dom$ make os=linux project=minizip make os=linux project=minizip -C dom make os=linux project=dom -C dom make os=linux project=fx -C fx make os=linux project=rt -C rt make os=linux project=viewer -C viewer make[1]: ingresso nella directory «/home/axel/Scrivania/OSG/collada-dom/viewer» Linking build/linux-1.4/viewer /usr/bin/ld: skipping incompatible ../rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a when searching for -lbulletopenglsupport /usr/bin/ld: cannot find -lbulletopenglsupport collect2: ld returned 1 exit status make[1]: *** [build/linux-1.4/viewer] Errore 1 make[1]: uscita dalla directory «/home/axel/Scrivania/OSG/collada-dom/viewer» make: *** [all] Errore 2 a...@axel-desktop:~/osg/collada-dom$ find . -iname libbulletopenglsupport.a ./rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a I ask this here because on SourceForge the project seems to be inactive... Thank you[/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=5#5 ___ 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] problem with hud overlay
Hi, I thought this would be extremely trivial. But, perhaps I am missing something. I have a HUD ortho2D camera slaved to a main view window camera, rendering a polygon. I need to move the polygon when I resize the main window, which I attempted by simply placing the geode underneath a MatrixTransform node, first setting it to identity() and placing it under the HUD camera. However, when I did this, the polygon no longer is rendered in the window at all. Note that everything renders fine with a Geode before I placed it under the MatrixTransform. To recap this is essentially what I tried: m_HUDcam = new osg::Camera; m_HUDcam-setProjectionMatrix( osg::Matrix::ortho2D(0, m_viewersize.GetX(),0, m_viewersize.GetY())); m_HUDcam-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_HUDcam-setClearMask(GL_DEPTH_BUFFER_BIT); // draw subgraph after main camera view. m_HUDcam-setRenderOrder(osg::Camera::POST_RENDER,0); m_HUDcam-setAllowEventFocus(false); // create the frame osg::MatrixTransform * matrixtransfm = new osg::MatrixTransform; matrixtransfm-setMatrix(osg::Matrix::identity()); // create the Geode (Geometry Node) to contain all our osg::Geometry objects. osg::Geode* geode = new osg::Geode(); osg::StateSet* stateset = geode-getOrCreateStateSet(); stateset-setMode(GL_LIGHTING,osg::StateAttribute::OFF); matrixtransfm-setChild(0, geode); // construct the polygon(s) primitive(s) here ... // attach it to the HUD camera -- now the polygon(s) don't display. m_HUDcam-addChild(matrixtransfm); // but uncommenting this out, and polygon displays : // m_HUDcam-addChild(geode); // viewport, etc. m_HUDcam-setViewport( 0 ,0, m_viewersize.GetX(), m_viewersize.GetY()); m_HUDcam-setGraphicsContext(gw); m_viewer-addSlave(m_HUDcam, false); Thank you! Cheers, Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33347#33347 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with hud overlay
Hello Ted, Gladly you included the code you use, which allowed me to know exactly why you don't see anything. Look at this line: matrixtransfm-setChild(0, geode); Why did you use setChild(0, geode) instead of addChild(geode)? It is a mistake. Look at the first few lines of osg::Group::setChild() (MatrixTransform is an indirect subclass of Group): bool Group::setChild( unsigned int i, Node* newNode ) { if (i_children.size() newNode) { // ... } else return false; } So since your MatrixTransform has no children initially, setChild(0, geode) does nothing. There is no index 0 in its children vector, so it can't set it to the node you passed... Try addChild() instead. Incidentally, if you had checked the return value of setChild() it would have been false, telling you it had failed (I'm not criticising, just making a remark, I wouldn't have checked the return value either ;-) ). Or, if you had stepped through your program in a debugger, you would have seen that after the call to setChild(0, geode), the children vector of the MatrixTransform was still empty. Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG ActiveX + IFC - looking for developer
On 11/2/2010 2:55 AM, Mathieu MARACHE wrote: There is at least a closed source one I know about. The main issue is in handling the CSG part in the IFC geometrical definitions. Can you elaborate on this? This is such a complex format that it is probably not a good idea to have multiple projects working on different implementations. I don't know if any of the people currently asking about IFC could utilize a closed-source option, but if they could it would save everyone a lot of effort. Regards, Mathieu -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with hud overlay
Excellent-- Thanks very much! Cheers, Ted -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33350#33350 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org