[osg-users] New Book on Openscenegraph 3.0
Hi, I am Zaid and I am looking out for potential reviewers interested in reviewing our book OpenSceneGraph 3.0 : Beginners guide on their blog/ Website. The book is written by Rui Wang, Xuelei Qian. You can check out the book at https://www.packtpub.com/openscenegraph-3-0-beginners-guide/book If you are interested you can contact me on would be happy to send across a review copy. (only serious people please! ) ... Thank you! Cheers, Zaid -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35940#35940 Attachments: http://forum.openscenegraph.org//files/osg_209.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] hi, anyone can tell me how convert .dgn files to .osg/.ive ?
Hi, everybody. recently, I get trouble about converting .dgn files( MicroStation'format) to .osg ; I found dgn2osg plugin in osg'web sites, but it seems not to download availably now. I also can't find opendgn'sdk download from Google which support read/write dgn files. any advices, appreciate!! Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35942#35942 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi Sam, You can't remove an object from it's a parent in a apply() method as this would invalidate the iterators of the calling code (the traverse() method that calls the node-accept() which in turn calls the apply()). It's safe to remove the children of a node you are passed in a the apply method, but not removing that node from it's parent. Another approach is to collect the list of nodes you want to remove in list during the traversal using the node visitor than have a method you call after traversal that does all the operations on the nodes, this way you can avoid invalidating iterators. The second half of your post I couldn't make any sense of so can't comment on this. Robert. On Tue, Jan 25, 2011 at 7:26 AM, Sam Warns the_vincu...@hotmail.com wrote: Hi, I was writing a Visitor that performed an extraction of certain elements from a scenegraph. My first try was to remove the nodes in question from their parents directly in the apply method which lead to some exceptions. So what am I doing wrong? I mean I would except some finalize method which is called when the visitor is finished. Currently the only remaining function is the getter function for the nodes, that should be extracted. So in apply I have stored references to the object which I can only extract when using the getter so that the removal logic can be executed. This works so far but if I do not call the getter no extraction code is executed and nothing really happened. What am I doing wrong? Thank you, Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35941#35941 ___ 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] Visitor concept. No finalize?
Hi Robert, the second half of my post is about the second option you was talking about. The apply only gathers the nodes in question and does nothing else then there is another method that performs the removal from parent. But the issue with that is, that if I do not call this method, no removal is done. That was, what I was talking about. The visitor finished its work but as long as the user do not call an additional method the removal from parent has not been done yet. I was hoping for a finish method that is automatically called after the visitors work has been finished. This finish method could then perform the necessary removal operation (or any other). Thank you! Cheers, Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35944#35944 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi Sam, You have complete control over what you do before and after traversal, there really isn't any need to have a finalize method as it would only restrict what users can do over what they can already do. If you wanted an finialize method in your visitor then just write a method like: MyVisitor : public NodeVisitor { void apply(...) // all my apply overrides your need... void process(Node* node) { // do what you want to initialize the visitor prior // to traversing the scene graph node-accept(node); // do what you want after traversal } }; MyVisitor myvistor; myvisitor-process(node); The visitor implementation is deliberately designed to allow you to be flexible, it's up to you how you want to go about implementing the details for the purpose of your application. Robert. On Tue, Jan 25, 2011 at 10:21 AM, Sam Warns the_vincu...@hotmail.com wrote: Hi Robert, the second half of my post is about the second option you was talking about. The apply only gathers the nodes in question and does nothing else then there is another method that performs the removal from parent. But the issue with that is, that if I do not call this method, no removal is done. That was, what I was talking about. The visitor finished its work but as long as the user do not call an additional method the removal from parent has not been done yet. I was hoping for a finish method that is automatically called after the visitors work has been finished. This finish method could then perform the necessary removal operation (or any other). Thank you! Cheers, Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35944#35944 ___ 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] Database Pager behavior
Hi all, I just would like to understand the behavior of the database Pager when I get osg::notify(osg::INFO)DatabasePager::fileRquest(fileName) orphaned, resubmitting.std::endl; This code is in the DatabasePager::requestNodeFile(...) function, where the file is considered as orphaned when the ref_count equals 1. I understand why it is considered as orphaned due to its ref_count (1 means only the actual reference and no parents in the scene graph) but I don't understand how or when this can arrive... Can you help me ? Thanks. Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi Robert, I am aware of the possibility to define my own methods in the visitor but the point I was trying to explain is, that if I apply a visitor on a scene I would except that this visitor has finished its work after calling the node-accept(myVisitor) If I have a RemoveXVisitor and I as the user and not the writer of it use this visitor as I am used to use them by Code: RemoveXVisitor v; node-accept(v); I would expect that the Visitor has done it's work, which it actually didn't since there is no finalize method I would need to write: Code: RemoveXVisitor v; node-accept(v); v.doTheJobActually(); So there is a discrepancy between what I would except from a visitor after it was passed to accept and what a visitor is able to do in it's apply method Greetings Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35950#35950 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi Sam, I simply don't get why your are expecting things from the NodeVisitor that it isn't intended to provide, and what you can very simply provide yourself. There are many examples of NodeVisitor's in action in the OSG please do a search through the code base. Robert. On Tue, Jan 25, 2011 at 11:34 AM, Sam Warns the_vincu...@hotmail.com wrote: Hi Robert, I am aware of the possibility to define my own methods in the visitor but the point I was trying to explain is, that if I apply a visitor on a scene I would except that this visitor has finished its work after calling the node-accept(myVisitor) If I have a RemoveXVisitor and I as the user and not the writer of it use this visitor as I am used to use them by Code: RemoveXVisitor v; node-accept(v); I would expect that the Visitor has done it's work, which it actually didn't since there is no finalize method I would need to write: Code: RemoveXVisitor v; node-accept(v); v.doTheJobActually(); So there is a discrepancy between what I would except from a visitor after it was passed to accept and what a visitor is able to do in it's apply method Greetings Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35950#35950 ___ 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] Visitor concept. No finalize?
Hi Robert, I suppose I expect that because let's say a RemoveGroupsVisitor should remove Groups from a given graph, when I apply this visitor to a scene by Code: RemoveGroupsVisitor r; scene-accept(r); I personally would expect that now the groups are removed, which they are not by the limitation of the apply methods Regards Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35952#35952 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] manipulator design advice
Hi, very good question, i am having the same problem i will keep u informed ;) Thank you! Cheers, Jerome -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35953#35953 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] hi, anyone can tell me how convert .dgn files to .osg/.ive ?
I would have a look at something like 'Deep Explorer' from right hemisphere, it can convert a lot of formats to formats supported by OSG such as Multigen OpenFlight(tm) of the top of my head I believe it supports dng format, once converted to say OpenFlight you can use OSG to create your OSG/IVE files Gordon Tomlinson 3D Technology System Engineering Consultant Overwatch® An Operating Unit of Textron Systems __ WARNING: Documents that can be viewed, printed or retrieved from this E-Mail may contain technical data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq,) or the Export Administration Act of 1979, as amended, Title 50, U.S.C., App. 2401 et seq. and which may not be exported, released or disclosed to non-U.S. persons (i.e. persons who are not U.S. citizens or lawful permanent residents [green card holders]) inside or outside the United States, without first obtaining an export license. Violations of these export laws are subject to severe civil, criminal and administrative penalties. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of John Water Sent: Tuesday, January 25, 2011 3:48 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] hi,anyone can tell me how convert .dgn files to .osg/.ive ? Hi, everybody. recently, I get trouble about converting .dgn files( MicroStation'format) to .osg ; I found dgn2osg plugin in osg'web sites, but it seems not to download availably now. I also can't find opendgn'sdk download from Google which support read/write dgn files. any advices, appreciate!! Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35942#35942 ___ 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] hi, anyone can tell me how convert .dgn files to .osg/.ive ?
Hi, osgconv srcfile dstfile in cmdline type before osgconv: set OSG_NOTIFY_LEVEL=DEBUG Petr -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35947#35947 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgconv failed loading .dll
Hi, I have problem convert .flt to .ive console debug output: USING: c:\Program Files\OpenSceneGraph-2.8.3\bin\osgPlugins-2.8.2\osgdb_ive.dll dynmaic library failed loading: osgPlugins-2.8.2\osgdb_ive.dll cmd osgoconv --plugins find all .dlls in c:\Program Files\OpenSceneGraph-2.8.3\bin\osgPlugins-2.8.2\ on the 2nd pc is sthe same OSG instalation and osgconv works fine ... in debug mode are the paths same PC1 and PC2: Env Variables - are the same cmd osgversion OpenSceneGraph Library 2.8.2 (both) cmd echo %OSG_ROOT% c:\Program Files\OpenSceneGraph-2.8.3 (both) start - run: osgviewer cow.osg - ok (both) Instalation on the 2nd PC: I have copied al from root directory c:\Program Files\OpenSceneGraph-2.8.3\ and add same env. variables. Thank you for any help! Cheers, Petr -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35945#35945 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] struct member alignment - default (ok) - 1Byte (unhandled exc...)
Hi, i have problem with struct alignment - my project include this structs: typedef struct __DSPOS__ { float x; float y; float z; float h; float p; float r; }DSPOS; typedef struct __PLAYER_POS__ { UCHAR index; DSPOS pos; }PLAYER_POS; And when i changed in project - properties Struct Member Alignment from default to 1 Byte - I cannot run viewer (Microsoft Visual Studio) ): the problem is on this line: viewer.setSceneData(root); Unhandled exception at 0x00db7a10 in osgdefaultproject.exe: 0xC005: Access violation reading location 0xe24d. How can I solve this problem? Thank you. Cheers, petr -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35917#35917 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] struct member alignment - default (ok) - 1Byte (unhandled exc...)
solved: project-properties-c++-codegen-struct m align: default #pragma pack(push, 1) typedef struct ... #pragma pack(pop) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35955#35955 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] struct member alignment - default (ok) - 1Byte (unhandled exc...)
Petr Srom writes: Hi, i have problem with struct alignment - my project include this structs: typedef struct __DSPOS__ { float x; float y; float z; float h; float p; float r; }DSPOS; typedef struct __PLAYER_POS__ { UCHAR index; DSPOS pos; }PLAYER_POS; And when i changed in project - properties Struct Member Alignment from default to 1 Byte - I cannot run viewer (Microsoft Visual Studio) ): the problem is on this line: viewer.setSceneData(root); Unhandled exception at 0x00db7a10 in osgdefaultproject.exe: 0xC005: Access violation reading location 0xe24d. How can I solve this problem? Do not change the whole project alignment settings. Other libraries compiled with sane values for it will break, as you have experienced with OSG. Change it only in your data structures with the pragma directives of your compiler. A quick google results in #pragma pack for your VS. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi Sam, Your expectations are unreasonable, please them recalibrate otherwise you are going to constantly disappointed that everything in the world doesn't conform to you prior conceptions. In the case of the NodeVisitor where you are seeing a limitation, it's actually a positive and deliberate feature. The OSG's NodeVisitor is extremely powerful and flexible, this is achieved by handing over responsibility to the developer and makes as few assumptions as possible. With this it does have usage patterns that you have to follow, there are plenty of examples that illustrate it's use, and I have given you examples and explanations. Robert. On Tue, Jan 25, 2011 at 11:54 AM, Sam Warns the_vincu...@hotmail.com wrote: Hi Robert, I suppose I expect that because let's say a RemoveGroupsVisitor should remove Groups from a given graph, when I apply this visitor to a scene by Code: RemoveGroupsVisitor r; scene-accept(r); I personally would expect that now the groups are removed, which they are not by the limitation of the apply methods Regards Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35952#35952 ___ 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] Visitor concept. No finalize?
On 1/25/2011 4:34 AM, Sam Warns wrote: Hi Robert, I am aware of the possibility to define my own methods in the visitor but the point I was trying to explain is, that if I apply a visitor on a scene I would except that this visitor has finished its work after calling the node-accept(myVisitor) If I have a RemoveXVisitor and I as the user and not the writer of it use this visitor as I am used to use them by Code: RemoveXVisitor v; node-accept(v); I would expect that the Visitor has done it's work, which it actually didn't since there is no finalize method I would need to write: Code: RemoveXVisitor v; node-accept(v); v.doTheJobActually(); So there is a discrepancy between what I would except from a visitor after it was passed to accept and what a visitor is able to do in it's apply method If your RemoveXVisitor doesn't actually remove anything, but instead collects references to X (that you might remove later with a separate operation), then perhaps you should consider changing the name of the visitor to CollectXVisitor to more accurately describe its purpose, so that other developers don't get confused about what it does (as you are describing above). -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GSoC 2011
Hi OSG community. osg was always late to participate but maybe this time? so consider the opportunity Google has just announced GSoC2011. http://google-opensource.blogspot.com/2011/01/google-summer-of-code-announced-at-lca.html The timeline is here: http://www.google-melange.com/document/show/gsoc_program/google/gsoc2011/timeline Regards Sergey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Addressing warnings in OSG in prep for 3.0
Hi All, For the 3.0 release I'd like to clean up warnings that have crept in over the past year, for this I'd the communities help, as I have limited OS versions available to test and only a finite amount of time available each day. There aren't too many in the core libraries and plugins as these warnings are generally picked and fixed as we go along, there is one in Program.cpp I've left in as reminders of incomplete functionality, so this will need address via a feature addition or simply introduction of runtime warning of incomplete functionality. There are others that appear under other platforms and picked up on cdash.openscenegraph.org. Let me know your suggestions on which one might indicate actual code problems and how the warnings might be fixed, or suppressed if avoids compromising code quality and reliability by doing a hacky fix as workaround for inappropriate warnings. The cdash.openscenegrah.org builds reports altered me to many warnings in the fbx plugin under the Linux build, so I pulled down the fbx SDK and got the plugin compiling and reproduced the warnings - with this I've been able to fix half a dozen warnings that required an unambiguous fix, however, there are far more that the warning is telling us that is potentially something wrong in the code that really requires someone with knowledge of the fbx SDK and the fbx plugin to fix. I've attached the linux warnings that remain as an aid. Thanks in advance for your help, Robert. [ 0%] Built target OpenThreads [ 45%] Built target osg [ 62%] Built target osgUtil [ 70%] Built target osgDB [ 70%] Built target osgText [ 79%] Built target osgGA [ 83%] Built target osgViewer [ 95%] Built target osgAnimation [ 95%] Building CXX object src/osgPlugins/fbx/CMakeFiles/osgdb_fbx.dir/fbxRAnimation.o /usr/local/include/fbxfilesdk/kfbxplugins/kfbxanimcurvenode.h:342: warning: ‘void fbxsdk_2011_3_1::CollectAnimFromCurveNode(fbxsdk_2011_3_1::KFCurve**, fbxsdk_2011_3_1::KFCurveNode*, unsigned int, fbxsdk_2011_3_1::KFbxAnimCurveNode*)’ declared ‘static’ but never defined [100%] Building CXX object src/osgPlugins/fbx/CMakeFiles/osgdb_fbx.dir/fbxRCamera.o /usr/local/include/fbxfilesdk/kfbxplugins/kfbxanimcurvenode.h:342: warning: ‘void fbxsdk_2011_3_1::CollectAnimFromCurveNode(fbxsdk_2011_3_1::KFCurve**, fbxsdk_2011_3_1::KFCurveNode*, unsigned int, fbxsdk_2011_3_1::KFbxAnimCurveNode*)’ declared ‘static’ but never defined [100%] Building CXX object src/osgPlugins/fbx/CMakeFiles/osgdb_fbx.dir/fbxRLight.o /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRLight.cpp: In member function ‘osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxLight(fbxsdk_2011_3_1::KFbxNode*, int)’: /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRLight.cpp:56: warning: enumeration value ‘eNONE’ not handled in switch /usr/local/include/fbxfilesdk/kfbxplugins/kfbxanimcurvenode.h: At global scope: /usr/local/include/fbxfilesdk/kfbxplugins/kfbxanimcurvenode.h:342: warning: ‘void fbxsdk_2011_3_1::CollectAnimFromCurveNode(fbxsdk_2011_3_1::KFCurve**, fbxsdk_2011_3_1::KFCurveNode*, unsigned int, fbxsdk_2011_3_1::KFbxAnimCurveNode*)’ declared ‘static’ but never defined [100%] Building CXX object src/osgPlugins/fbx/CMakeFiles/osgdb_fbx.dir/fbxRMesh.o /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp: In function ‘int getVertexIndex(const fbxsdk_2011_3_1::KFbxLayerElementTemplateT*, const fbxsdk_2011_3_1::KFbxMesh*, int, int, int) [with T = fbxsdk_2011_3_1::KFbxVector4]’: /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:563: instantiated from here /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:76: warning: enumeration value ‘eNONE’ not handled in switch /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:76: warning: enumeration value ‘eBY_EDGE’ not handled in switch /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:76: warning: enumeration value ‘eALL_SAME’ not handled in switch /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp: In function ‘bool layerElementValid(const fbxsdk_2011_3_1::KFbxLayerElementTemplateT*) [with T = fbxsdk_2011_3_1::KFbxVector4]’: /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:708: instantiated from here /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:59: warning: enumeration value ‘eINDEX’ not handled in switch /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp: In function ‘bool layerElementValid(const fbxsdk_2011_3_1::KFbxLayerElementTemplateT*) [with T = fbxsdk_2011_3_1::KFbxColor]’: /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:709: instantiated from here /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp:59: warning: enumeration value ‘eINDEX’ not handled in switch /home/robert/OpenSceneGraph/src/osgPlugins/fbx/fbxRMesh.cpp: In function ‘bool layerElementValid(const fbxsdk_2011_3_1::KFbxLayerElementTemplateT*) [with T = fbxsdk_2011_3_1::KFbxVector2]’:
Re: [osg-users] Addressing warnings in OSG in prep for 3.0
Hi Robert, As I built the 3rdParty Package for VS2008 last year, I did a mistake and removed the debug databases from the compile output, so in debug mode there are lots of warnings due to missed .pdb files. Should I rebuild the package content (would consume a lot of time I think), Or are the messages OK because it is not OSG itself but only the 3rdParty package? Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35962#35962 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph with glut support
Hi Robert, im really sorry, i somehow missed out on your post on my first read. Thanks for the detailed explanation. Well im a student and looking at the vastness of OSG, i felt it would require quite a lot of time. So, i was looking for support from the lower level APIs. Thanks ... Hi Shayne, Our OpenGL rendering is in a wrapper which happens in a post draw callback. This seems to work fine. The key is in state management since OSG and OpenGL share the same render context. Could you please elaborate with some links or small examples? i did not quite get you. Thanks a lot! Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35963#35963 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Rotating the display
Greetings, My application is going to be run on different displays, some of which might be rotated 90, 180, or 270 degrees from their typical position. I've basically set things up so that my app reads the screen orientation from a config file, and does what it needs to do to make sure that things look 'upright' if that screen orientation is anything other than 0 degrees. For the HUD, I have an osg::Projection node that is a parent to all of the HUD items. If the screen orientation is non-zero, then the projection matrix that I use contains some built-in rotation, like so: Code: osg::Matrix orthoMat = osg::Matrix::ortho(0, screenWidth, 0, screenHeight, 0.1, 1000.0f); osg::Matrix rotMat = osg::Matrix::rotate(screenOrientationAngle, 0, 0, 1); osg::Matrix finalProjMat = orthoMat * rotMat; Just in case you are wondering: if the screen is rotated 90 or 270 degrees, I also swap the width and height so that my HUD items don't look stretched. I also use a trick to make sure that items appear in the correct place when the aspect ratio changes, but I don't bore you with the details of that. This all seems to work well with one hitch: it seems to mess up the computePixelSizeVector calculation. I'm not quite sure how this calculation works, but when I embed some rotation into my projection matrix, it seems to have the effect of setting the w component of the pixelSizeVector to some huge number, and invariably all HUD items are culled by small feature. I solved this by disabling the small feature culling, but since this is done on the camera, it will probably be global to the whole scene, which is probably not desirable. I'm sure I can find some other way (turning culling inactive for all HUD-related nodes, perhaps). I'd like to do this same sort of thing for the main scene rendering, i.e. set the projection matrix on the camera to its normal projection matrix (using the reciprocal of the aspect ratio if necessary), multiplied by a rotation matrix. However, since running into that snag, I'm starting to wonder if this isn't a terrible idea. =] I have no idea what I might be messing up. =P Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35964#35964 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Visitor concept. No finalize?
Hi, that is exactly the point. My RemoveXVisitor SHOULD remove nodes but since it is not possible to do that in apply and there is no finalize method that gets automatically called after accept has finished, it is only possible to remove nodes by providing a custom member which the user must call manually. That is what I am talking about, it is not possible for a Visitor to do certain things without having the user explicitly call members of it after the accept call. I did not demand a finalize method and I understand Robert's statement that flexibility is achieved by relying on the user. Never the less would a finalize method decrease any flexibility and power of it. (Btw: I have never experienced that handing over responsibility to the user (which is the developer at this point) produced any good results, but this is only my experience) Thanks, Sam -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35965#35965 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [Query] Delaunay Traingulator Usage
Can anyone help me with usage of Delaunay Triangulator in following case? osg::ref_ptrosgUtil::DelaunayTriangulator delaunayTriangulator = new osgUtil::DelaunayTriangulator; step 1. delaunayTriangulator-setInputPointArray(inputPoints); osg::DrawElementsUInt* triangles = delaunayTriangulator-triangulate(); // constraint_lines are added while triangulation and not removed before return in triangualate() // now, if I want to use same delaunay instance , I am not able to remove constraint created above as API exposed to remove constraint. step2. delaunayTriangulator-setInputPointArray(inputPoints2); osg::DrawElementsUInt* triangles = delaunayTriangulator-triangulate(); // inputPoints2 get modified with some points in vertex array of the delaunay constraint created in step1 To avoid this , I have left with no option other than creating new instance for every triangulation. Is it a right way of keeping constraint_line which is not added explicitly on completion of Triangulation? Thanks, Saurabh Arora ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jitter problem - OSG Nvidia Physx
What are the magnitudes of coordinates that you're using? -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Arif Yetkin Sar?? Sent: Monday, January 24, 2011 2:45 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Jitter problem - OSG Nvidia Physx Hello everyone. We have been using OSG with nvidia physx for a driving simulation and we have jitter problem, where the cars and other objects in the scene (controlled by the physics) jitter annoyingly :). We believe that we update the scenegraph in a wrong way. In our code : There is a physx thread. There is an OSG library thread where we can add new entities, remove them, start rain effects, call an animation of a skeleton character etc. There is an OSG render loop thread, where osgviewer::...frame() is called. Our Nvidia physx thread produces new x y z pitch head roll values for the scene entities at 60Hz (or any other frequency we want). Physx thread calls the updateEntity() function of our OSG library thread. This function simply updates scene entities with matrixtransform::void setMatrix(const Matrix mat). In other words, we move an object with this chunk of code: Code: osg::Matrixd mxT = createTransformMatrix(x,y,z,h,p,r); mt-setMatrix(mx); Here what we tried: 1-we fed OSG lib directly whenever a physx output is produced (every 16.6 ms or so - 60Hz): there is jitter. 2-we maintained a queue of frames on OSG lib, fed OSG at the end of each frame() : there is jitter. 3-we implemented a sampling mechanism on this queue, where OSG requests the interpolated frame from the queue for the current timestamp : there is jitter. 4-we saved a few minutes long log of the physx to a file (many frames). Started a dummy thread, and fed OSG from this log. : there is jitter. When OSG works with 60FPS, and physx thread is running at 60Hz, there seems to be quite low jitter (sometimes unnoticeable) . Thanks in advance for any hints or advices. Arif Yetkin http://www.youtube.com/watch?v=naX3hOkDx8w -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35912#35912 ___ 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] Trouble trying to integrate Osg in a Wpf Application using HwndHost
On Tue, Jan 25, 2011 at 11:39 AM, Chris Corn christian@gmail.comwrote: Hi, It's been 3 days that I'm trying to integrate Osg inside a Wpf Application. I would like to integrate an osgviewer using a class that extends HwndHost (defined in System.Windows.Runtime.InteropServices) as shown in an article attached to a Forum Topic about WPF (see Ref) Rapidly: I wrote the BuildWindowCore implementation but I'm getting a SEHException every time that I try to create the Graphic Context: Code: virtual HandleRef BuildWindowCore(HandleRef hwndParent) override { RECT DrawingCanvas; HWND WindowHandle = CreateWindowEx(0,_className, _windowName, _dwStyle, 0, 0, 100, 100, (HWND) hwndParent.Handle.ToPointer(), 0, _hInstance, 0 ); GetWindowRect(WindowHandle, DrawingCanvas); osg::ref_ptrosg::Referenced windata = new osgViewer::GraphicsWindowWin32::WindowData(WindowHandle); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; // Setup Graphic Context traits-x = 0; traits-y = 0; traits-width = DrawingCanvas.right - DrawingCanvas.left; traits-height = DrawingCanvas.bottom - DrawingCanvas.top; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext = 0; traits-inheritedWindowData = windata; // Pixel Format Descriptor PIXELFORMATDESCRIPTOR pixelFormat = { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, PFD_MAIN_PLANE, 0, 0, 0, 0 }; // Get the device context for the Win32 handle to the control HDC hdc = ::GetDC(WindowHandle); // Set the pixel format on the device context int pixelFormatIndex = ::ChoosePixelFormat(hdc, pixelFormat); ::SetPixelFormat(hdc, pixelFormatIndex, pixelFormat) // Create an Open Scene Graph graphics context osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits); return HandleRef(this, IntPtr(WindowHandle)); } Do you have some ideas on how solve my problem? Am I doing something wrong? Thank you! Have a nice day!, Chris Ref: forum openscenegraph, viewtopic with t=3279 (sorry but I cant submit links now) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35946#35946 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hi Chris, Well, we have a running WPF based application that includes an osg viewer. Here is how we did that : (i am no WPF coder, so i can't be very specific about it) : - in the WPF side, we created a subclass of System.Windows.Window. In Window_Loaded method, we get a handle of the window like this : IntPtr winPtr = new WindowInteropHelper(this).Handle; this handle will be used to initialize the osg viewer. - We created a simple wrapper dll with a simple C interface that manages an osg viewer. our C interface has create/destroy/frame/loadmodel methods. - this wrapper dll is loaded in the WPF application with a DllImport statement per method in the C interface. - back to the wpf side, in Window_Loaded method, we pass the handle of the window to the create function in the wrapper dll. This function creates an osg graphic context as you already have and create an osgViewer object using that context. - Still in the wpf side, we have a Paint method in which we call the frame method of the wrapper dll that simply call the frame method of the viewer. Make sure to add this to the ctor of the window : CompositionTarget.Rendering += Paint; I hope this will help you. Mourad ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jitter problem - OSG Nvidia Physx
Arif, You haven't really said _what_ was jittering - is it your scene entities, or your camera? If it is your entities, then what I am about to say won't really apply to you. If it is your camera, then maybe it will give at least help to give you a clue. You might want to check the order in which you perform your updates. Here is a scenario I ran into a while back: 1. Had an osg::OperationThread that pulled in data from network to update positions of objects 2. Had an osgGA::GUIEventHandler that performed node tracking and updated the camera matrixTransform If you look at osgViewer::ViewerBase::frame, you will see void ViewerBase::frame(double simulationTime) { ... eventTraversal(); // *** OperationThreads get called in updateTraversal before the update visitor. updateTraversal(); renderingTraversals(); } In my case I was repositioning my camera in the eventHandler, but new object position information was coming in during the updateTraversal. This caused my camera to always calculate based on the old position and therefore be one frame behind. I changed the logic so that the calculation of the camera position happened during the call to my camera manipulator's getInverseMatrix() and that fixed my problem. So as long as everything coming in is updated and sync'ed in the same way, you shouldn't see jitter. Hope that helps -- Chuck Seberino On Jan 24, 2011, at 1:45 AM, Arif Yetkin Sarı wrote: Hello everyone. We have been using OSG with nvidia physx for a driving simulation and we have jitter problem, where the cars and other objects in the scene (controlled by the physics) jitter annoyingly :). We believe that we update the scenegraph in a wrong way. In our code : There is a physx thread. There is an OSG library thread where we can add new entities, remove them, start rain effects, call an animation of a skeleton character etc. There is an OSG render loop thread, where osgviewer::...frame() is called. Our Nvidia physx thread produces new x y z pitch head roll values for the scene entities at 60Hz (or any other frequency we want). Physx thread calls the updateEntity() function of our OSG library thread. This function simply updates scene entities with matrixtransform::void setMatrix(const Matrix mat). In other words, we move an object with this chunk of code: Code: osg::Matrixd mxT = createTransformMatrix(x,y,z,h,p,r); mt-setMatrix(mx); Here what we tried: 1-we fed OSG lib directly whenever a physx output is produced (every 16.6 ms or so - 60Hz): there is jitter. 2-we maintained a queue of frames on OSG lib, fed OSG at the end of each frame() : there is jitter. 3-we implemented a sampling mechanism on this queue, where OSG requests the interpolated frame from the queue for the current timestamp : there is jitter. 4-we saved a few minutes long log of the physx to a file (many frames). Started a dummy thread, and fed OSG from this log. : there is jitter. When OSG works with 60FPS, and physx thread is running at 60Hz, there seems to be quite low jitter (sometimes unnoticeable) . Thanks in advance for any hints or advices. Arif Yetkin http://www.youtube.com/watch?v=naX3hOkDx8w -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35912#35912 ___ 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] OpenSceneGraph with glut support
You can declare and register a PostDrawCallback with the camera class to do OGL rendering. It will get called after the OSG rendering traversal... void PushOSG_GL_State() { // since OSG and OGL share the same render context, push OGL state used by OSG glPushAttrib(GL_ALL_ATTRIB_BITS); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_TEXTURE); glPushMatrix(); } void PopOSG_GL_State() { // pop it back off when done with our explicit OGL rendering... glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); glPopAttrib(); } struct OGLPostDrawCallback : public osg::Camera::DrawCallback { OGLPostDrawCallback(){} virtual void operator () (const osg::Camera camera) const { PushOSG_GL_State(); // OpenGL rendering happens here... renderOGL(); PopOSG_GL_State(); } }; . . . view-getCamera()-setPostDrawCallback(new OGLPostDrawCallback); . . . I'm sure there are other ways to do this but this is what we're doing. It works fine. Hope this helps... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Mukund Keshav Sent: Tuesday, January 25, 2011 1:09 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OpenSceneGraph with glut support Hi Robert, im really sorry, i somehow missed out on your post on my first read. Thanks for the detailed explanation. Well im a student and looking at the vastness of OSG, i felt it would require quite a lot of time. So, i was looking for support from the lower level APIs. Thanks ... Hi Shayne, Our OpenGL rendering is in a wrapper which happens in a post draw callback. This seems to work fine. The key is in state management since OSG and OpenGL share the same render context. Could you please elaborate with some links or small examples? i did not quite get you. Thanks a lot! Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35963#35963 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org smime.p7s Description: S/MIME cryptographic signature ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Accessing Vertex attributes of a loaded flt model
Hi, I need to read all the vertex position and normal of a loaded flt model. I tried using InfoVisitor to get all Geode nodes and get information on the vertices but not sure how to do it. Could someone advise how I should go about getting information on the vertex position and normal? Thank you! Cheers, Linda -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35974#35974 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph with glut support
Thanks a lot Shayne! That really helped. Cheers, Mukund -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35976#35976 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Disappearing Quads (Texcoords)
Hi, I am drawing some quads on a virtual plane to simulate raindrops on a windshield. The drops are basically just alpha blended quads. The effect is placed in front of the camera. It works really well, but unfortunately all my rain drops are sometimes disappearing when I look into certain directions. I use a really simple fragment shader: Code: gl_FragColor = v_color * texture2D(dropTexture, v_texCoord); and I have discovered something interesting. If I just return the color (or a fixed hardcoded color) the drops are ALWAYS visible. The drops are also ALYWAYS visible when I use a hardcoded texcoord of vec2(0.5, 0.5). When I use a hardcoded texcoord of vec2(1,1) the drops are always INVISIBLE, because the alphavalue is 0 at the border of the texture. This leads to the conclusion that something manipulates the texture coordinates of my quads. I tried to turn off any possibly set texture coordinate matrix with these lines: Code: texMatrix = new osg::TexMat(); osg::Matrix m; m.makeIdentity(); texMatrix-setMatrix( m ); ss-setTextureAttributeAndModes(0, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); ss-setTextureAttributeAndModes(1, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); ss-setTextureAttributeAndModes(2, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); ss-setTextureAttributeAndModes(3, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); ss-setTextureAttributeAndModes(4, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); ss-setTextureAttributeAndModes(5, texMatrix, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF ); But unfortunately it did not change anything - my quads are still disappearing depending on the camera position and orientation. Since I am very new to OSG I might have overseen something. Is there anything else that could transform my texture coordinates? If yes, how can I disable it? Thank you! Cheers, flo[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=35743#35743 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org