Re: [osg-users] VIDEO with Alpha Channel
Hi, You just need load some two textures here is the code osg::Program* program = new osg::Program; geometry-getOrCreateStateSet()-setAttribute(program); char vertexShaderSource[] = varying vec2 texcoord;\n \n void main(void)\n {\n gl_Position = ftransform();\n texcoord = gl_MultiTexCoord0.xy;\n }\n; char fragmentShaderSource[] = uniform sampler2D baseTexture; \n varying vec2 texcoord;\n \n void main(void) \n {\n vec4 CHROMA_KEY = vec4(1.0,1.0,1.0,0.1);\n vec4 color = texture2D( baseTexture, texcoord); \n // ARUNA ROX I DID IT hahaha. THE BACKGROUND IN THE VIDEO IS NOT THAT COLOR\n if (color.y 0.5)\n discard;\n gl_FragColor = color; \n }\n; program-addShader(new osg::Shader(osg::Shader::VERTEX, vertexShaderSource)); program-addShader(new osg::Shader(osg::Shader::FRAGMENT, fragmentShaderSource)); here geometry is osg::Geometry pointer to which relative to the vedio Thank you! Cheers, Aruna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33161#33161 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] Is there anyone who had used osg on vxworks(Real-time OS)?
Hi, all I'm wondering if it's possible to use osg on vxworks(every version is OK). Please, let me know how to use it. Thank you! Cheers, Sang-hyeon -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33162#33162 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Video capture with 3D augmented reality
I want to record a video and put 3D augmented reality on top of each frame of the AVI. Due to the fact that I don't want to skip frames, I store all AVI frames in memory during recording and after each video frame has been captured, I also store the view and projection matrices of the 3D view that is currently applicable on this video frame. The input of the camera is 640 x 480 and my application usually renders in 1280 x 1024 windows. The video frames can be retrieved from an array of unsigned char arrays (stored in m_RingBuffer) I want to achieve the rendering of the 3D data on top of the video frames in a post-processing step (which is part of the work done in a thread called VideoPostRecThread). I follow this strategy: 1) I set up a pre-rendering HUD camera (m_pHudCamera) which looks at a quad geometry with one of the video frames as a texture (m_RenderTexture) 2) The HUD camera is the child of a snapshot camera (m_pSnapshotcamera) . The snapshot renders the 3D data. The output of the snapshot camera should go back to the video frame, but I also store it temporarily in an image (m_SnapshotImage). For this, I disabled the GL_COLOR_BUFFER_BIT clear mask of the snapshot camera, to make sure the rendered outputs of the HUD camera are not cleared. I also use two callbacks: 1) a pre-draw callback applied on the HUD camera: the texture of the quad geometry (m_RenderTexture) is updated each time with a new frame. Name: m_UpdateCallback (instance of the TexturePreDrawCallback struct). 2) a post-draw callback: my thread is blocked until all the 3D data is rendered on top of the HUD contents; the callback unblocks my thread (using a mutex called m_SnapshotMutex). After this, I can do some post-processing (like for example saving the AVI or updating my GUI that another frame has been post-processed). Name: m_VideoCallback (instance of the VideoPostDrawCallback struct) Here are my callback definitions: Code: struct VideoPostDrawCallback : public osg::Camera::DrawCallback { VideoPostDrawCallback(){} virtual void operator() ( osg::RenderInfo renderInfo) const { renderingCompleted(); } boost::signals2::signalvoid(void) renderingCompleted; }; struct TexturePreDrawCallback : public osg::Camera::DrawCallback { TexturePreDrawCallback() {} virtual void operator() ( osg::RenderInfo renderInfo) const { updateCamera(); } boost::signals2::signalvoid(void) updateCamera; }; And here is the definition of my thread class Code: class VideoPostRecThread : public VideoRecWithArThread { Q_OBJECT friend class VideoPostDrawCallback; public: VideoPostRecThread (boost::shared_ptrIDSCameraManager pCamMgr, unsigned int maxFrames, QObject *parent = NULL); ~VideoPostRecThread (); void renderingCompleted(); void updateTextureCamera(); private: virtual void postProcess(); void setupImages(); void setupHudCamera(); void setupSnapshotCamera(); osg::ref_ptrosg::Camera m_pSnapshotcamera; osg::ref_ptrosg::Camera m_pHudCamera; osg::ref_ptrosg::Image m_TextureImage; osg::ref_ptrosg::Image m_SnapshotImage; osg::ref_ptrosg::Texture2D m_RenderTexture; osg::ref_ptrosg::Geode m_QuadGeode; osg::ref_ptrVideoPostDrawCallback m_VideoCallback; osg::ref_ptrTexturePreDrawCallback m_UpdateCallback; QWaitCondition m_SnapshotCondition; QMutex m_SnapshotMutex; unsigned int m_CurrentArFrameIndex; }; Here is the implementation of the VideoPostRecThread class. Code: void VideoPostRecThread ::setupImages() { m_SnapshotImage = new Image(); m_SnapshotImage-allocateImage(1280,1024,1, GL_RGBA, GL_UNSIGNED_BYTE); m_TextureImage = new Image(); } void VideoPostRecThread ::setupHudCamera() { // Create the texture to render to m_RenderTexture = new osg::Texture2D; m_RenderTexture-setDataVariance(osg::Object::DYNAMIC); m_RenderTexture-setInternalFormat(GL_RGBA); osg::ref_ptrosg::Geometry screenQuad; screenQuad = osg::createTexturedQuadGeometry(osg::Vec3(), osg::Vec3(1280, 0.0, 0.0), osg::Vec3(0.0, 1024, 0.0)); m_QuadGeode = new osg::Geode; m_QuadGeode-addDrawable(screenQuad.get()); m_pHudCamera = new osg::Camera; m_pHudCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pHudCamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pHudCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); m_pHudCamera-setProjectionMatrix(osg::Matrix::ortho2D(0, 1280, 0, 1024)); m_pHudCamera-setViewMatrix(osg::Matrix::identity()); m_pHudCamera-setViewport(0,0,1280,1024); m_pHudCamera-addChild(m_QuadGeode);
Re: [osg-users] Viewer-frame() Qt - embedding osg scene into Qt app
Hi John, My guess is that the OSG is setting some OpenGL state that is being inherited into the Qt GL drawing code. Mixing OSG and other GL code is a little tricky as the OSG uses lazy state updating to provide efficient use of OpenGL/graphics card, this lazy state updating means that the OSG assumes the state is the same going into it a new frame as it was when it left it. The OSG also can modify the current OpenGL state and leave it in that state, as it has the knowledge of what the state is so can get it back to the state it needs on the next frame. The osg::State object associate with each GraphicsContext is what the OSG uses to track and apply the state. The use of lazy state updating means that you need to avoid other OpenGL code changing the GL state without the osg::State knowing about it. The two ways to achieve this is to use glPushAttrib/glPopAttrib around the non OSG GL code, or to use the osg::State::haveApplied*() methods to tell the OSG that the non OSG GL code has modified a particular part of OpenGL state. The other issue, and the particular one you are most obviously facing is that the OSG is modifying the state and the non OSG GL code doesn't know about this so doesn't reset it. Two approaches you could take would be to use the glPushAttrib/glPopAtttrib around the OSG calls, or use a StateSet at the top of the scene graph - or the master camera's StateSet, to set the state into a known state, and make sure that this is applied to the osg::State right after the viewer.frame() call. Robert. On Wed, Oct 27, 2010 at 9:45 PM, John Doves evage...@gmail.com wrote: Hello, I'm having some problem with rendering osg scene into Qt application. I'm setup osgViewer in single thirded and embedding: Code: viewer-setThreadingModel(osgViewer::Viewer::SingleThreaded ); viewer-setUpViewerAsEmbeddedInWindow(0,0, 1024, 768); and rendering in QGraphicsScene class with: Code: painter-beginNativePainting(); glPushMatrix(); viewer-frame(); glPopMatrix(); painter-endNativePainting(); With simple models it rendered ok but when i use models with particles this rendered with artefacts on Qt widgets. I'm attached two screenshots. Maybe i must save states before frame() and restore when done? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33155#33155 ___ 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] Viewer-frame() Qt - embedding osg scene into Qt app
Hi John, What you're trying to do is really nice, any chance you'll share the code ? It could make a cool OSG and QT example. Cheers, On Thu, Oct 28, 2010 at 10:16 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi John, My guess is that the OSG is setting some OpenGL state that is being inherited into the Qt GL drawing code. Mixing OSG and other GL code is a little tricky as the OSG uses lazy state updating to provide efficient use of OpenGL/graphics card, this lazy state updating means that the OSG assumes the state is the same going into it a new frame as it was when it left it. The OSG also can modify the current OpenGL state and leave it in that state, as it has the knowledge of what the state is so can get it back to the state it needs on the next frame. The osg::State object associate with each GraphicsContext is what the OSG uses to track and apply the state. The use of lazy state updating means that you need to avoid other OpenGL code changing the GL state without the osg::State knowing about it. The two ways to achieve this is to use glPushAttrib/glPopAttrib around the non OSG GL code, or to use the osg::State::haveApplied*() methods to tell the OSG that the non OSG GL code has modified a particular part of OpenGL state. The other issue, and the particular one you are most obviously facing is that the OSG is modifying the state and the non OSG GL code doesn't know about this so doesn't reset it. Two approaches you could take would be to use the glPushAttrib/glPopAtttrib around the OSG calls, or use a StateSet at the top of the scene graph - or the master camera's StateSet, to set the state into a known state, and make sure that this is applied to the osg::State right after the viewer.frame() call. Robert. On Wed, Oct 27, 2010 at 9:45 PM, John Doves evage...@gmail.com wrote: Hello, I'm having some problem with rendering osg scene into Qt application. I'm setup osgViewer in single thirded and embedding: Code: viewer-setThreadingModel(osgViewer::Viewer::SingleThreaded ); viewer-setUpViewerAsEmbeddedInWindow(0,0, 1024, 768); and rendering in QGraphicsScene class with: Code: painter-beginNativePainting(); glPushMatrix(); viewer-frame(); glPopMatrix(); painter-endNativePainting(); With simple models it rendered ok but when i use models with particles this rendered with artefacts on Qt widgets. I'm attached two screenshots. Maybe i must save states before frame() and restore when done? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33155#33155 ___ 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 -- 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] [osgPlugins] FBX texture export problem.
Hi, I want to update this post to update any interested peoples on the situation. It seems that, in fact, the FBX file 2010.2 exported by cinema4d (R11, R11.5, R12) are not compliant with the autodesk fbx format for some reason. The QTFBXViewer is able to visualize the object geometry but not the textures. Opening a 2010.2 C4D exported fbx with 3DSMAX works fine under 3DSMAX only: 3DSMAX is able to render correctly but if I try to export the current object in a new FBX, then the texture problem comes up. Contrary, if I REASSIGNS all materials to the current object inside 3DSMAX, then the exported FBX file is correct: OSG (2.8.3) fbx plugin converter works well on textures and the QTFBXViewer visualization works fine. So, I've reported this kind of problem to MAXON but seems that their fbx format is validates. So, at the end, we have no direct solution to direct carry fbx file from C4D to OSG. Where is possible, we set the materials on 3DSMAX to then export a new FBX or we use a WRL format that works fine in some cases (not for ALL cases because this format has some problems about selections...). Someone else has a similar experience about fbx files from C4D? Thank you! Cheers, Dario -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33165#33165 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::DrawElements - i missed something?
Hi, I have no errors, just version using draw elements is not displayed. I'm using VC2008 Express under Vista64 on GF9800GT. Are there any limitations using draw elements i should know about? Thank you! Cheers, Robert -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33167#33167 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Terrain tiles disappears
Hi, I use osg and VRJugggler (for Virtual reality application) to display a terrain generated with VirtualPlanetBuilder. I load the terrain in VRJuggler using osg::DatabasePager. The load works well. I use head tracking in VRJuggler. But when I move the head or I move the terrain in my scene, some tiles doesn't appear on the screen while these tiles should be displayed. This does not come from the near plane because some near tiles appear and some further tiles doesn't appear. Can you help me please? Thank you. Lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33168#33168 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain tiles disappears
Hi, In fact, I obtain the same thing with osgViewer (cf. attachment). What is the problem? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33169#33169 Attachments: http://forum.openscenegraph.org//files/image_165.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] FBX texture export problem.
Hi, Am 28.10.10 10:34, schrieb Dario Minieri: Someone else has a similar experience about fbx files from C4D? we ditched FBX for C4D export completely, because we had missing geometries / vertices, wrong animations, etc. And the culprit was cinema4d, because even the FBX-viewer for Quicktime couldn't display the geometries and animations exported from cinema (we tried 10 and 11.5). We switched to 3ds for the geometries and invented a custom format for the animations (our animation-system is not osgAnimation-based), we transferred keyframes and values by hand... Fortunately the animations were rather simple. Cinema4D is a piece of *** if you ask me. I am still looking for an alternative on Mac OSX (sorry blender, can't wrap my head around you) Just my 2 cents, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Video capture with 3D augmented reality
I want to record a video and put 3D augmented reality on top of each frame of the AVI. Due to the fact that I don't want to skip frames, I store all AVI frames in memory during recording and after each video frame has been captured, I also store the view and projection matrices of the 3D view that is currently applicable on this video frame. The input of the camera is 640 x 480 and my application usually renders in 1280 x 1024 windows. The video frames can be retrieved from an array of unsigned char arrays (stored in m_RingBuffer) I want to achieve the rendering of the 3D data on top of the video frames in a post-processing step (which is part of the work done in a thread called VideoPostRecThread). I follow this strategy: 1) I set up a pre-rendering HUD camera (m_pHudCamera) which looks at a quad geometry with one of the video frames as a texture (m_RenderTexture) 2) The HUD camera is the child of a snapshot camera (m_pSnapshotcamera) . The snapshot renders the 3D data. The output of the snapshot camera should go back to the video frame, but I also store it temporarily in an image (m_SnapshotImage). For this, I disabled the GL_COLOR_BUFFER_BIT clear mask of the snapshot camera, to make sure the rendered outputs of the HUD camera are not cleared. I also use two callbacks: 1) a pre-draw callback applied on the HUD camera: the texture of the quad geometry (m_RenderTexture) is updated each time with a new frame. Name: m_UpdateCallback (instance of the TexturePreDrawCallback struct). 2) a post-draw callback: my thread is blocked until all the 3D data is rendered on top of the HUD contents; the callback unblocks my thread (using a mutex called m_SnapshotMutex). After this, I can do some post-processing (like for example saving the AVI or updating my GUI that another frame has been post-processed). Name: m_VideoCallback (instance of the VideoPostDrawCallback struct) Here are my callback definitions: Code: struct VideoPostDrawCallback : public osg::Camera::DrawCallback { VideoPostDrawCallback(){} virtual void operator() ( osg::RenderInfo renderInfo) const { renderingCompleted(); } boost::signals2::signalvoid(void) renderingCompleted; }; struct TexturePreDrawCallback : public osg::Camera::DrawCallback { TexturePreDrawCallback() {} virtual void operator() ( osg::RenderInfo renderInfo) const { updateCamera(); } boost::signals2::signalvoid(void) updateCamera; }; And here is the definition of my thread class Code: class VideoPostRecThread : public VideoRecWithArThread { Q_OBJECT friend class VideoPostDrawCallback; public: VideoPostRecThread (boost::shared_ptrIDSCameraManager pCamMgr, unsigned int maxFrames, QObject *parent = NULL); ~VideoPostRecThread (); void renderingCompleted(); void updateTextureCamera(); private: virtual void postProcess(); void setupImages(); void setupHudCamera(); void setupSnapshotCamera(); osg::ref_ptrosg::Camera m_pSnapshotcamera; osg::ref_ptrosg::Camera m_pHudCamera; osg::ref_ptrosg::Image m_TextureImage; osg::ref_ptrosg::Image m_SnapshotImage; osg::ref_ptrosg::Texture2D m_RenderTexture; osg::ref_ptrosg::Geode m_QuadGeode; osg::ref_ptrVideoPostDrawCallback m_VideoCallback; osg::ref_ptrTexturePreDrawCallback m_UpdateCallback; QWaitCondition m_SnapshotCondition; QMutex m_SnapshotMutex; unsigned int m_CurrentArFrameIndex; }; Here is the implementation of the VideoPostRecThread class. Code: void VideoPostRecThread ::setupImages() { m_SnapshotImage = new Image(); m_SnapshotImage-allocateImage(1280,1024,1, GL_RGBA, GL_UNSIGNED_BYTE); m_TextureImage = new Image(); } void VideoPostRecThread ::setupHudCamera() { // Create the texture to render to m_RenderTexture = new osg::Texture2D; m_RenderTexture-setDataVariance(osg::Object::DYNAMIC); m_RenderTexture-setInternalFormat(GL_RGBA); osg::ref_ptrosg::Geometry screenQuad; screenQuad = osg::createTexturedQuadGeometry(osg::Vec3(), osg::Vec3(1280, 0.0, 0.0), osg::Vec3(0.0, 1024, 0.0)); m_QuadGeode = new osg::Geode; m_QuadGeode-addDrawable(screenQuad.get()); m_pHudCamera = new osg::Camera; m_pHudCamera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); m_pHudCamera-setRenderOrder(osg::Camera::PRE_RENDER); m_pHudCamera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); m_pHudCamera-setProjectionMatrix(osg::Matrix::ortho2D(0, 1280, 0, 1024)); m_pHudCamera-setViewMatrix(osg::Matrix::identity()); m_pHudCamera-setViewport(0,0,1280,1024); m_pHudCamera-addChild(m_QuadGeode);
Re: [osg-users] [forum] Video capture with 3D augmented reality
Hi, Can this post be removed ? I posted this in the wrong forum group. I already moved it to the General Forum of the OpenSceneGraph list. Thank you! Cheers, benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33173#33173 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::DrawElements - i missed something?
Hi, I have found one interesting behaviour yet: osg::ref_ptr osg::UIntArray array = new osg::UIntArray(); array-push_back( 0 ); array-push_back( 1 ); array-push_back( 2 ); array-push_back( 3 ); p_geometry-addPrimitiveSet( new osg::DrawElementsUInt( osg::PrimitiveSet::TRIANGLES, array-size(), array-front() ) ); And it works. But anybody have any idea what was wrong before? Thank you! Cheers, Robert -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33174#33174 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain tiles disappears
Hi, Are you rendering the front or back? The image looks if you are renderuing the terrain from below, so from the back side.. Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33175#33175 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain geometry
Hi, After deep analyze of osgTerrain code i found solution fine for me. In original code all geometry are generated and keeped in GeometryTechnique class , so one solution could be changes in geometry techniuqe object or creating own class deriving from terrain technique. I've made second solution and its working :). Using this method you could implement own terrain algorithm to generate geometry. I think there is no possibility to edit geometry created in standard geometry technique object as it is not avaiable outside (all members are totally private). Thank you! Cheers, Robert -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33176#33176 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain tiles disappears
Hi, The problem is only when I am rendering the back (the underside of the terrain). Is it normal? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33177#33177 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain tiles disappears
Hi Lucie, On Thu, Oct 28, 2010 at 1:15 PM, lucie lemonnier lucielemonn...@hotmail.fr wrote: The problem is only when I am rendering the back (the underside of the terrain). Is it normal? The VirtualPlanetBuilder assigned cluster culling callbacks on tiles when you have built an geocentric databases, such as a whole earth globe. The cluster culling callback culls tiles if you are viewing them from below - this enables it to cull away tiles that are on the otherside of the earth. You can disable cluster culling via the osg::Camera's CullSettings. Robert. ___ 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, does anybody know, what formats (like IFC) can include object properties, like length/area/volume, material properties (thickness, material name ...) I mean, we need some format (which can be opened in the OSG) and which is able to be exported from Autodesk (Revit, Autocad), Graphisoft ArchiCAD, Tekla etc. I know about DXF, but it does not include those attributes/values. Thank you! Cheers, Zdravko -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33178#33178 ___ 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
Zdravko wrote: Hi, Yes, ActiveX is here: http://openscenegraph.org/projects/osg/attachment/wiki/Community/WindowingToolkits/ Now, does someone have expirience with IFC? Cheers, Zdravko here is IFC SDK: http://forge.osor.eu/projects/ifc-sdk/ and here is IFC SDK start page: http://forge.osor.eu/plugins/wiki/index.php?id=175type=g Cheers Zdravko -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33180#33180 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_POINTS primitiveset with only 1 point doesn't reach shaders
Thanks for your replies. I understand what's going on with osggeometryshaders with respects to the camera. I confirm turning culling off (I use osg::Node::setCullingActive(false) on my geode) makes it work. Thanks again. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33182#33182 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_POINTS primitiveset with only 1 point doesn't reach shaders
Hi Fred, On Thu, Oct 28, 2010 at 3:01 PM, Fred Smith osgfo...@tevs.eu wrote: Thanks for your replies. I understand what's going on with osggeometryshaders with respects to the camera. I confirm turning culling off (I use osg::Node::setCullingActive(false) on my geode) makes it work. This does suggest that small feature culling may well be the cause. I'm surprised my suggested change didn't work for you, perhaps something went amiss with the application of the change. Others in the past have come up across this issue and solved it roughly the way I've explain. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] viewer1=viewer2. Is it possible?
Hi, I'd to initialize my scene one cpp-file and launch it in another. Is it possible Code: osgViewer::Viewer pipeviewer; pipeviewer=osgScene(); osgScene(): osgViewer::Viewer osgScene(){ osgViewer::Viewer viewer; ...viewer initialising procedures return viewer; } Thank you! Cheers, John[/code][/quote] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33184#33184 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GL_POINTS primitiveset with only 1 point doesn't reach shaders
robertosfield wrote: This does suggest that small feature culling may well be the cause. I'm surprised my suggested change didn't work for you, perhaps something went amiss with the application of the change. Others in the past have come up across this issue and solved it roughly the way I've explain. Your tip *was* correct. I tried it first with osggeometryshaders and the screen actually remained empty. This wasn't because of culling this time, but because of how the camera was set up (bounding sphere reduced to a point maybe). Long story short - this was the culling. Disabling culling at camera or geode level is working for me either way. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33185#33185 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Terrain tiles disappears
Hi, Thank you for your reply. I have change the CullSettings and it works well. Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33186#33186 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer1=viewer2. Is it possible?
Hi John, Is there a reason you can't dynamically allocate the viewer and return a ref_ptr to it, instead of returning by value? Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33188#33188 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] rendering the large point data
Hi, I am working with 3-D point data. When I want to render millions of points, either the rendering, zoom-in, zoom-out and panning goes very slow or the program crashes. Is there any method in OSG for rendering huge point data easily? Thank you! Cheers, Vipin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33189#33189 ___ 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
The weird thing is that it is not working with the frame buffer object render target (black image). Should I consider a pbuffer ? Thank you! Cheers, benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33190#33190 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
On 10/28/2010 10:25 AM, Vipin Panwar wrote: I am working with 3-D point data. When I want to render millions of points, either the rendering, zoom-in, zoom-out and panning goes very slow or the program crashes. Is there any method in OSG for rendering huge point data easily? You don't tell us how you're representing the points currently, so we don't know what improvements to suggest. Also, do you need the point data to be dynamically updateable, or is it unchanging? If so, can you use vertex shaders or not? -- 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] viewer1=viewer2. Is it possible?
Thanks. No, there isn't any reason=) Is this code write? I get an error and a program closes. Code: osg::ref_ptrosgViewer::Viewer pipeviewer; pipeviewer=osgScene(); while (!pipeviewer-done()) { pipeviewer-frame(); } osgScene(): Code: osg::ref_ptrosgViewer::Viewer osgScene() { osg::ref_ptrosgViewer::Viewer viewer; ...viewer initialising commands return viewer; } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33192#33192 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer1=viewer2. Is it possible?
I have an error on such simple code. How must be written viewer? Code: int main() { osg::ref_ptrosgViewer::Viewer viewer; viewer.get()-setCameraManipulator(new osgGA::TrackballManipulator()); while(!viewer.get()-done()) { viewer.get()-frame(); } return 0; } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33193#33193 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
Hi, I am reading the points from LAS file and rendering the data. The data is not dynamically updated. I am pasting the subset fo code. So that you can find out how I am rendering the points. for(unsigned long k = 1; k no_points; k ++) { lasVertices-push_back( osg::Vec3( x_coord, y_coord, z_coord)); } free(buff); } colors-push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); lasGeometry-setVertexArray( lasVertices); lasGeometry-setColorArray(colors); lasGeometry-setColorBinding(osg::Geometry::BIND_OVERALL); for(prim = 0 ; prim no_points-1; prim = prim + 1) { lasPrim = new osg::DrawElementsUInt(osg::PrimitiveSet::POINTS); lasPrim - push_back(prim); lasGeometry-addPrimitiveSet(lasPrim); } //lasGeometry-addPrimitiveSet(lasPrim); osg::ref_ptrosg::StateSet state = root-getOrCreateStateSet(); state-setMode(GL_LIGHTING, osg::StateAttribute::OFF); //osg::PolygonMode* pm = new osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE ); // Force wireframe rendering. //state-setAttributeAndModes( pm, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE ); viewer.setSceneData( root ); viewer.addEventHandler( new PickHandler ); viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.run(); viewer.realize(); while( !viewer.done() ) { viewer.frame(); } Thank you! Cheers, Vipin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33194#33194 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer1=viewer2. Is it possible?
You have to use 'new' somewhere, like: osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer(); Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33195#33195 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
Hi, I am reading the points from LAS file and rendering the data. The data is not dynamically updated. I am pasting the subset fo code. So that you can find out how I am rendering the points... for(unsigned long k = 1; k no_points; k ++) { lasVertices-push_back( osg::Vec3( x_coord, y_coord, z_coord)); } colors-push_back(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); lasGeometry-setVertexArray( lasVertices); lasGeometry-setColorArray(colors); lasGeometry-setColorBinding(osg::Geometry::BIND_OVERALL); for(prim = 0 ; prim no_points-1; prim = prim + 1) { lasPrim = new osg::DrawElementsUInt(osg::PrimitiveSet::POINTS); lasPrim - push_back(prim); lasGeometry-addPrimitiveSet(lasPrim); } //lasGeometry-addPrimitiveSet(lasPrim); osg::ref_ptrosg::StateSet state = root-getOrCreateStateSet(); state-setMode(GL_LIGHTING, osg::StateAttribute::OFF); //osg::PolygonMode* pm = new osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE ); // Force wireframe rendering. //state-setAttributeAndModes( pm, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE ); viewer.setSceneData( root ); viewer.addEventHandler( new PickHandler ); viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.run(); viewer.realize(); while( !viewer.done() ) { viewer.frame(); } Thank you! Cheers, Vipin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33196#33196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] viewer1=viewer2. Is it possible?
thanks a lot [Exclamation] [Exclamation] [Exclamation] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33197#33197 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
On 10/28/2010 10:57 AM, Javier Taibo wrote: I suggest you to use just one primitive for all the point cloud, not a primitive for each point. And depending on how many points you have, it may be necessary to break the full set up into blocks so that some can be culled and not drawn if you are moving your viewpoint around and the entire set is not all in view at once. Other level of detail techniques may be needed in order to show fewer points when their absence would not be noticed. -- 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] rendering the large point data
Hi Javier, thanx for reply... initially, I was also making one primitive for whole data, but it was not rendering the huge data. It was working fine only for thousands of points. Thank you! Cheers, Vipin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33201#33201 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
Hi Vipin, You can take a look to the .3dc plugin sources. Here the geometry is batched into chunks of 10.000 points, which is a well-working size for batching geometry as Chris said. If you spatialize your data correctly may be you don't have to use LOD techniques, it depends of the amount of data. Cheers. 2010/10/28 Chris 'Xenon' Hanson xe...@alphapixel.com On 10/28/2010 10:57 AM, Javier Taibo wrote: I suggest you to use just one primitive for all the point cloud, not a primitive for each point. And depending on how many points you have, it may be necessary to break the full set up into blocks so that some can be culled and not drawn if you are moving your viewpoint around and the entire set is not all in view at once. Other level of detail techniques may be needed in order to show fewer points when their absence would not be noticed. -- 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 -- 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] rendering the large point data
Hi, Xenon and Jordi, thanx for replying. I am also going for spatial blocking using quad trees and display the block and its neighbors when zoom in the data. But I want to know whether there is more convenient method in OSG for these type of problems. Thank you! Cheers, Vipin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33203#33203 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] rendering the large point data
On 10/28/2010 11:35 AM, Vipin Panwar wrote: Hi, Xenon and Jordi, thanx for replying. I am also going for spatial blocking using quad trees and display the block and its neighbors when zoom in the data. But I want to know whether there is more convenient method in OSG for these type of problems. Usually, for Lidar data that is fully 3D, and not just a 2.5D heightfield, you'll want a full octree, not a quadtree. I'm assuming you're using LibLAS. An associate of mine has been doing work on LibLAS to extend it with queryable spatial indexing, and possibly frustum querying in the future. You should check into the recent work on LibLAS. -- 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
[osg-users] OpenThreads setProcessorAffinity / Multithreaded vertex array modification
Hi, we are currently working on a routine that deforms large vertex arrays on the fly. To speed this up we implemented multithreading using OpenThreads. Simple example: We have a point cloud of e.g. 10 million points. The calculation is done on e.g. 4 processors. The first thread is assigned to processor 0 using setProcessorAffinity(0) and works on the first 2.5 million points. On the second thread setProcessorAffinity(1) is applied. The other points are equivalently handled by processors 2 and 3. Performance scales by about 90% per doubled processor count. This works fine on WINDOWS 32-Bit. When testing this on 64bit Linux we noticed that setProcessorAffinity returns -1. Performance does not scale at all. All operations seem to be executed on one CPU. I already learned that using pthreads on linux setProcessorAffinity won't work at all? The operation system does not seem to automatically apply our threads to different cpus. So what can you suggest to distribute our calculations to multiple cpus on LINUX? Thank you! Cheers, Johannes -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33205#33205 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetTexImage failed on Windows
Hi, I inherited some code to read back texture data. This works fine on Linux platform but seg fault on Windows. Following is the list of the code segments, .. // create and configure the texture that we're going // to use as target for render-to-texture (depth) m_texture = new osg::TextureRectangle; m_texture-setTextureSize(m_size.width, m_size.height); m_texture-setInternalFormat(GL_RGBA32F_ARB); m_texture-setSourceType(GL_FLOAT); m_texture-setSourceFormat(GL_RGBA); m_texture-setFilter(osg::Texture::MIN_FILTER, osg::Texture::NEAREST); m_texture-setFilter(osg::Texture::MAG_FILTER, osg::Texture::NEAREST); m_texture-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); m_texture-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); // receive the data every iteration float *m_buffer = new float[m_size.width* m_size.height*4]; m_texture-getTextureObject( m_contextID )-bind(); glGetTexImage( m_texture-getTextureTarget(), 0, GL_RGBA, GL_FLOAT, m_buffer[0] ); The code seg fault when call to glTexImage. Did anyone have the save problem or am I missing steps on Windows. ... Regards, weiliang -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33206#33206 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disable the Mouse default event in osg
Hi, ... I am new in OpenSceneGraph. I want to disable the mouse event and use these event (Rotate, Zoom, Pan ) in separate buttons. Thank you! Cheers, Lalit Manchwari -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33198#33198 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Disable the Mouse default event in osg
Hi, On 29/10/10 3:50 , Lalit Manchwari wrote: ... I am new in OpenSceneGraph. I want to disable the mouse event and use these event (Rotate, Zoom, Pan ) in separate buttons. What do you mean 'disable the mouse event'? If you don't attach a manipulator then no events will be processed. You can then control the camera view matrix externally via GUI buttons. HTH, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads setProcessorAffinity / Multithreaded vertex array modification
Hi Johannes, On 29/10/10 5:31 , Johannes Scholz wrote: When testing this on 64bit Linux we noticed that setProcessorAffinity returns -1. Performance does not scale at all. All operations seem to be executed on one CPU. I already learned that using pthreads on linux setProcessorAffinity won't work at all? The operation system does not seem to automatically apply our threads to different cpus. It should work just as on Windows. If you look through the implementation in PThread.c++ you'll notice that there are a few instances where -1 is returned; it would help to find out what exactly is happening: - did cmake fail to find a usable sched_setaffinity() or - did the actual call fail Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Create Cylinder Around Line
Hi Ulrich, I wanted to know if the following is a worthwhile option: I have the data as a shapefile (.shp) and need to create the 3D model from that. I realize that osg can load shp files so is it a good option to modify the plugin dll that loads shp files ? So that when it comes across a polyline feature, it creates a cylinder around it and then loads it. Also, I tried loading a .shp in a trial program and using visual studio debugging step through, I was not able to step through the functions that are called in the dll (i took a look at the dll source code) Look forward to your opinion. Thanks, Sincerely, Sanat. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33209#33209 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Create Cylinder Around Line
Hi Sanat, On 29/10/10 8:28 , Sanat Talmaki wrote: I have the data as a shapefile (.shp) and need to create the 3D model from that. I realize that osg can load shp files so is it a good option to modify the plugin dll that loads shp files ? So that when it comes across a polyline feature, it creates a cylinder around it and then loads it. Modifying plugins to implement application-specific behaviour is not a good idea. I always try to say as general as possible, eg. in your case to be able to load data from (best case) all supported file formats. I don't know shapefiles but I presume what you're after is stored as LINES or LINE_STRIPs. As roughtly outlined before I'd create a NodeVisitor that checks all Geodes to see if they have any LINES or LINE_STRIP geometry in them and if so extract the individual lines from that. This can then be used as input for the cylinder generation. Also, I tried loading a .shp in a trial program and using visual studio debugging step through, I was not able to step through the functions that are called in the dll (i took a look at the dll source code) You might need to tell VS where to find the source for the plugin or the pdb file. Sorry, I'm no VS expert :-| Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] glGetTexImage failed on Windows
Hi, forget about my posting. i just find out the problem is with the allocation of the buffer. i accidentally cleared the buffer (which resize the buffer to size 0). just ignore my posting. ... Thank you! Cheers, weiliang -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33211#33211 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] osg quicktime plugin error
Hi, ... I compiled osg with quicktime plugin. Now now this error message comes Error while initializing the quicktime - -2095 error comes and the video is not played. Why id that? How can i get away from that Thank you! Cheers, Aruna -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33213#33213 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org