[osg-users] VPB How to add geometry to an existing terrain
Hello: A year ago we built a terrain of Mexico using data from GTopo30 (30) and SRTM (3) for the geometry and Bluemarble (15) and Landsat (near 1) for the texture. It took a complete weekend and 100GB IVE database in a Dell Precision T5400 with 8GB RAM and 1TB HD. Today we want to refine the terrain with data for specific regions (1 from INEGI) without rebuilding everything. After all we would not change the existing data (levels 1 to 12), just add finer geometry creating upper levels. Is that possible with current VPB? How? Thanks in advance. -- A. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Two Viewports with one Camera
Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. 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] Two Viewports with one Camera
Hi Martin, On 29/10/10 17:17 , Martin Großer wrote: I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) I can't say if it's possible, but if it is then I'd guess it renders the same scene twice. In this case it might be easier to render to a texture and just display the texture in two viewports. /ulrich ___ 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
Hi, I'd do it all with render to texture (RTT) cameras. There you can control the exact size of the output, flip the input image by just flipping texture coordinates and decide what you want to do with the output (save/display). The main OSG camera then just becomes a texture displayer. jp On 28/10/10 10:01, benedikt naessens wrote: 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);
Re: [osg-users] Two Viewports with one Camera
Ah OK, the render to texture idea is maybe a good alternative. Do the RTT affect the performance? My idea was a observer pattern. The camera settings are in a subject object and the osg::Camera is in the observer object. When the settings to be change the subject notify the observer (cameras with different viewports). But I think it is time consuming. Do you think, the RTT is the better way? Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 17:32:34 +1100 Von: Ulrich Hertlein u.hertl...@sandbox.de An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, On 29/10/10 17:17 , Martin Großer wrote: I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) I can't say if it's possible, but if it is then I'd guess it renders the same scene twice. In this case it might be easier to render to a texture and just display the texture in two viewports. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- 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] rendering the large point data
Hi, I've stumbled across this at a conference, it might be useful. http://www.hpi.uni-potsdam.de/doellner/publications/year/2010/1086/RD10.html jp On 28/10/10 19:35, 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. 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 -- 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] VPB How to add geometry to an existing terrain
http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/PatchExisting On 29/10/10 08:05, Alejandro Aguilar Sierra wrote: Hello: A year ago we built a terrain of Mexico using data from GTopo30 (30) and SRTM (3) for the geometry and Bluemarble (15) and Landsat (near 1) for the texture. It took a complete weekend and 100GB IVE database in a Dell Precision T5400 with 8GB RAM and 1TB HD. Today we want to refine the terrain with data for specific regions (1 from INEGI) without rebuilding everything. After all we would not change the existing data (levels 1 to 12), just add finer geometry creating upper levels. Is that possible with current VPB? How? Thanks in advance. -- A. ___ 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] Two Viewports with one Camera
I made a thumbnail sketch with the two concepts (see png). On the one hand (blue graph) I use three cameras with the diffrent viewport settings, on the other hand (yellow graph) I use one camera (ortho) and create geometry nodes (planes) and map the texture on this planes. The main question is: what is the efficient way? Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:00:40 +0200 Von: Martin Großer grosser.mar...@gmx.de An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Ah OK, the render to texture idea is maybe a good alternative. Do the RTT affect the performance? My idea was a observer pattern. The camera settings are in a subject object and the osg::Camera is in the observer object. When the settings to be change the subject notify the observer (cameras with different viewports). But I think it is time consuming. Do you think, the RTT is the better way? Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 17:32:34 +1100 Von: Ulrich Hertlein u.hertl...@sandbox.de An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, On 29/10/10 17:17 , Martin Großer wrote: I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) I can't say if it's possible, but if it is then I'd guess it renders the same scene twice. In this case it might be easier to render to a texture and just display the texture in two viewports. /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- 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 -- GMX DSL Doppel-Flat ab 19,99 euro;/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl attachment: camera_viewport_concept.png___ 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, ... Thanks for reply.. If i comment the manipulator then data is not displaying. I m using code... ... ... lasGeometry-setVertexArray( lasVertices); lasGeometry-setColorArray(colors); lasGeometry-setColorBinding(osg::Geometry::BIND_PER_VERTEX); lasGeometry-addPrimitiveSet(lasPrimitive); root-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF); //viewer.setCameraManipulator(new osgGA::TrackballManipulator()); viewer.setSceneData( root ); viewer.addEventHandler(new osgViewer::StatsHandler); viewer.addEventHandler(new osgViewer::WindowSizeHandler); viewer.realize(); while( !viewer.done() ) { viewer.frame(); } ... . And is there any osg functions that i can directly for rotate pan and zoom buttons. Thank you! Cheers, Lalit -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33221#33221 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBX Up axis bug
Hi Thomas, As discussed earlier, readerwriters should, by default, not change anything about the orientation simply because there is no standard one. However, a readerwriter may provide options to read/write/modify this. As far as I know, the FBX format itself doesn't define its own orientation. Hope this helps. Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Thomas Hogarth thomas.hoga...@googlemail.com a écrit : Hi all Just a little heads up for anyone using fbx plugin with fbx sdk 2011.2. I found a bug with the up axis. When exporting from 3ds max the axis are stored as x=0 y=1 z=2 But for some reason the fbx sdk 2011.2 sets the eUpVector enum in kfbxaxissystem.h to the following enum eUpVector { XAxis = 1, YAxis = 2, ZAxis = 3 }; changing this to enum eUpVector { XAxis = 0, YAxis = 1, ZAxis = 2 }; fixed our problems Hope someone finds this useful Tom ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] New osgText library - Questions
Thanks Robert. I'll have a look after regenerate/clean/make everything... Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Robert Osfield robert.osfi...@gmail.com a écrit : On Wed, Oct 27, 2010 at 1:21 PM, Sukender suky0...@free.fr wrote: Alright then... but why didn't my app compile, then? I can't answer this. Are there known regressions? I don't know of any present regressions, if there are lets us know. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Disable the Mouse default event in osg
On 29/10/10 18:30 , Lalit Manchwari wrote: ... Thanks for reply.. If i comment the manipulator then data is not displaying. I m using code... That's because your camera isn't positioned properly which means it's not actually looking at the object. You have to setup the camera view matrix accordingly to your requirements. /ulrich ___ 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 Lalit, If i comment the manipulator then data is not displaying. When you don't use a camera manipulator, you should take care of the the view matrix of the viewer. You can use something like viewer.getCamera()-setViewMatrixAsLookAt(eye, center, up); For more information about this function, google gluLookAt. Mourad ___ 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, I'm very curious to what has gone amiss on your system. What Linux distro are you using? Did you build the OpenThreads/OSG yourself? Robert. On Thu, Oct 28, 2010 at 7:31 PM, Johannes Scholz johannes.sch...@vtxtech.net wrote: 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großer grosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. 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
[osg-users] Image cache and manually release
Hi, I would like to release an image, but there is a cache whose keep my image in memory. Even if i put my ref_ptros::Image to NULL, the image is always in memory. Do you know how i can manually destruct my object but without desactivate Image Cache ? Thank you! Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33229#33229 ___ 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 Robert, hi Ulrich, we are using Ubuntu 9.04 64-bit on AMD Opterons. And yes, we built OSG by ourself. We are using OSG release 2.8.3. We'll check cmake and come up with further details later. Thanks so far. Best Regards, Johanens -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33230#33230 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Image cache and manually release
Hi Patrice, You could try things in osgDB::Registry - use expiry time: addEntryToObjectCache(..., timestamp) removeExpiredObjectsInCache() - Or remove all things in cache: clearObjectCache() - Or replace the prvious one: addEntryToObjectCache(filename, [NULL or a dummy object]). Not sure NULL will work as expected here (to be tested). Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Patrice Defond patrice.desfo...@rsacosmos.com a écrit : Hi, I would like to release an image, but there is a cache whose keep my image in memory. Even if i put my ref_ptros::Image to NULL, the image is always in memory. Do you know how i can manually destruct my object but without desactivate Image Cache ? Thank you! Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33229#33229 ___ 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] Two Viewports with one Camera
Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfield robert.osfi...@gmail.com An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großer grosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. 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 -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
Hi, On 29/10/10 10:48, Martin Großer wrote: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Do you want something different from what happens if you run osgcompositeviewer cow.osg. There, each view can have its own manipulator. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großergrosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. Cheers Martin -- GMX DSL Doppel-Flat ab 19,99euro;/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 -- 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] Two Viewports with one Camera
Hello, the problem is that I want to use a embedded viewer (gtk), too. I guess it doesn't work with the composite viewer. Or is it possible? Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: J.P. Delport jpdelp...@csir.co.za An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 10:48, Martin Großer wrote: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Do you want something different from what happens if you run osgcompositeviewer cow.osg. There, each view can have its own manipulator. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großergrosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. Cheers Martin -- GMX DSL Doppel-Flat ab 19,99euro;/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 -- 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 -- GRATIS! Movie-FLAT mit über 300 Videos. Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
Hi, On 29/10/10 11:02, Martin Großer wrote: Hello, the problem is that I want to use a embedded viewer (gtk), too. I guess it doesn't work with the composite viewer. Or is it possible? sorry, I'm not sure. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: J.P. Delportjpdelp...@csir.co.za An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 10:48, Martin Großer wrote: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Do you want something different from what happens if you run osgcompositeviewer cow.osg. There, each view can have its own manipulator. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großergrosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. Cheers Martin -- GMX DSL Doppel-Flat ab 19,99euro;/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 -- 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 -- 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] Two Viewports with one Camera
Hello, OK, for the completeness of my problem. I want to use two different viewer. An normal OSGViewer and a GTKViewer. The common denominator is the osg::Viewer class. I want to use one or more viewports and one or more cameras. And every camera can show different scenes. The cameras should have a manipulator like trackball manipulator. I guess the problem is not so trivial. I try to do this: - First camera is the master camera (set camera and scene data in viewer) viewer-setCamera(cam_1); root-addChild(scene_1); viewer-setSceneData(root); - next camera set in the scene graph and the scene is a child of the camera cam_2-addChild(scene_2); root-addChild(cam_2); - and so on for more cameras with a scene - now I set the viewports cam_1-viewport(...); cam_2-viewport(...); - it works fine, but now I want to add a third viewport with the first camera, too cam_1-addChild(scene_1); root-addChild(cam_1); cam_1-setviewport(...); - it is unsurprising that doesn't work That is my actual state of affairs. Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 11:14:56 +0200 Von: J.P. Delport jpdelp...@csir.co.za An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 11:02, Martin Großer wrote: Hello, the problem is that I want to use a embedded viewer (gtk), too. I guess it doesn't work with the composite viewer. Or is it possible? sorry, I'm not sure. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: J.P. Delportjpdelp...@csir.co.za An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 10:48, Martin Großer wrote: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Do you want something different from what happens if you run osgcompositeviewer cow.osg. There, each view can have its own manipulator. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großergrosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. Cheers Martin -- GMX DSL Doppel-Flat ab 19,99euro;/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 -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal
Re: [osg-users] Image cache and manually release
Thank for your help Sukender. I can't use the methods removeExpiredObjectsInCache and clearObjectCache because the rest of my application need the cache. It is very specific for a module : it loads big images. So i test addEntryToObjectCache. - With NULL in object : OSG make an error (Error file does not contain an osg::Object) - if i call the function with a timestamp to 0 or 0.001 ... but my object is not release. Do you have more ideas ? Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33237#33237 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
I try this concept, now. (see png) I'm not sure, but I guess it is a elegant solution. Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 11:35:04 +0200 Von: Martin Großer grosser.mar...@gmx.de An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hello, OK, for the completeness of my problem. I want to use two different viewer. An normal OSGViewer and a GTKViewer. The common denominator is the osg::Viewer class. I want to use one or more viewports and one or more cameras. And every camera can show different scenes. The cameras should have a manipulator like trackball manipulator. I guess the problem is not so trivial. I try to do this: - First camera is the master camera (set camera and scene data in viewer) viewer-setCamera(cam_1); root-addChild(scene_1); viewer-setSceneData(root); - next camera set in the scene graph and the scene is a child of the camera cam_2-addChild(scene_2); root-addChild(cam_2); - and so on for more cameras with a scene - now I set the viewports cam_1-viewport(...); cam_2-viewport(...); - it works fine, but now I want to add a third viewport with the first camera, too cam_1-addChild(scene_1); root-addChild(cam_1); cam_1-setviewport(...); - it is unsurprising that doesn't work That is my actual state of affairs. Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 11:14:56 +0200 Von: J.P. Delport jpdelp...@csir.co.za An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 11:02, Martin Großer wrote: Hello, the problem is that I want to use a embedded viewer (gtk), too. I guess it doesn't work with the composite viewer. Or is it possible? sorry, I'm not sure. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: J.P. Delportjpdelp...@csir.co.za An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi, On 29/10/10 10:48, Martin Großer wrote: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. My idea is something like this: // Camera 1 osg::Camera* cam1 = new ... slaveCam1-setViewport(...); // Slave Camera 1 osg::Camera* slaveCam1 = new ... slaveCam1-setViewport(...); // Camera 2 osg::Camera* cam2 = new ... cam2-setViewport(...); cam2-addChild(scene); // RootNode // Camera two as a part of the scene graph. Is this clever? osg::Group* root = new ... root-addChild(scene); root-addChild(cam2); // Viewer osg::Viewer* viewer = new ... viewer-setSceneData(root); viewer-setCamera(cam1); viewer-addSlave(slaveCam1); Is this the right way? And what is your commendation to use different camera manipulators. That means, what can I do when I want to use a manipulator for the second camera (the camera in the root node). My idea is to write a GUIEventhandler. This should check the mouse position and give the viewport or the camera and then I calculate the new position like the trackball manipulator. That is the approximate idea. Do you want something different from what happens if you run osgcompositeviewer cow.osg. There, each view can have its own manipulator. jp Cheers Martin Original-Nachricht Datum: Fri, 29 Oct 2010 09:21:29 +0100 Von: Robert Osfieldrobert.osfi...@gmail.com An: OpenSceneGraph Usersosg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, I'm a bit confused by the thread, but as a general note you shouldn't go attempting to use two separate Viewport per Camera. The OSG fully supports slave Camera that can share scene graphs and share the same graphics context, so it's straight forward to implement and manage, the osgViewer design has been specifically designed to make this type of usage as simple as possible. Robert. 2010/10/29 Martin Großergrosser.mar...@gmx.de: Hello all, I would like use two viewports in my application and one camera. Is this possible? I think, the normal way is to define the viewport for a camera like: camera-setViewport(...) Is the only way to define camera, copy the camera and set the viewports separatly for every camera? The main problem is when I change the camera settings, I have to copy the camera again. Cheers Martin -- GMX DSL Doppel-Flat ab 19,99euro;/mtl.! Jetzt auch mit gratis Notebook-Flat!
Re: [osg-users] Two Viewports with one Camera
Hi Martin, 2010/10/29 Martin Großer grosser.mar...@gmx.de: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. Arggg,.. Use three camera's. Drop the idea of sharing a single Viewport on a single Camera, it's simply not a sensible idea, the OSG hasn't been designed around the ability to keep flipping Camera Viewport in the way you want. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
Hi Martin, 2010/10/29 Martin Großer grosser.mar...@gmx.de: the problem is that I want to use a embedded viewer (gtk), too. I guess it doesn't work with the composite viewer. Or is it possible? CompositeViewer and Viewer both with with a GraphicsWindowEmbedded, there is absolutely no difference when it comes to rendering, all the viewer rendering really cares about is that you have a series of one or more cameras assigned to a series of one or more graphics contexts. CompositeViewer vs Viewer is all about how you want to manage View's. Lots has been discussed about this over the years so please go read through the archives. Robert. ___ 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
Thanks for your reply ! Can you explain how the structure of the camera's then will be ? And how do you flip the coordinates ? Thank you! Cheers, benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33241#33241 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Two Viewports with one Camera
Yes, I understand. I try the RTT-Idea. Maybe it serve my purpose. Otherwise I drop this idea and try a observer pattern in my software architecture. Thank you very much. Martin Original-Nachricht Datum: Fri, 29 Oct 2010 11:02:43 +0100 Von: Robert Osfield robert.osfi...@gmail.com An: OpenSceneGraph Users osg-users@lists.openscenegraph.org Betreff: Re: [osg-users] Two Viewports with one Camera Hi Martin, 2010/10/29 Martin Großer grosser.mar...@gmx.de: Ok. I try the slave variant. I have a additional question. When I use two different cameras and three viewports, how would you implement this. Two viewport have the first camera and the third viewport has the second camera. Arggg,.. Use three camera's. Drop the idea of sharing a single Viewport on a single Camera, it's simply not a sensible idea, the OSG hasn't been designed around the ability to keep flipping Camera Viewport in the way you want. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- 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] [osgPlugins] OpenFlight Export - MultiTexturing - wrong Texture Coordinates
Hi, lately I was trying to convert an osg-file which uses multitexturing to openFlight and realized, that the texture coordinates for units 0 got corrupted. (First 3 coords are repeated again and again). So I had a look at the openFlight Plugin and found the problem in expGeometry.cpp, line 772, function writeUVList: Code: void FltExportVisitor::writeUVList( int numVerts, const osg::Geometry geom ) { unsigned int numLayers( 0 ); uint32 flags( 0 ); unsigned int idx; for( idx=1; idx8; idx++) { if( isTextured( idx, geom ) ) { flags |= LAYER_1 (idx-1); numLayers++; } } if( numLayers == 0 ) return; uint16 length( 8 + (8*numLayers*numVerts) ); _records-writeInt16( (int16) UV_LIST_OP ); _records-writeUInt16( length ); _records-writeInt32( flags ); osg::Vec2 defaultCoord( 0., 0. ); // const osg::StateSet* ss = getCurrentStateSet(); for( idx=1; idx8; idx++) { if( isTextured( idx, geom ) ) { osg::Array* t = const_castosg::Array*( geom.getTexCoordArray( idx ) ); osg::ref_ptrosg::Vec2Array t2 = dynamic_castosg::Vec2Array*( t ); if (!t2.valid()) { std::ostringstream warning; warning fltexp: No Texture2D for unit idx; osg::notify( osg::WARN ) warning.str() std::endl; _fltOpt-getWriteResult().warn( warning.str() ); t2 = new osg::Vec2Array; } else if (static_castint(t2-getNumElements()) != numVerts) { std::ostringstream warning; warning fltexp: Invalid number of texture coordinates for unit idx; osg::notify( osg::WARN ) warning.str() std::endl; _fltOpt-getWriteResult().warn( warning.str() ); } const int size = t2-getNumElements(); int vIdx; for( vIdx=0; vIdxnumVerts; vIdx++) { osg::Vec2 tc( defaultCoord ); if (vIdx size) tc = (*t2)[ vIdx ]; _records-writeFloat32( tc[0] ); _records-writeFloat32( tc[1] ); } } } } My Geometry contained 444 vertices and as many texture coordinates, so the size of the array t2 is 444 (and therefor does not equal numVerts which is 3 (using triangles)). The indices are always 0, 1, 2, so each time the function is called, the same three texture coordinates are added. I fixed this problem adding indices respectivly firstIndex as input parameter like it is done in writeVertexList: Code: void FltExportVisitor::writeUVList( int numVerts, const osg::Geometry geom, const std::vectorunsigned int indices ) { unsigned int numLayers( 0 ); uint32 flags( 0 ); unsigned int idx; for( idx=1; idx8; idx++) { if( isTextured( idx, geom ) ) { flags |= LAYER_1 (idx-1); numLayers++; } } if( numLayers == 0 ) return; uint16 length( 8 + (8*numLayers*numVerts) ); _records-writeInt16( (int16) UV_LIST_OP ); _records-writeUInt16( length ); _records-writeInt32( flags ); osg::Vec2 defaultCoord( 0., 0. ); // const osg::StateSet* ss = getCurrentStateSet(); for( idx=1; idx8; idx++) { if( isTextured( idx, geom ) ) { osg::Array* t = const_castosg::Array*( geom.getTexCoordArray( idx ) ); osg::ref_ptrosg::Vec2Array t2 = dynamic_castosg::Vec2Array*( t ); if (!t2.valid()) { std::ostringstream warning; warning fltexp: No Texture2D for unit idx; osg::notify( osg::WARN ) warning.str() std::endl; _fltOpt-getWriteResult().warn( warning.str() ); t2 = new osg::Vec2Array; } const int size = t2-getNumElements(); for( int cIdx=0; cIdxnumVerts; cIdx++) { int vIdx = indices[cIdx]; osg::Vec2 tc( defaultCoord ); if (vIdx size) tc = (*t2)[ vIdx ]; _records-writeFloat32( tc[0] ); _records-writeFloat32( tc[1] ); } } } } and Code: void FltExportVisitor::writeUVList( int numVerts, const osg::Geometry geom, unsigned int first ) { unsigned int numLayers( 0 ); uint32 flags( 0 ); unsigned int idx; for( idx=1; idx8; idx++) { if( isTextured( idx, geom ) ) { flags |= LAYER_1 (idx-1); numLayers++; } } if( numLayers == 0 ) return; uint16 length( 8 + (8*numLayers*numVerts) ); _records-writeInt16( (int16) UV_LIST_OP ); _records-writeUInt16( length ); _records-writeInt32( flags ); osg::Vec2 defaultCoord( 0., 0. ); // const osg::StateSet* ss =
Re: [osg-users] Image cache and manually release
Hi Patrice, Got two ideas : 1. addEntryToObjectCache(filename, new MyDummyEmptyObject()); 2. addEntryToObjectCache(, 0.0001); removeExpiredObjectsInCache();(if and only if this does not interract negatively with the rest of your app). I personnally prefer the first one. If it still doesn't work, try using a debugger and trace when the image gets referenced. Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Patrice Defond patrice.desfo...@rsacosmos.com a écrit : Thank for your help Sukender. I can't use the methods removeExpiredObjectsInCache and clearObjectCache because the rest of my application need the cache. It is very specific for a module : it loads big images. So i test addEntryToObjectCache. - With NULL in object : OSG make an error (Error file does not contain an osg::Object) - if i call the function with a timestamp to 0 or 0.001 ... but my object is not release. Do you have more ideas ? Cheers, Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33237#33237 ___ 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] [forum] Video capture with 3D augmented reality
Hi, I think start with osgprerender. Something like: RTT camera 1 looks at a quad with your input video. Change the texture coordinates on the quad until your video is right way up. RTT camera 2 uses the same output texture as 1 (don't clear color) and draws the scene. OSG camera just displays the output texture. jp I've attached a modified osgprerender with 2 rtt cameras. The first just clears, the second renders. On 29/10/10 12:10, benedikt naessens wrote: Thanks for your reply ! Can you explain how the structure of the camera's then will be ? And how do you flip the coordinates ? Thank you! Cheers, benedikt -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33241#33241 ___ 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. /* OpenSceneGraph example, osgprerender. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include osg/GLExtensions #include osg/Node #include osg/Geometry #include osg/Notify #include osg/MatrixTransform #include osg/Texture2D #include osg/TextureRectangle #include osg/Stencil #include osg/ColorMask #include osg/Depth #include osg/Billboard #include osg/Material #include osg/AnimationPath #include osgGA/TrackballManipulator #include osgGA/FlightManipulator #include osgGA/DriveManipulator #include osgUtil/SmoothingVisitor #include osgDB/Registry #include osgDB/ReadFile #include osgDB/WriteFile #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include iostream // call back which creates a deformation field to oscillate the model. class MyGeometryCallback : public osg::Drawable::UpdateCallback, public osg::Drawable::AttributeFunctor { public: MyGeometryCallback(const osg::Vec3 o, const osg::Vec3 x,const osg::Vec3 y,const osg::Vec3 z, double period,double xphase,double amplitude): _firstCall(true), _startTime(0.0), _time(0.0), _period(period), _xphase(xphase), _amplitude(amplitude), _origin(o), _xAxis(x), _yAxis(y), _zAxis(z) {} virtual void update(osg::NodeVisitor* nv,osg::Drawable* drawable) { // OpenThreads::Thread::microSleep( 1000 ); const osg::FrameStamp* fs = nv-getFrameStamp(); double simulationTime = fs-getSimulationTime(); if (_firstCall) { _firstCall = false; _startTime = simulationTime; } _time = simulationTime-_startTime; drawable-accept(*this); drawable-dirtyBound(); osg::Geometry* geometry = dynamic_castosg::Geometry*(drawable); if (geometry) { osgUtil::SmoothingVisitor::smooth(*geometry); } } virtual void apply(osg::Drawable::AttributeType type,unsigned int count,osg::Vec3* begin) { if (type == osg::Drawable::VERTICES) { const float TwoPI=2.0f*osg::PI; const float phase = -_time/_period; osg::Vec3* end = begin+count; for (osg::Vec3* itr=begin;itrend;++itr) { osg::Vec3 dv(*itr-_origin); osg::Vec3 local(dv*_xAxis,dv*_yAxis,dv*_zAxis); local.z() = local.x()*_amplitude*
[osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G
Hi, ... I want to build a geocentric database with large image(.img )bigger than 4G. Everytime VPB must reproject the .img image to a temp .tiff file first,the problem is .tiff file can not hold data larger than 4GB,so there also have problem when reprojecting the original image.I try to modify VPB source to make it reprojecting to a .img file,I don't know if it works correct,or is there a better way? Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33246#33246 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G
Hi, Another solution could be to use libtiff newer than 4.0, with support for bigTiff (Tiff files larger than 4 GB) Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33247#33247 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] bulid a geocentric database with large image(.img )bigger than 4G
Hi, one way would be to split up the large img into smaller tiffs using gdal tools (e.g. gdal_retile). VPB uses gdal for the conversion anyway, so you will save time when you want to rebuild the database again. jp On 29/10/10 14:10, Lv Qing wrote: Hi, ... I want to build a geocentric database with large image(.img )bigger than 4G. Everytime VPB must reproject the .img image to a temp .tiff file first,the problem is .tiff file can not hold data larger than 4GB,so there also have problem when reprojecting the original image.I try to modify VPB source to make it reprojecting to a .img file,I don't know if it works correct,or is there a better way? Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33246#33246 ___ 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] [vpb] bulid a geocentric database with large image(.img )bigger than 4G
Hi Lv, One approach you could take would be to reproject the imagery using gdal_translate to the desired coordinate system and then set up VPB to use the reprojected imagery. Robert. On Fri, Oct 29, 2010 at 1:10 PM, Lv Qing donlvq...@msn.com wrote: Hi, ... I want to build a geocentric database with large image(.img )bigger than 4G. Everytime VPB must reproject the .img image to a temp .tiff file first,the problem is .tiff file can not hold data larger than 4GB,so there also have problem when reprojecting the original image.I try to modify VPB source to make it reprojecting to a .img file,I don't know if it works correct,or is there a better way? Thank you! Cheers, Lv -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33246#33246 ___ 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] Image cache and manually release
Yep ! Your first solution works perfectly ! Thank a lot ! I find an other solution : when you read a file whith readImageFile(..), you specify a filename and you can give option. And there is an option to not use Image Cache. Thank you ! Patrice -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33250#33250 ___ 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, In the meantime I got a better understanding of OSG regarding OpenGLES 2.0 support and osgText, osgTerrain and osgEarth are now basically running in the OpenGLES 2.0 Emulator (globeview with some labels and streets). 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? Thank you! Cheers, Christian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33251#33251 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Making sure I am completely freeing up OSG shader-related resources
Hi, I'm in a situation in which my Win32 process takes a lot of time to exit, something like 15-20 seconds. This happens as soon as I attach shaders to my geode. Something I want to do first is to make sure I release OSG shader-related resources completely before exiting the application. Here is my code to use shaders then release them: Code: Geode *geode; Program *program = new Program(); Shader *vs = new Shader(...); Shader *fs = new Shader(...); program-addShader(vs); program-addShader(fs); geode-getOrCreateStateSet()-setAttributeAndMode(program, StateSet::ON); [...] // To free up resources I do: geode-setStateSet(new StateSet()); // obviously release all references to program, fs and vs here // I expect that, at this point, all shader-related stuff for OSG is gone Is this good enough? Cheers, Fred -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33252#33252 ___ 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
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. If you are interested, they indicated they would be willing to consider splitting the costs of developing a loader. I had spoken to them previously about doing the actual programming for them under paid contract. If this interests you, I can put both of you in touch so you could discuss it. -- 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
On 10/29/2010 1:04 AM, J.P. Delport wrote: Hi, I've stumbled across this at a conference, it might be useful. http://www.hpi.uni-potsdam.de/doellner/publications/year/2010/1086/RD10.html I couldn't find an electronic copy anywhere to read. Anyone have it? I'd love to read up on this. -- 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] [osgPlugins] OpenFlight Export - MultiTexturing - wrong Texture Coordinates
On 10/29/2010 8:56 AM, Roland Smeenk wrote: Hi Katharina, thanks for chasing and fixing this problem. Can you attach the complete modified file to a new thread on the submissions forum. This way it will end up on the todo list for inclusion in osg. Hi Katharina -- Also, you mentioned you created an OSG file that reproduces the issue and verifies the fix. If you can share this file, please consider opening an issue at the OSG FLT export project issue page: http://code.google.com/p/osgfltexport/ Attach the OSG test file to the issue. I'll try to add it to the project when time allows. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Top 10 Scene graph optimizations?
So does anyone have any suggestions or ideas on scene graph optimizations. Hey my scene looks great, now lets make it fast!.comments would be greatly appreciated...thanks. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33259#33259 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] undefined symbol: _ZN11OpenThreads6AtomicmmEv
Hi Robert, I am linking with OpenThreads. About the Makfile: The application that I am trying run with intersection checks from OSG has its own Makefile that I do not want to change other than adding the includes and libraries from OSG. Since, that procedure is giving me the undefined symbol error I am now trying to compile and run the osgintersction example using your recommended build procedure for examples. I ran cmake and make in the OpenSceneGraph folder to create the libraries. However, there were no Makefiles generated for the examples. That's why I went to the OpenSceneGraph/examples/osgintersection folder and ran cmake. Then I run into cmake not recognizing SETUP_EXAMPLE project. What I like to know is whether you have the examples setup to have Makefiles created using cmake or we just write our own Makefile and link with the libraries just like I did with my application. If you have the examples set up to have Makefiles generated thru cmake, I probably am not following the correct procedure and that is probably why I am runni ng into the SETUP_EXAMPLE problem. Thank you! Cheers, Huron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33260#33260 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] 3rd party libs and VS 2010
Hello, I'm build OSG 2.8.3 under VS2010. When setting it up, I specified the directories for Freetype in cmake. I had the two include path variables and the library debug variable pointing correctly (I think). However, when cmake generates, it doesn't generate the osgdb_freetype project. I don't see any errors in the cmake file that indicates it can't generate the freetype project, it just doesn't. I've looked for answers in the forum and I'm not sure if I've seen an answer or not... Any help would be appreciated. Thanks, Joel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33261#33261 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] undefined symbol: _ZN11OpenThreads6AtomicmmEv
Hi Huron, I've experienced the same problems with unresolved symbols from OpenTreads. The problem was solved by full rebuild of OSG. Just delete CMake cache, reconfigure and build. Once I've fought unexpected runtime errors (segmentation faults) in simple OSG apps (even in examples) and they were also solved by full rebuild. Seems that something went wrong during compilation process, but compiler/linker somehow have missed these errors. Regards, Yurii ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org