Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
Hi Robert, My current code instances a new one each cull traverse. I wonder if that means I get a sizeof(osgUtil::RenderBin) memory leak each cull-traverse? Anyway, I am going to try to multi-buffer it. I should be able to count the number of cull-traverse calls I get for each update tranverse. That (I guess) should tell me automatically how many instances of osgUtil::RenderBin that I would need. I will multiply it by two for double buffering and then it should work like a dream. Cheers, Viggo Date: Thu, 24 Jul 2008 17:53:57 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?) On Thu, Jul 24, 2008 at 3:08 PM, Viggo Løvli [EMAIL PROTECTED] wrote: The only thing that annoy me now is the call to new(). Creating one bin as a member variable in my class and using it instead of the call to new cause the system to crash. Double buffering I guess. So maybe I can fix this by having two RenderBin instances in my class, and use them every other call? But, I suspect that it may not be enough? Would I need two per cull call that is ran per frame? Say that I in the future render with 4 different cameras and cull the world 4 times. Would I then need 4*2 bin instances to use instead of calling new()? The OSG's rendering backend is both very dynamic (created on demand on each frame) and flexible (it can be a huge range of bin configurations, potentially different on each frame) and the threading and multiple graphics context rendering are all thrown into this mix. This makes reuse of data something you have to be very careful about, in your case you'd either need to create on each new frame or multi-buffer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Windows Live Messenger - også på mobilen. http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-noocid=30032___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Defining Local Coordinate Center For Every Node
Hi all, Firstly sorry for simple question, but I can't find related topics on the web. How can I change my models's center coordinate? I have lots of components, I am trying to collect them in one model, and I want to control one part in it's local coordinate (for example I want to rotate it around z axes on it's local coordinate.) But my components default coordinate center is different one by one (for example: osgviewer sample.osg axes.osg result is http://img61.imageshack.us/my.php?image=sampletn4.png ). I mean, I want to control every part of components in their local coordinate center. What should I do for changing coordinate system and center for every components? I used MatrixTransform, PositionAttitudeTransform CoordinateSystemNode but I can't get success. Thanks, Best Regards. Umit UZUN ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] transparency becomes dark
Hi, I dont see that you are doing anything wrong... It was not working for me either though but I think you messed somehow the logic up. Here is an example based on what you sent which makes the model (I used cow.osg) fade in/out. Hope this helps - Original Message From: Dieter Pfeffer [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Sent: Thursday, July 24, 2008 3:30:37 PM Subject: [osg-users] transparency becomes dark Hi I am trying to set the object transparency from 1.0 - 0.0 and vice versa; but when I start changing the alpha of the material the object becomes dark. I have changed the material parameters but without success; when I look in the loaded model (for example cow.osg) for material, the material is always null. I have modified the osgviewer example and attached it. Could s.o. give me a hint what I am doing wrong ? Thanks Dieter Unclassified Mail Disclaimer: This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Considering the inherent risks of the use of e-mail communication, Thales Nederland BV shall not be liable for any damage derived from it. Thales Nederland BV is seated in Hengelo (Ov.), the Netherlands, and registered at the Chamber of Commerce under number 06061578. osgviewer_alpha.cpp Description: Binary data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
Hi Viggo, On Fri, Jul 25, 2008 at 7:22 AM, Viggo Løvli [EMAIL PROTECTED] wrote: Hi Robert, My current code instances a new one each cull traverse. I wonder if that means I get a sizeof(osgUtil::RenderBin) memory leak each cull-traverse? The rendering backend uses ref_ptr's so there shouldn't be any leak, assigning the new RenderBin will lead to the previous one being deleted. Anyway, I am going to try to multi-buffer it. I should be able to count the number of cull-traverse calls I get for each update tranverse. That (I guess) should tell me automatically how many instances of osgUtil::RenderBin that I would need. I will multiply it by two for double buffering and then it should work like a dream. Rather than second guess what will be need might I suggest you maintain a recycling list of ref_ptr to your custom RenderBin, then traverse this list to find an entry that has a referenceCount() of one, then take ownership of this. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
Hi Robert, Hi Viggo, The rendering backend uses ref_ptr's so there shouldn't be any leak, assigning the new RenderBin will lead to the previous one being deleted. Yep I figured out that one :-) Rather than second guess what will be need might I suggest you maintain a recycling list of ref_ptr to your custom RenderBin, then traverse this list to find an entry that has a referenceCount() of one, then take ownership of this. I took into usage a std::list which starts off empty. I am currently counting how many times cull-traverse is called and increasing the list at need. Your idea of checking the reference count is better. It will make the system more robust. I will continue using a std::list for this. I will keep track of what was the last used element of the list, so when I need a new one then I will traverse the list from that point. This should increase the chance of finding a free entry immediately. If I parse through the whole list, then I will insert a new element to the list and use that one. The list will thus grow to the maximum needed size and stay there until the class is deleted. Future changes of number of cameras or what ever re-configurations that can cause one thread to hold data longer will thus automatically work. I am also ensuring that the original RenderBinList of RenderStage is not changed anywhere else than for element 10. I used to add a new bin to element 9, but that may be in usage already. Element 10 will instead point to a new bin that contain it's own bin #9 and #10. Both will point to the original content that RenderStage pointed to in it's bin #10. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Hold kontakten med Windows Live Messenger. http://clk.atdmt.com/GBL/go/msnnkdre001003gbl/direct/01/___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg pick problem
hi,all when i use the function computeIntersections to pick a drawable in the scene,it's Ok when i use osg::ShapeDrawable to build the scene。but the computeIntersections doesn't work when i use self drawing, I derive a class from osg::Drawable,and overwrite the function computeBound() and drawImplementation(). why doesn't it work? thanks for any hint forest ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to read out the coordinate info from model files
Hi all, I'm trying to import some 3ds models (using osgDB::readNodeFile) into an osg programme. Now the problem is that: Is there any way that we can read the coordinate information out from the models since 3ds models have saved the position (the model center) coordinate information themselves? Is there any API in osg::Node class which we can call to get such information? I hope I make my question clear. Thanks for your advices in advance. With best regards, Fangqin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg pick problem
Hi Forest, The osg::Drawable class has an accept(PrimitiveFunctor) method that is used to extract the geometry information in a way that the IntersectionVisitor can use, so if you want picking support then you'll need to implement this. Robert. 2008/7/25 forest37 [EMAIL PROTECTED]: hi,all when i use the function computeIntersections to pick a drawable in the scene,it's Ok when i use osg::ShapeDrawable to build the scene。but the computeIntersections doesn't work when i use self drawing, I derive a class from osg::Drawable,and overwrite the function computeBound() and drawImplementation(). why doesn't it work? thanks for any hint forest 22元超值饭面,8.5折纯珍比萨,必胜宅急送网上点餐优惠多 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Moving from Producer to osgViewer
Hi all I'm moving an app from Producer to osgViewer and have doubts about the equivalence between some Producer methods vs. osgViewer methods. May you help me, indicating the methods more suitable to change in the Producer code fragment below, in order to get it working under osgViewer? Thanks, Bruno - //variables (just to contextualize) osgProducer::Viewer* viewer_obj; Producer::Camera *camera_obj; int x, y, width, height; double d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear; float f_near, f_far, f_hfov, f_vfov; osg::Matrix matrix; osg::Matrixd matrixd; std::string name = My Camera; osg::Group* hud; //methods that need conversion viewer_obj-getGlobalStateSet()-setMode( GL_FOG, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON ); camera_obj-getLensParams(d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear); camera_obj-setLensFrustum( d_left, d_right, d_bottom, d_top, d_near, d_far, d_xshear, d_yshear ); viewer_obj-getCameraConfig()-addCamera( name, camera_obj ); camera_obj-setProjectionRectangle ( x, y, width, height ); camera_obj-setLensAutoAspect(true); camera_obj-setLensPerspective( f_hfov, f_vfov, f_near, f_far ); camera_obj = viewer_obj-getCameraConfig()- findCamera( name.c_str() ); camera_obj-setOffset( matrix.ptr() ); viewer_obj-setSceneDecorator( hud ); viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); viewer_obj-update(); camera_obj-frame( false ); osgDB::Registry::instance()-getOrCreateDatabasePager()- setUseFrameBlock(true); for(SceneHandlerList::iterator itr = viewer_obj-_shvec.begin(); itr != viewer_obj-_shvec.end(); ++itr) { osgDB::Registry::instance()-getOrCreateDatabasePager()- setCompileGLObjectsForContextID( (*itr)-getSceneView()-getState()-getContextID(), false ); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Moving from Producer to osgViewer
Have you tried ? It took us not more than a couple days to move away form producer in our apps Some things a little different and you pick up those up quickly when you convert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Carneiro de Castro Sent: Friday, July 25, 2008 7:40 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Moving from Producer to osgViewer Hi all I'm moving an app from Producer to osgViewer and have doubts about the equivalence between some Producer methods vs. osgViewer methods. May you help me, indicating the methods more suitable to change in the Producer code fragment below, in order to get it working under osgViewer? Thanks, Bruno - //variables (just to contextualize) osgProducer::Viewer* viewer_obj; Producer::Camera *camera_obj; int x, y, width, height; double d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear; float f_near, f_far, f_hfov, f_vfov; osg::Matrix matrix; osg::Matrixd matrixd; std::string name = My Camera; osg::Group* hud; //methods that need conversion viewer_obj-getGlobalStateSet()-setMode( GL_FOG, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON ); camera_obj-getLensParams(d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear); camera_obj-setLensFrustum( d_left, d_right, d_bottom, d_top, d_near, d_far, d_xshear, d_yshear ); viewer_obj-getCameraConfig()-addCamera( name, camera_obj ); camera_obj-setProjectionRectangle ( x, y, width, height ); camera_obj-setLensAutoAspect(true); camera_obj-setLensPerspective( f_hfov, f_vfov, f_near, f_far ); camera_obj = viewer_obj-getCameraConfig()- findCamera( name.c_str() ); camera_obj-setOffset( matrix.ptr() ); viewer_obj-setSceneDecorator( hud ); viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); viewer_obj-update(); camera_obj-frame( false ); osgDB::Registry::instance()-getOrCreateDatabasePager()- setUseFrameBlock(true); for(SceneHandlerList::iterator itr = viewer_obj-_shvec.begin(); itr != viewer_obj-_shvec.end(); ++itr) { osgDB::Registry::instance()-getOrCreateDatabasePager()- setCompileGLObjectsForContextID( (*itr)-getSceneView()-getState()-getContextID(), false ); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to read out the coordinate info from model files
None that I'm aware of The OSG file readers are about loading the data into the scene graph, not about probing files for properties or meta data You will have to implement your own probe mechanism for this _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of TANG Fangqin Sent: Friday, July 25, 2008 5:02 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] How to read out the coordinate info from model files Hi all, I'm trying to import some 3ds models (using osgDB::readNodeFile) into an osg programme. Now the problem is that: Is there any way that we can read the coordinate information out from the models since 3ds models have saved the position (the model center) coordinate information themselves? Is there any API in osg::Node class which we can call to get such information? I hope I make my question clear. Thanks for your advices in advance. With best regards, Fangqin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
Hi Robert, I have a very strange bug. The code I have written to render one bin twice works fine in the project code-base that I am working on. I took the class and integrated into the OSGForest example, and there it does not work as expected. In the OSGForest example:- The bin is rendered two times, as expected.- The state-set that is added to only one of the bins are now used when both bins are rendered. And there is the bug :-/ I would appreciate it if you could take a look at the code and try it out. I have attached my class to this mail, and below here is the new main function for OSGForest. Just keep the rest of the osgforest.cpp file as it is. Only add the include and the green code at the bottom of main. #include TransparencyGlitchFixNode.h int main( int argc, char **argv ) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(argc,argv); // construct the viewer. osgViewer::Viewer viewer(arguments); float numTreesToCreates = 1; arguments.read('--trees',numTreesToCreates); osg::ref_ptrForestTechniqueManager ttm = new ForestTechniqueManager; viewer.addEventHandler(new TechniqueEventHandler(ttm.get())); viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()-getOrCreateStateSet())); // add model to viewer. TransparencyGlitchFixNode* root = new TransparencyGlitchFixNode(); root-addChild( ttm-createScene((unsigned int)numTreesToCreates) ); viewer.setSceneData( root ); return viewer.run(); } Here is what to expect: - The forest will be rendered twice. - First pass will be additive blend without depth-buffer write. - Second pass shall be a normal render of the forest. - The bug is so that the state-set is used both times, so both get additive-blend. The additive-blend is something I have added only to ease the visual debugging. The final code shall only have the state for turning off depth-buffer write. If everything works smoothly then you are supposed to see the forest as normal but with high-lighting due to the additive blend at all places where the trees are transparent. Regards,Viggo From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Fri, 25 Jul 2008 10:42:08 +0200Subject: Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?) Hi Robert, Hi Viggo, The rendering backend uses ref_ptr's so there shouldn't be any leak, assigning the new RenderBin will lead to the previous one being deleted. Yep I figured out that one :-) Rather than second guess what will be need might I suggest you maintain a recycling list of ref_ptr to your custom RenderBin, then traverse this list to find an entry that has a referenceCount() of one, then take ownership of this. I took into usage a std::list which starts off empty. I am currently counting how many times cull-traverse is called and increasing the list at need. Your idea of checking the reference count is better. It will make the system more robust.I will continue using a std::list for this.I will keep track of what was the last used element of the list, so when I need a new one then I will traverse the list from that point. This should increase the chance of finding a free entry immediately.If I parse through the whole list, then I will insert a new element to the list and use that one. The list will thus grow to the maximum needed size and stay there until the class is deleted. Future changes of number of cameras or what ever re-configurations that can cause one thread to hold data longer will thus automatically work. I am also ensuring that the original RenderBinList of RenderStage is not changed anywhere else than for element 10. I used to add a new bin to element 9, but that may be in usage already. Element 10 will instead point to a new bin that contain it's own bin #9 and #10. Both will point to the original content that RenderStage pointed to in it's bin #10. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Få Hotmail du også. Windows Live Hotmail nå med 5000 MB gratis lagringsplass. _ Morsomme klipp, kjendiser og mer på MSN Video. http://video.msn.com/?mkt=nb-nofrom=HMTAG#include TransparencyGlitchFixNode.h #include osg/Depth #include osg/BlendFunc #include osg/StateSet #include osgUtil/CullVisitor // /*! * \par Actions: * - Creates one state-set that will be used multiple places. * - Creates two helper-bins to be ready for use (see traverse function). */ TransparencyGlitchFixNode::TransparencyGlitchFixNode() : osg::Group () , _stateSet ( 0 ) { // Create the state-set that we use to turn off depth-buffer write
Re: [osg-users] Getting the opengl texture id of an osg::Texture2D
Thanks for the help, everything seems to work fine so far. But now I'm a little bit lost on what the best way for creating an osg::Texture2D out of the ID of an OpenGL-texture is. I have the id of an OpenGL-texture as the result delivered by the API I'm using and I want to get this texture as an osg::Texture2D. I tried creating a new Texture2D, generating a TextureObject by using generateTextureObject and finally setting the _id of this TextureObject to the id of my result texture. But I keep getting errors that way because the generated TextureObject seems to be invalid. Do I have to add another step before setting the id? Or am I completely off and have to do it in a different way? How do I get an osg::Texture2D from my OpenGL-Texture-ID? Regards, Steffen _ In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?)
Hi Robert, Completely understandable :-) Regards, Viggo Date: Fri, 25 Jul 2008 14:00:09 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?) Hi Viggo, I am trying to get a release out the door. I'm afraid I don't have the the time tot go chasing up experimental user code. Robert. On Fri, Jul 25, 2008 at 1:33 PM, Viggo Løvli [EMAIL PROTECTED] wrote: Hi Robert, I have a very strange bug. The code I have written to render one bin twice works fine in the project code-base that I am working on. I took the class and integrated into the OSGForest example, and there it does not work as expected. In the OSGForest example: - The bin is rendered two times, as expected. - The state-set that is added to only one of the bins are now used when both bins are rendered. And there is the bug :-/ I would appreciate it if you could take a look at the code and try it out. I have attached my class to this mail, and below here is the new main function for OSGForest. Just keep the rest of the osgforest.cpp file as it is. Only add the include and the green code at the bottom of main.#include TransparencyGlitchFixNode.h int main( int argc, char **argv ) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(argc,argv); // construct the viewer. osgViewer::Viewer viewer(arguments); float numTreesToCreates = 1; arguments.read('--trees',numTreesToCreates); osg::ref_ptrForestTechniqueManager ttm = new ForestTechniqueManager; viewer.addEventHandler(new TechniqueEventHandler(ttm.get())); viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()-getOrCreateStateSet())); // add model to viewer. TransparencyGlitchFixNode* root = new TransparencyGlitchFixNode(); root-addChild( ttm-createScene((unsigned int)numTreesToCreates) ); viewer.setSceneData( root ); return viewer.run(); }Here is what to expect: - The forest will be rendered twice. - First pass will be additive blend without depth-buffer write. - Second pass shall be a normal render of the forest. - The bug is so that the state-set is used both times, so both get additive-blend. The additive-blend is something I have added only to ease the visual debugging. The final code shall only have the state for turning off depth-buffer write. If everything works smoothly then you are supposed to see the forest as normal but with high-lighting due to the additive blend at all places where the trees are transparent. Regards, Viggo From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Fri, 25 Jul 2008 10:42:08 +0200 Subject: Re: [osg-users] Robert: I figured it out :-) (was: Is it possible to know when the node-graph is 'dirty'?) Hi Robert, Hi Viggo, The rendering backend uses ref_ptr's so there shouldn't be any leak, assigning the new RenderBin will lead to the previous one being deleted. Yep I figured out that one :-) Rather than second guess what will be need might I suggest you maintain a recycling list of ref_ptr to your custom RenderBin, then traverse this list to find an entry that has a referenceCount() of one, then take ownership of this. I took into usage a std::list which starts off empty. I am currently counting how many times cull-traverse is called and increasing the list at need. Your idea of checking the reference count is better. It will make the system more robust. I will continue using a std::list for this. I will keep track of what was the last used element of the list, so when I need a new one then I will traverse the list from that point. This should increase the chance of finding a free entry immediately. If I parse through the whole list, then I will insert a new element to the list and use that one. The list will thus grow to the maximum needed size and stay there until the class is deleted. Future changes of number of cameras or what ever re-configurations that can cause one thread to hold data longer will thus automatically work. I am also ensuring that the original RenderBinList of RenderStage is not changed anywhere else than for element 10. I used to add a new bin to element 9, but that may be in usage already. Element 10 will instead point to a new bin that contain it's own bin #9 and #10. Both will point to the original content that RenderStage pointed to in it's bin #10. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Få Hotmail du også. Windows Live Hotmail nå med
[osg-users] NPS_Tutorials.zip ?
Hi, does anybody know where I can get the NPS Tutorials zip with all modells referenced in the osg tutorials? It's pretty hard to do them without the proper files and it seems that they are unavailable at the moment. The old page here - http://www.openscenegraph.org/documentation/NPSTutorials/ has only a dead link to that zip. Greetings ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] NPS_Tutorials.zip ?
Hi, You can download it from http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/NPS_Tutorials_src.rar Good luck, Bye.. Umit UZUN 2008/7/25 Ariasgore [EMAIL PROTECTED]: Hi, does anybody know where I can get the NPS Tutorials zip with all modells referenced in the osg tutorials? It's pretty hard to do them without the proper files and it seems that they are unavailable at the moment. The old page here - http://www.openscenegraph.org/documentation/NPSTutorials/ has only a dead link to that zip. Greetings ___ 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] Compile error on Solaris10/SunStudio11
Hi, when trying to build OSG (SVN from thursday afternoon, 15:30 UTC) on Solaris, I get the following Error: [ 99%] Building CXX object applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o /opt/SUNWspro/bin/CC -xO2 -xtarget=ultra2 -xprefetch=auto -xO2 -DNDEBUG -I/usr/local/src/OpenSceneGraph/include -DOSG_DEBUG_POSTFIX='d' -o applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o -c /usr/local/src/OpenSceneGraph/applications/osgconv/PluginQuery.cpp [... many Warnings ...] /usr/local/src/OpenSceneGraph/applications/osgconv/PluginQuery.cpp, line 149: Error: osgDB::outputPluginDetails(std::ostream , const std::string ) is expected to return a value. make[2]: *** [applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o] Error 1 Regards, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compile error on Solaris10/SunStudio11
Hi Martin, The missing return was fixed yesterday. Today the function is now moved in to the osgDB, but this shouldn't effect the build. Robert. On Fri, Jul 25, 2008 at 3:55 PM, Martin Spott [EMAIL PROTECTED] wrote: Hi, when trying to build OSG (SVN from thursday afternoon, 15:30 UTC) on Solaris, I get the following Error: [ 99%] Building CXX object applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o /opt/SUNWspro/bin/CC -xO2 -xtarget=ultra2 -xprefetch=auto -xO2 -DNDEBUG -I/usr/local/src/OpenSceneGraph/include -DOSG_DEBUG_POSTFIX='d' -o applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o -c /usr/local/src/OpenSceneGraph/applications/osgconv/PluginQuery.cpp [... many Warnings ...] /usr/local/src/OpenSceneGraph/applications/osgconv/PluginQuery.cpp, line 149: Error: osgDB::outputPluginDetails(std::ostream , const std::string ) is expected to return a value. make[2]: *** [applications/osgconv/CMakeFiles/application_osgconv.dir/PluginQuery.o] Error 1 Regards, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ 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] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate
Hi All, This evening I'll be making the OpenSceneGraph-2.6 branch, and tag this as release candidate 1. I'd greatly appreciate users testing out the svn trunk to make sure everything is compiling correctly across platforms. Thanks in advance for you help, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Slave Cameras projection matrices and aspect ratio
Hi Jose, I tried the .cfg out and it works, but since osgviewer cow.osg -c your.cfg doesn't contain your specific master projection matrix nor have your profiling code I can't really test what your are seeing at your end. Given I'm busy working getting a 2.6 rc1 out the door, and am away from tomorrow there is little time I have to further chase this up. As a general note, the slave projection matrices are update on each frame by multiplying the master camera's projection matrix by the slave projection offset matrix. This means updates to the slaves projection matrix will be overwritten, which is why you aren't seeing these changes. As to why you are seeing different values, I'm afraid I can't give a specific reason for this, one would have to look at your specific code against osgProducer and against osgViewer, and these both cases so you can see it first hand and profile the values. Robert. On Thu, Jul 24, 2008 at 10:57 PM, Joseanibal Colon Ramos [EMAIL PROTECTED] wrote: Thanks Robert, Here is the Producer config file I am using: *** Camera Camera-1 { RenderSurface Window-1 { Visual { SetSimple } Screen 0; WindowRect 0 30 426 341; Border on; InputRectangle -1.0 1.0 -1.0 1.0; } Offset { Rotate 42.4 0 1 0; } } Camera Camera-2 { RenderSurface Window-2 { Visual { SetSimple } Screen 0; WindowRect 426 30 426 341; Border on; InputRectangle -1.0 1.0 -1.0 1.0; } Offset { Rotate 0.0 0 1 0; } } Camera Camera-3 { RenderSurface Window-3 { Visual { SetSimple } Screen 0; WindowRect 852 30 426 341; Border on; InputRectangle -1.0 1.0 -1.0 1.0; } Offset { Rotate -42.4 0 1 0; } } InputArea { RenderSurface Window-1 ; RenderSurface Window-2 ; RenderSurface Window-3 ; } *** I have tested and compared it with OSG 2.4 and OSG 1.2 with (very) slightly different results. I need the results to be exactly the same as in OSG 1.2. My understanding is that the InputArea is no longer required, but is is still there for backwards compatibility with OSG 1.2 . For each RenderSurface block I used to have a Lens configuration block like this one: Lens { Perspective 42.4 45.0 1.0 100.0; } but I no longer use it because I set the parameters in my code as: vwr.getCamera()-setProjectionMatrixAsPerspective(VerticalFOV, AspectRatio, NearClip, FarClip); //for the master cam. I've tried doing it for each of the Slave cams as well: vwr.getSlave(int i)._camera-setProjectionMat. (same thing) . but it doesn't change anything. In this example: AspectRatio = 1.33 VerticalFOV = 42.4/AspectRatio NearClip = doesn't matter right now FarClip = doesn't matter right now Whe I run my program (version OSG 2.4) I get the following runtime values: Master cam: (fov, aspect, near, far)31.807951987997, 1.333, 0.02, 199. Slave cam # 0 (fov, aspect, near, far): 31.8079530956935, 1.31249230769231, 305.702400933255, 70223.0343790709 Slave cam # 1 (fov, aspect, near, far): 31.8079530956935, 1.31249230769231, 443.807876894962, 43394.6435810508 Slave cam # 2 (fov, aspect, near, far): 31.8079530956935, 1.31249230769231, 292.024441391996, 54427.4475917436 You may ignore the Near/Far values. You can notice how the slave cams manipulated the aspect ratio slightly. The VerticalFOV seems right. When I run OSG 1.2 I get this: (no master cam concept) camera 0 FOV(h,v) = 42.4,31.808 aspect_ratio : 1.36129 camera 1 FOV(h,v) = 42.4,31.808 aspect_ratio : 1.36129 camera 2 FOV(h,v) = 42.4,31.808 aspect_ratio : 1.36129 I don't know how the aspect ration became that value either, because the aspect ratio should have been forced to 1.33. Anyways this works fine. I'd like to get the OSG 1.2 results, although none of these numbers quite make sense to me, and the corresponding values of each version are very close. I'll also provide the projection matrices which are a bit off as well: OSG2.4: Slave cam 0: projectionMatrix : { 2.67399874028772 0 0 0 0 3.50960277740655 0 0 0 0 -1.00874468153415 -1 0 0 -614.078072006898 0 } Slave cam 1: projectionMatrix : { 2.67399874028772 0 0 0 0 3.50960277740655 0 0 0 0 -1.02066585525608 -1 0 0 -896.787423135345 0 } Slave cam2: projectionMatrix : { 2.67399874028772 0 0 0 0 3.50960277740655 0 0 0 0 -1.01078866385069 -1 0 0 -587.199436318357 0 } What they should be: (OSG 1.2): Cam 0: 2.57815,0,0,0 0,3.5096,0,0 0,0,-1,-1 0,0,-20,0 Cam 1: 2.57815,0,0,0 0,3.5096,0,0 0,0,-1,-1 0,0,-20,0 Cam2: 2.57815,0,0,0
[osg-users] World Coordinates
I'm trying to work out the world coordinates of vertices in my shader, and I'd like to check my understanding of a few things. At the moment I manually go through the graph and grabbing the transformations en-route to the target geode and create the matrix myself, pass this to the shader, and multiply it by gl_Vertex. That seems to work fine, although it does involve a lot of faffing. However I noticed a couple of handy things already built into OSG. The first is getWorldMatrices; If I call root-getWorldMatrices(targetGeode) does this achieve the same as above? Accumulate the transformation matrices up to that geode and form a matrix? The second is osg_ViewMatrixInverse. If I simply form a matrix from osg_ViewMatrixInverse * gl_ModelViewMatrix does this not give me the same matrix? I hope that makes sense, thanks for your help. Kim. * To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html *___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate
Hi Robert, the latest SVN doesn't link (osgViewer) : virtual void operator()(const osg::Image image, const unsigned int context_id) = 0; cause a problem under VS 2003. Linking... Creating library C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\osgViewer.lib and object C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\osgViewer.exp HelpHandler.obj : error LNK2019: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED] @osgViewer@@[EMAIL PROTECTED]@@Z) referenced in function public: void __thiscall osgViewer::ScreenCaptureHandler::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED] @osgViewer@@[EMAIL PROTECTED]@@Z) StatsHandler.obj : error LNK2019: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED] @osgViewer@@[EMAIL PROTECTED]@@Z) referenced in function [thunk]:public: virtual bool __thiscall osg::Drawable::DrawCallback::isSameKindAs`vtordisp{4294967292,0}' (class osg::Object const *)const ([EMAIL PROTECTED]@[EMAIL PROTECTED] @@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@Z) ViewerEventHandlers.obj : error LNK2001: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED] @osgViewer@@[EMAIL PROTECTED]@@Z) HelpHandler.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED] @@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) StatsHandler.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED]@@[EMAIL PROTECTED] @@[EMAIL PROTECTED]) ViewerEventHandlers.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED]@@[EMAIL PROTECTED] @@[EMAIL PROTECTED]) C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\..\bin\osg42-osgViewer.dll : fatal error LNK1120: 2 unresolved externals 2008/7/25 Robert Osfield [EMAIL PROTECTED]: Hi All, This evening I'll be making the OpenSceneGraph-2.6 branch, and tag this as release candidate 1. I'd greatly appreciate users testing out the svn trunk to make sure everything is compiling correctly across platforms. Thanks in advance for you help, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Compile error on Solaris10/SunStudio11
Robert Osfield wrote: The missing return was fixed yesterday. Today the function is now moved in to the osgDB, but this shouldn't effect the build. Ok, I'll recheck. A little notice when running CMake makes me wonder (freshly pulled from SVN): [...] -- Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed -- Performing Test _OPENTHREADS_ATOMIC_USE_SUN -- Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed [...] This _is_ a Sun - did I misunderstand the comment ? Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate
HI Adrian, I can't work out what is actually missing, everything looks sounds to me. Any chance that you have an out of sync build, or older libs hanging around? Robert. On Fri, Jul 25, 2008 at 4:23 PM, Adrian Egli OpenSceneGraph (3D) [EMAIL PROTECTED] wrote: Hi Robert, the latest SVN doesn't link (osgViewer) : virtual void operator()(const osg::Image image, const unsigned int context_id) = 0; cause a problem under VS 2003. Linking... Creating library C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\osgViewer.lib and object C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\osgViewer.exp HelpHandler.obj : error LNK2019: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED]@osgViewer@@[EMAIL PROTECTED]@@Z) referenced in function public: void __thiscall osgViewer::ScreenCaptureHandler::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED]@osgViewer@@[EMAIL PROTECTED]@@Z) StatsHandler.obj : error LNK2019: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED]@osgViewer@@[EMAIL PROTECTED]@@Z) referenced in function [thunk]:public: virtual bool __thiscall osg::Drawable::DrawCallback::isSameKindAs`vtordisp{4294967292,0}' (class osg::Object const *)const ([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@Z) ViewerEventHandlers.obj : error LNK2001: unresolved external symbol public: void __thiscall osgViewer::WindowCaptureCallback::setCaptureOperation(class osgViewer::CaptureOperation *) ([EMAIL PROTECTED]@osgViewer@@[EMAIL PROTECTED]@@Z) HelpHandler.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) StatsHandler.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) ViewerEventHandlers.obj : error LNK2001: unresolved external symbol public: virtual void __thiscall osgViewer::WriteToFileCaptureOperation::operator()(class osg::Image const ,unsigned int) ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) C:\dev\OpenSceneGraphSVN\Openscenegraph\lib\Release\..\..\bin\osg42-osgViewer.dll : fatal error LNK1120: 2 unresolved externals 2008/7/25 Robert Osfield [EMAIL PROTECTED]: Hi All, This evening I'll be making the OpenSceneGraph-2.6 branch, and tag this as release candidate 1. I'd greatly appreciate users testing out the svn trunk to make sure everything is compiling correctly across platforms. Thanks in advance for you help, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ 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] NPS_Tutorials.zip ?
Many thanks for the file! But is this his official package? There seems to be still files missing like HUDBack2.tga Thanks -- From: Ümit Uzun [EMAIL PROTECTED] Sent: Friday, July 25, 2008 4:27 PM To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] NPS_Tutorials.zip ? Hi, You can download it from http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/NPS_Tutorials_src.rar Good luck, Bye.. Umit UZUN 2008/7/25 Ariasgore [EMAIL PROTECTED]: Hi, does anybody know where I can get the NPS Tutorials zip with all modells referenced in the osg tutorials? It's pretty hard to do them without the proper files and it seems that they are unavailable at the moment. The old page here - http://www.openscenegraph.org/documentation/NPSTutorials/ has only a dead link to that zip. Greetings ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate
Hello Robert, This evening I'll be making the OpenSceneGraph-2.6 branch, and tag this as release candidate 1. I'd greatly appreciate users testing out the svn trunk to make sure everything is compiling correctly across platforms. Builds fine for me. Vista 32bit, VC++ 8. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Moving from Producer to osgViewer
Hi Gordon, I tried to port the Producer code to osgViewer, but some methods are becoming hard to replace (see details bellow). Any replacement suggestions? Thanks, Bruno - //variables (just to contextualize) osgProducer::Viewer* viewer_obj; Producer::Camera *camera_obj; int x, y, width, height; double d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear; float f_near, f_far, f_hfov, f_vfov; osg::Matrix matrix; osg::Matrixd matrixd; std::string name = My Camera; osg::Group* hud; //methods that need conversion //ISSUE #1: getGlobalStateSet() equivalent not found //in osgViewer::Viewer viewer_obj-getGlobalStateSet()-setMode( GL_FOG, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON ); //ISSUE #2: getProjectionMatrixAsFrustum() is the closest //method in osg::Camera, but it doesn't accept //the d_xshear and d_yshear values camera_obj-getLensParams(d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear); //ISSUE #3: osg::Camera::setProjectionMatrixAsFrustum() //seems to be the best replacement, but once more //the d_xshear and d_yshear values are not supported camera_obj-setLensFrustum( d_left, d_right, d_bottom, d_top, d_near, d_far, d_xshear, d_yshear ); //ISSUE #4: osgViewer::Viewer::addSlave() was used //as replacement viewer_obj-getCameraConfig()-addCamera( name, camera_obj ); //ISSUE #5: replaced by osg::Camera::setViewport() camera_obj-setProjectionRectangle ( x, y, width, height ); //ISSUE #6: setLensAutoAspect() equivalent not found in //osg::Camera camera_obj-setLensAutoAspect(true); //ISSUE #7: osg::Camera::setProjectionMatrixAsPerspective() was //the closest method found camera_obj-setLensPerspective( f_hfov, f_vfov, f_near, f_far ); //ISSUE #8: osg::Camera::setProjectionMatrix() was //the closest method found camera_obj-setOffset( matrix.ptr() ); //ISSUE #9: no equivalent method for setSceneDecorator() was found viewer_obj-setSceneDecorator( hud ); //ISSUE #10: no equivalent method for setViewByMatrix() was found viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); //ISSUE #11: no equivalent method for update() was found viewer_obj-update(); //ISSUE #12: no equivalent method for frame() was found camera_obj-frame( false ); //ISSUE #13: no equivalent method for setUseFrameBlock() //was found osgDB::Registry::instance()-getOrCreateDatabasePager() -setUseFrameBlock(true); //ISSUE #14: equivalent class of SceneHandlerList not found for(SceneHandlerList::iterator itr = viewer_obj-_shvec.begin(); itr != viewer_obj-_shvec.end(); ++itr) { osgDB::Registry::instance()-getOrCreateDatabasePager()- setCompileGLObjectsForContextID( (*itr)-getSceneView()-getState()-getContextID(), false ); } -- Date: Fri, 25 Jul 2008 08:20:35 -0400 From: Gordon Tomlinson Subject: Re: [osg-users] Moving from Producer to osgViewer To: 'OpenSceneGraph Users' Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Have you tried ? It took us not more than a couple days to move away form producer in our apps Some things a little different and you pick up those up quickly when you convert -Original Message- From: Bruno Carneiro de Castro Sent: Friday, July 25, 2008 7:40 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Moving from Producer to osgViewer Hi all I'm moving an app from Producer to osgViewer and have doubts about the equivalence between some Producer methods vs. osgViewer methods. May you help me, indicating the methods more suitable to change in the Producer code fragment below, in order to get it working under osgViewer? Thanks, Bruno - //variables (just to contextualize) osgProducer::Viewer* viewer_obj; Producer::Camera *camera_obj; int x, y, width, height; double d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear; float f_near, f_far, f_hfov, f_vfov; osg::Matrix matrix; osg::Matrixd matrixd; std::string name = My Camera; osg::Group* hud; //methods that need conversion viewer_obj-getGlobalStateSet()-setMode( GL_FOG, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON ); camera_obj-getLensParams(d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear); camera_obj-setLensFrustum( d_left, d_right, d_bottom, d_top, d_near, d_far, d_xshear, d_yshear ); viewer_obj-getCameraConfig()-addCamera( name, camera_obj ); camera_obj-setProjectionRectangle ( x, y, width, height ); camera_obj-setLensAutoAspect(true); camera_obj-setLensPerspective( f_hfov, f_vfov, f_near, f_far ); camera_obj = viewer_obj-getCameraConfig()- findCamera( name.c_str() ); camera_obj-setOffset( matrix.ptr() ); viewer_obj-setSceneDecorator( hud ); viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); viewer_obj-update(); camera_obj-frame( false );
Re: [osg-users] Moving from Producer to osgViewer
Take a look at this: http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/classes.html It will help you find the proper function name changes (or similar functions) for the new classes you will be using. For instance: osgProducer::Viewer* viewer_obj; - ref_ptrosgViewer::Viewer viewer_obj; //re_ptr's are safer than pointers alone. instead of dereferencing you do: viewer_obj.get() Producer::Camera *camera_obj; - osg::Camera camera_obj; and so on. Most of the things stay the same. Good luck. -J On Fri, July 25, 2008 5:20 am, Gordon Tomlinson wrote: Have you tried ? It took us not more than a couple days to move away form producer in our apps Some things a little different and you pick up those up quickly when you convert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Carneiro de Castro Sent: Friday, July 25, 2008 7:40 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Moving from Producer to osgViewer Hi all I'm moving an app from Producer to osgViewer and have doubts about the equivalence between some Producer methods vs. osgViewer methods. May you help me, indicating the methods more suitable to change in the Producer code fragment below, in order to get it working under osgViewer? Thanks, Bruno - //variables (just to contextualize) osgProducer::Viewer* viewer_obj; Producer::Camera *camera_obj; int x, y, width, height; double d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear; float f_near, f_far, f_hfov, f_vfov; osg::Matrix matrix; osg::Matrixd matrixd; std::string name = My Camera; osg::Group* hud; //methods that need conversion viewer_obj-getGlobalStateSet()-setMode( GL_FOG, osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON ); camera_obj-getLensParams(d_left, d_right, d_bottom, d_top, d_nearClip, d_farClip, d_xshear, d_yshear); camera_obj-setLensFrustum( d_left, d_right, d_bottom, d_top, d_near, d_far, d_xshear, d_yshear ); viewer_obj-getCameraConfig()-addCamera( name, camera_obj ); camera_obj-setProjectionRectangle ( x, y, width, height ); camera_obj-setLensAutoAspect(true); camera_obj-setLensPerspective( f_hfov, f_vfov, f_near, f_far ); camera_obj = viewer_obj-getCameraConfig()- findCamera( name.c_str() ); camera_obj-setOffset( matrix.ptr() ); viewer_obj-setSceneDecorator( hud ); viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); viewer_obj-update(); camera_obj-frame( false ); osgDB::Registry::instance()-getOrCreateDatabasePager()- setUseFrameBlock(true); for(SceneHandlerList::iterator itr = viewer_obj-_shvec.begin(); itr != viewer_obj-_shvec.end(); ++itr) { osgDB::Registry::instance()-getOrCreateDatabasePager()- setCompileGLObjectsForContextID( (*itr)-getSceneView()-getState()-getContextID(), false ); } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Moving from Producer to osgViewer
Hi Bruno, osgViewer != osgProducer, but pretty well all of Producer functionality is available + much new functionality and flexibility. Naming has changed to better reflect OpenGL naming conventions - something that the core OSG has always done, Producer diverged from this occassionally. FYI: //ISSUE #6: setLensAutoAspect() equivalent not found in //osg::Camera camera_obj-setLensAutoAspect(true); enum ProjectionResizePolicy { FIXED, /** Keep the projection matrix fixed, despite window resizes.*/ HORIZONTAL, /** Adjust the HORIZOTNAL field of view on window resizes.*/ VERTICAL /** Adjust the VERTICAL field of view on window resizes.*/ }; /** Set the policy used to determine if and how the projection matrix should be adjusted on window resizes. */ inline void setProjectionResizePolicy(ProjectionResizePolicy policy) { _projectionResizePolicy = policy; } //ISSUE #8: osg::Camera::setProjectionMatrix() was //the closest method found camera_obj-setOffset( matrix.ptr() ); Producer::Camear::setLens is roughly equivilant to osg::Camera::setProjectMatrix*(). osg::Camera doesn't not embed the master/slave projection matrix offset, so there is no setOffset() method. Instead the osg::View has a master Camera, and a optional list of slave Camera, and the addSlave method provides the mechnism for specifying the view and projection matrix offsets for the slaves. //ISSUE #9: no equivalent method for setSceneDecorator() was found viewer_obj-setSceneDecorator( hud ); Please have a look at the osghud example, and in particular think about the code segment that uses a Viewer slave Camera to do the hud. You can also add a hud Camera directly to the GraphicsWindow if you so wished. So rather no equivalant, there is actually far better replacements... //ISSUE #10: no equivalent method for setViewByMatrix() was found viewer_obj-setViewByMatrix( Producer::Matrix( matrixd.ptr() ) ); viewer-getCamera()-setViewMatrix()... osgViewer::Viewer has a Camera, rather than osgProducer::Viewer which is a Camera. //ISSUE #11: no equivalent method for update() was found viewer_obj-update(); //ISSUE #12: no equivalent method for frame() was found camera_obj-frame( false ); viewer.frame(); Which can be broken down into phases - updateTraversal(), eventTraversal(), and renderingTraversals() //ISSUE #14: equivalent class of SceneHandlerList not found for(SceneHandlerList::iterator itr = viewer_obj-_shvec.begin(); itr != viewer_obj-_shvec.end(); ++itr) { osgDB::Registry::instance()-getOrCreateDatabasePager()- setCompileGLObjectsForContextID( (*itr)-getSceneView()-getState()-getContextID(), false ); } This type of code is totally redundant in osgViewer, just remove it form your code. Please spend some time getting to know osgViewer, rather than just trying to map osgProducer::Viewer to osgViewer::Viewer. Lots of things that were really hacky in osgProducer::Viewer are much cleaner and more flexible in osgViewer, but you'll need to get out of the osgProducer::Viewer/Producer mind set. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to scale rotations ?
Dear all: Appreciate any answer on the topic: I am reading an orientation / rotation matrix info from a sensor, then visualizing the rotation of an object on screen with OSG. Given the matrix or the resulting quaternion I need to be able to scale the rotations independently, i.e. heading_scale*heading_angle, heading_scale=0,1 attitude_scale*attitude_angle bank_scale*bank_angle in order to be able to control them on its own or restrict the rotation to one angle only. I have written 2 functions. The first one converts a quaternion to the Euler angles, the other one does the opposite. In between the calls to the functions I am trying to scale the rotations or switch them on/off as needed. The results are not quite good, however, and I often get trapped in the famous gimbal lock as probably expected. :-) Q: Is there any other possibility to handle rotations on its own? Is there a way to do that without running the conversion, scaling, then converting back to quat ? All I have is the rotation matrix. Appreciate any answer/advice or pointing me in the right direction. Best regards, Janusz Goldasz -- void getEulerFromQuat(osg::Quat q, double heading, double attitude, double bank) { double sqx = q.x()*q.x(); double sqy = q.y()*q.y(); double sqz = q.z()*q.z(); double t = q.x()*q.y() + q.z()*q.w(); if (t0.4) { heading = 2 * atan2(q.x(),q.w()); attitude = osg::PI_2; bank = 0; } else if (t-0.4) { heading = -2 * atan2(q.x(),q.w()); attitude = - osg::PI_2; bank = 0; } else { heading = atan2(2*q.y()*q.w()-2*q.x()*q.z() , 1 - 2*sqy - 2*sqz); attitude = asin(2*t); bank = atan2(2*q.x()*q.w()-2*q.y()*q.z() , 1 - 2*sqx - 2*sqz); } } void getQuatFromEuler(double heading, double attitude, double bank, osg::Quat q) { double c1 = cos(heading/2); double s1 = sin(heading/2); double c2 = cos(attitude/2); double s2 = sin(attitude/2); double c3 = cos(bank/2); double s3 = sin(bank/2); double c1c2 = c1*c2; double s1s2 = s1*s2; double w =c1c2*c3 - s1s2*s3; double x =c1c2*s3 + s1s2*c3; double y =s1*c2*c3 + c1*s2*s3; double z =c1*s2*c3 - s1*c2*s3; q[0] = x; q[1] = y; q[2] = z; q[3] = w; } ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] computeIntersections works very strange
Hello. I have question about OSG v 2.5.5. In this version of OSG function viewer-computeIntersections(x,y, hlist) works very strange - when cursor movements over object is short it(cursor) falls throught the object and function returns name of object which is behind current(object over which cursor is). In earlyer(less 2.5.2) versions of OSG this error has never appeared. How can I solve this problem in this(2.5.5) version of OSG? Best regards, Max. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate
Hi Robert, Builds without error on the following systems: -64 bit RedHat EL4, gcc/g++ 3.4.6 -32 bit RedHat EL4, gcc/g++ 3.4.6 -IRIX 6.5, cc/CC 7.4.2m Thorough testing will take a while, but no problems found so far. -Justin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien Guay Sent: Friday, July 25, 2008 2:04 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Please test SVN of OpenSceneGraph in prep for 2.6 release candidate Hello Robert, This evening I'll be making the OpenSceneGraph-2.6 branch, and tag this as release candidate 1. I'd greatly appreciate users testing out the svn trunk to make sure everything is compiling correctly across platforms. Builds fine for me. Vista 32bit, VC++ 8. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] computeIntersections works very strange
Hi Max, This suggests that the changes I made to osgUtil::LineSegmentIntersector to improve precision are introducing problems is some corner cases. Could you provide the data that causes these problems? Robert. On Fri, Jul 25, 2008 at 8:20 PM, GMD GammerMaxyandex.ru [EMAIL PROTECTED] wrote: Hello. I have question about OSG v 2.5.5. In this version of OSG function viewer-computeIntersections(x,y, hlist) works very strange - when cursor movements over object is short it(cursor) falls throught the object and function returns name of object which is behind current(object over which cursor is). In earlyer(less 2.5.2) versions of OSG this error has never appeared. How can I solve this problem in this(2.5.5) version of OSG? Best regards, Max. ___ 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] NPS_Tutorials.zip ?
You are welcome. Yes it's official package for version osg2.x. But as you see, the tutorials were arranged for osg1.2 So you can see dıfferent part of fıle from them. It's normal. Good luck. Best Regards. Ümit UZUN 2008/7/25 Ariasgore [EMAIL PROTECTED]: Many thanks for the file! But is this his official package? There seems to be still files missing like HUDBack2.tga Thanks -- From: Ümit Uzun [EMAIL PROTECTED] Sent: Friday, July 25, 2008 4:27 PM To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] NPS_Tutorials.zip ? Hi, You can download it from http://www.openscenegraph.org/projects/osg/attachment/wiki/Support/Tutorials/NPS_Tutorials_src.rar Good luck, Bye.. Umit UZUN 2008/7/25 Ariasgore [EMAIL PROTECTED]: Hi, does anybody know where I can get the NPS Tutorials zip with all modells referenced in the osg tutorials? It's pretty hard to do them without the proper files and it seems that they are unavailable at the moment. The old page here - http://www.openscenegraph.org/documentation/NPSTutorials/ has only a dead link to that zip. Greetings ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenSceneGraph-2.6.0-rc1 tagged
Hi All, I have just tagged OpenSceneGraph-2.6.0-rc1: http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.6.0-rc1/ And have made the OpenSceneGraph-2.6 branch: http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6/ I've also put up links on the downloads page: http://www.openscenegraph.org/projects/osg/wiki/Downloads The plan is now to test 2.6.0-rc1 and the OpenSceneGraph-2.6 branch to spot problems that need resolving. My guess is that we will need a couple more rc's before that final 2.6.0 stable is tagged. During the shake down of OpenSceneGaph-2.6 we'll use the branch as the basis, rather than trunk and further rc's will be made from the OpenSceneGraph-2.6 branch. We have several members of the community that have write permission to the branches: Paul Martz Bob Kuehne Paul Melis (new) Eric Sokolowski (new) Jeremy Moles (new) And myself of course, although I'll be away next week so it's up to these guys to check in your fixes ;-) On my return I'll merge fixes from the OpenSceneGraph-2.6 branch back into SVN trunk. I'll also do a review of all the changes made against the branch 2.6. Thanks to all those who've pitched in with new functionality in 2.6, and all the testing and debugging. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSX X11 build
I've been away from OSG for a few weeks (vacations, other projects, etc) but I have some time to get back to it. I'm encountering trouble building OSG with X11 because CMake can't find GL/glx.h. I'm going to keep banging away at this, but if anyone offhand knows how to get CMake to find the file in the right place, please let me know. This header file is needed to compile osgViewer (the library, not the application). I intend to get this resolved before Robert releases OSG 2.6. I'm also trying to see if the X11 build will support 64-bit, which the Carbon build will not. -Eric ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [Bug] Invalid CMake version checks
This construct is not future safe: IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4) This will break the day CMake 3.0 is released. Kevin Kofler ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Image::update?
Robert Osfield wrote: Hi Hartmut, On Thu, Jul 24, 2008 at 3:10 AM, Hartmut Seichter [EMAIL PROTECTED] wrote: I just realized the introduction of osg::Image::update(osg::NodeVisitor*) which is awsome (kindof - for now it just breaks the whole thing), What do mean just breaks the whole thing? Could you be very specific. It shouldn't change anything for conventional Texture/Image usage. Well, osgART has a number of PlugIns implementing their own osgART::VideoImageStream which implements update slightly different. But I am happy to quickly change things over as we are targeting the latest OSG especially for osgART (http://osgart.org) ... I was wondering what your plans are with the implementation as the osgimagesequence is probably a work in progress osgimagesequence is currently work in progress, it should be wrapped up today though. I have non paged and paged ImageSequence functionality working, it just API refinement and better control of looping. Robert. Are there any plans to differentiate between open() and play() ... this was the main reason for us to have osgART::VideoImageStream as we need to know in osgART which dimensions and colorspace the imagestream supports Cheers, H ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Hartmut Seichter, PhD (HKU), Dipl-Ing.(BUW), Postdoctoral Fellow, HITLabNZ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to read out the coordinate info from model files
Hi all, I'm trying to import some 3ds models (using osgDB::readNodeFile) into an osg programme. Now the problem is that: Is there any way that we can read the coordinate information out from the models since 3ds models have saved the position (the model center) coordinate information themselves? Is there any API in osg::Node class which we can call to get such information? I hope I make my question clear. Thanks for your advices in advance. With best regards, Fangqin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org