Re: [osg-users] osg::Image pixel format conversion
Hi, is the image coming from the GPU? If so, you can let OpenGL convert it for you on the way to CPU if you don't mind too much about transfer speed. Also, double check the image writing code if a certain format does not support BGRA. jp On 01/11/2011 02:40, Blake Mason wrote: I have a osg::image with pixel format of GL_BGRA. I need to convert it to GL_RGB so that I can write out any generic type of image with osgDB (i.e., jpg, png, tiff, etc). Is there an easy way to convert the _data in the image to be in some other format? I could obviously do this myself with a simple loop, but I wanted to see if there was a simple OSG way. writeImageFile is still commented out in the osgscreencapture.cpp example, and I wonder if it's a similar problem. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D models used in OSG ?
Hi Ryan, On 31/10/2011 23:48, Ryan Pavlik wrote: My workflow for simple applications is: Create/find models in Google SketchUp (the 3D warehouse is very useful). Export to OSG - https://github.com/rpavlik/sketchupToOSG - this works even with the free SketchUp by automating the export to COLLADA and conversion to OSG. wow, first time I've heard of this. Nice work. jp Ryan On Fri, Oct 28, 2011 at 2:37 PM, Maia Randria veneree.randrianari...@crulrg.ulaval.ca mailto:veneree.randrianari...@crulrg.ulaval.ca wrote: Hello, Thank you so much for all these helpful advices. I really appreciate that. I already bought the e-book of Rui and started to look into it. I read also the book of Paul Martz. Great books. My concern is about the time required for the development of a VR application with OSG +VR Juggler (we are going to have a CAVE for neuroscience research) compared to high-level-based engines like Virtools or Vizard of WorldViz. I dont' know if you know both of them ? I am evaluating these software in order to decide which one(s) could fit for our needs. Thanks again, Maia John Richardson wrote: Hello, The real question is how do you import models from commercial and open source packages into OSG and support for animations, Others can chime in technically on this... Yes, it does take artistic talent. However, your email is from Université Laval. So you have a perfect solution. Collaborate with the art department. However, I will give a synopsis of my process. I am not an artist. 0) The first step is buying the Wang Rui book on OSG. 1) Acquire Blender. 2) Acquire one or more commercial systems with large numbers of example models with an acceptable reuse license. Note: If your university has various numbers of 3-D modeling and animation systems take their various and sundry examples and export to VRML or COLLADA. Then examine their other export formats [File -- Export or whatever menu item does the trick]. The best of the proprietary formats are 3DS, LWO, OBJ. Now, when I say best or talk about VRML / X3D / COLLADA, I am talking about the file interoperability problem. These comments are just my philosophical workaround. So, now you have a lot of scene components. Either arrange them in your modeler of choice [originally before export with an artist] or import the exported examples and arrange them [you don't need an artist since I can do this]. I suggest that you give them useful names and if possible, give them useful names at the nodes that you may be interested in accessing via OSG for your simulations. There is no more advice I can give at this point on naming. The Web3D people tried with the H-Anim standard and other profiles to X3D [See the Poser character animation system if the university has one]. The problem domain is huge and nobody seem to be able to make train loads of money on the solution so there is no satisfactory solution. 3) Turn your yourself or your programmer collaborators loose on the OSG coding for import and scene manipulation. The coders should know the process for compiling/downloading. You already know how to access this list for advice. Also, note that there are lots of contributors to this list that can code if you have funding available [Guay, Hanson, Martz, Cigar, Osfield,insert name I left out here,...]. If your goal involves students, then I suggest that you approach the issue from a architectural perspective. There are a lot of architectural programs in the USD 50-150 range that export to VRML and probably 3DS and OBJ/LWO/DXF. These can be acquired at almost every Apple Store for the Mac and every Best Buy or Fry's or whatever giant Canadian electronics superstore is in your area for the PC [and possibly for the Mac] [Punch!;TurboCAD;...]. A nice city block or representation of Université Laval would be a starting point. Then just see if you can get a traffic or pedestrian simulation completed. This strategy is like using the iPhone's Siri [or Google Voice] as opposed to Dragon Naturally Speaking. The learning curve is a little bit easier. But DO NOT FORGET BLENDER [relatively steep learning curve]. The students need a portfolio. John F. Richardson -Original Message- From: [mailto:] On Behalf Of Maia Randria Sent: Thursday, October 27, 2011 12:26 PM To: Subject: 3D models used in OSG ? Hi, First, I am sorry if my questions seem naive, I am really a newbie in OSG/3D. My question is about the 3D models used by both of you in OSG: - do you create your own 3D models yourselves with OSG ? - or with other
Re: [osg-users] Migration of website and version control
Hi All, Thanks for the feedback so far, keep it coming. Forgot to mention, we use cdash as well, this is invaluable for me when we are converging towards a release so it's a service we'll want to maintain. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Override of an Override
Hi Paul, On Mon, Oct 31, 2011 at 4:39 PM, Paul Palumbo paul1...@yahoo.com wrote: If I have a node with a SetSet attribute set to OVERRIDE and then have a child node also set to OVERRIDE on the same attribute, what would the attribute value be on the child? Is it the parent node's attribute value or the child node's attribute value? OVERRIDE enables parent state to override the state of child. OVERRIDE on a child doesn't protect it from being overridden by parent state if that parents state uses OVERRIDE. However, if you need the child state to be protected from being overridden then use the PROTECTED mask to protect it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Image pixel format conversion
Hi Blake, There isn't a convenience method built into osg::Image to do this, but you could easily use gluScaleImage to convert the data. The new inbuilt glu lib within the OSG-3.x has the ability to work without a graphics context, this is enabled by passing in a PixelStorageModes structure in the gluScaleImage call. See the implementation of osg::Image::scaleImage(..) for an example of how this is done. Robert. On Tue, Nov 1, 2011 at 12:40 AM, Blake Mason maso...@llnl.gov wrote: I have a osg::image with pixel format of GL_BGRA. I need to convert it to GL_RGB so that I can write out any generic type of image with osgDB (i.e., jpg, png, tiff, etc). Is there an easy way to convert the _data in the image to be in some other format? I could obviously do this myself with a simple loop, but I wanted to see if there was a simple OSG way. writeImageFile is still commented out in the osgscreencapture.cpp example, and I wonder if it's a similar problem. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG + Qt + threading.
Hi Nico, I'm also working with Qt as UI framework with OSG as a 3d renderer. Have you successed to use another threading model than SingleThreaded ? Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43664#43664 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration of website and version control
Robert, We have been using github for the osgEarth project and we're happy with it. Here are some pros: Github's pull-request system is nice (as a replacement for the osg-submissions process). You can do your diff analysis right in the browser. Here's an example: http://goo.gl/KacWp The integrated wiki is supposedly git-backed, i.e. all your wiki pages are stored in a repository alongside the source repo. So in theory migrating the existing wiki over should be a matter of pushing the files up there. (Haven't tried it though.) Github also has an integrated issue-tracker if you decide to use it someday. Glenn Waldron / Pelican Mapping / @glennwaldron On Mon, Oct 31, 2011 at 7:24 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi All, I would like to start a discussion about migrating our website and version control services to new servers and feel this might be a good opportunity to change the technology that we use on the server for providing the website and version control services. One of the reasons that adds a little imperative to the move is that the current hosts of our server AI2, Universidad Politecnica de Valencia, Spain, look unlikely to be able to continue providing due to funding cuts. Technology wise it would also be good to find a better wiki and version control system. We also need engineers to help out with migration and ongoing maintenance of new servers and services that will be moving too. There is a wide range of different hosts and technologies we could use, and I'm happy to admit that I'm no expect in hosting, webserves, wiki management, version control systems, but this is a huge community so no doubt there is lots opinions, and perhaps even a few experts out there that might be able to help out with great suggestions and time to make things happen. To help kick things off. On the hosting side I currently have a Dreamhost account that provides the mailing lists services that we currently use, and my account looks to be sufficient for provide a Tracs and Subversion services as well - so pontentially we could move to Dreamhost and rely upon them for management of the server and server software and let us concentrate on the content. I really don't know how well this would work out having not tried to migrate services other than mailman across to them. If we do have to move existing services across quickly this might be strong contender. Technology wise I am comfortable with Subversion, but for fully distributed it's not as powerful as newer technologies like git. We've discussed both Mercurial and git on the mailing list before as possible contenders and feedback I've got from various experiments out in the community is that git looks to be most practical for our needs. Rather spend lots of time discussing the pros and cons of these two technologies I'm happy to narrow things down to migrating to git. What is open for discussion is really when and how we migrate to git. One possibility with migrating to git would be to have our own server, use a host like Dreamhost or go with another 3rd party like github. For the latter there is already a mirror of our subversion repository hosted over at github maintained by members of the community (please come forward as I've forgotten who set it up :-) : https://github.com/openscenegraph/osg I haven't used git too much yet other than to check out third party libs, but when the time comes I'll just have to roll my sleeves and dive and learn to use it properly. github also now have their own wiki, Gollum: https://github.com/features/projects/wikis I know nothing about Gollum so can't comment on it, I'm not overly impressed by Tracs - it's been sufficient but not that that powerful, so I'm reluctant to go with yet another dev wiki that is almost by not quite as powerful as the likes of MediaWiki. I have to admit that I really don't know too much about the practical behind the scenes management of MediaWiki let alone Gollum and Tracs so I really need to feedback from the community of the various strengths, weaknesses and practicalities. Finally once we've decided upon hosts for our needs, and the technologies that we migrate too we'll need to do the migration of our present wiki and version control systems. We'll need the engineers to help our with coordinating and undertaking this work. Once we've got a basic plan and the people in place we start migrating bit by bit. I look forward to your thoughts and in particular your offers of assistance ;-) Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Problems with setInfluenceMap to RigGeometry
Hi, I want to make a Geometry to a RigGeometry and give them an InfluenceMap. At first I create the InfluenceMap. Code: struct AddHelperBone : public osg::NodeVisitor { ::osgAnimation::Skeleton* Skeleton; AddHelperBone() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} void apply(osg::Transform node) { ::osgAnimation::Bone* Bone = dynamic_castosgAnimation::Bone*(node); ::osgAnimation::Skeleton* skel = dynamic_castosgAnimation::Skeleton*(node); if (skel) { Skeleton = skel; } if (Bone) { initVertexMap(Bone); } traverse(node); } }; Code: void initVertexMap(osgAnimation::Bone* b0) { string str_FileName = /home/username/TestMesh/File.txt; string str_tmp; int i_tmp; float f_tmp; ifstream FileStream; (*vim)[b0-getName()].setName(b0-getName()); FileStream.open(str_FileName.c_str(), ifstream::in); if(FileStream.good()) { while ( FileStream str_tmp i_tmp f_tmp) { if(b0-getName() == str_tmp) { (*vim)[b0-getName()].push_back(osgAnimation::VertexIndexWeight(i_tmp,f_tmp)); } } } else { cout Error endl; } FileStream.close(); } Data fom File.txt Bone 0 1.0 Bone 1 1.0 Bone 2 1.0 Bone 3 1.0 Bone 12 0.5 Bone 14 0.5 Bone 16 0.5 Bone 18 0.5 ... Then I read the vertices / faces from an obj-file and create a new geometry. Code: osg::Geometry* createGeo() { osg::Geometry* geometry = new osg::Geometry; osg::ref_ptrosg::Vec3Array vertices (new osg::Vec3Array()); string str_O = ; string isTri =; float x, y, z = 0.0; int f_1, f_2, f_3, f_4 = 0; ifstream File; string str_Data = /home/username/TestMesh/File.obj; File.open(str_Data.c_str(), ifstream::in); if(File.good()) { while ( File str_O) { if(str_O == v) { File x y z; vertices-push_back (osg::Vec3f ( x, -z, y)); } } geometry-setVertexArray(vertices); } else { cout Error endl; } File.close(); File.open(str_Data.c_str(), ifstream::in); if(File.good()) { cout Faces endl; while (File str_O) { if(str_O == f) { File f_1 f_2 f_3; isTri = File.get(); if(isTri != \n) { File f_4; ::osg::ref_ptr ::osg::DrawElementsUInt Face = new ::osg::DrawElementsUInt( ::osg::PrimitiveSet::QUADS, 0); Face-push_back(f_1-1); Face-push_back(f_2-1); Face-push_back(f_3-1); Face-push_back(f_4-1); geometry-addPrimitiveSet(Face); } else { ::osg::ref_ptr ::osg::DrawElementsUInt Face = new ::osg::DrawElementsUInt( ::osg::PrimitiveSet::TRIANGLES, 0); Face-push_back(f_1-1); Face-push_back(f_2-1); Face-push_back(f_3-1); geometry-addPrimitiveSet(Face); } } }
Re: [osg-users] Migration of website and version control
Hi Glenn, On Tue, Nov 1, 2011 at 11:58 AM, Glenn Waldron gwald...@gmail.com wrote: Here are some pros: Github's pull-request system is nice (as a replacement for the osg-submissions process). You can do your diff analysis right in the browser. Here's an example: http://goo.gl/KacWp Thanks for the link. I find patch syntax good for a quick look, but not sufficient for full code review. Is there any system for doing a graphical diff between the submission and the original? It could be that the later I just do manually on my local system like I do right now when I formally accept a patch. The integrated wiki is supposedly git-backed, i.e. all your wiki pages are stored in a repository alongside the source repo. So in theory migrating the existing wiki over should be a matter of pushing the files up there. (Haven't tried it though.) Pulling in a wiki would be easy if it used exactly the same wiki syntax but I very much down Tracs wiki and Gollum wiki are compatible. At best there would be a converter. Github also has an integrated issue-tracker if you decide to use it someday. Tracs has one that I never got into ;-) Never say never, but for now my priority is migrating the website, subversion - git and cdash across. Having the possibility of issue tracking is no bad thing, let sort out everything else first. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration of website and version control
On Tue, Nov 1, 2011 at 9:49 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Glenn, On Tue, Nov 1, 2011 at 11:58 AM, Glenn Waldron gwald...@gmail.com wrote: Here are some pros: Github's pull-request system is nice (as a replacement for the osg-submissions process). You can do your diff analysis right in the browser. Here's an example: http://goo.gl/KacWp Thanks for the link. I find patch syntax good for a quick look, but not sufficient for full code review. Is there any system for doing a graphical diff between the submission and the original? It could be that the later I just do manually on my local system like I do right now when I formally accept a patch. Right, it's handy for a quick look (trivial rejections for example) or for merging documentation changes. No, github does not have a conflict resolution tool. You would still bring down the pull request and do that on the client. I use TortoiseGit (Windows client) for that. The integrated wiki is supposedly git-backed, i.e. all your wiki pages are stored in a repository alongside the source repo. So in theory migrating the existing wiki over should be a matter of pushing the files up there. (Haven't tried it though.) Pulling in a wiki would be easy if it used exactly the same wiki syntax but I very much down Tracs wiki and Gollum wiki are compatible. At best there would be a converter. Github also has an integrated issue-tracker if you decide to use it someday. Tracs has one that I never got into ;-) Never say never, but for now my priority is migrating the website, subversion - git and cdash across. Having the possibility of issue tracking is no bad thing, let sort out everything else first. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer/CompositeViewer inconsistency?
Thank you for the suggestions. The problem with writing my own frame loop (I already have done that) is that I run into another strange issue with the positioning of the graphics window. I am not familiar with using custom visitors. I have already spent too much time on this so may not have time to do research on it. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43671#43671 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer/CompositeViewer inconsistency?
Hi Thomas, On Tue, Nov 1, 2011 at 3:22 PM, Thomas Lerman osgfo...@tevs.eu wrote: Thank you for the suggestions. The problem with writing my own frame loop (I already have done that) is that I run into another strange issue with the positioning of the graphics window. You have the access to the source the OSG, it's very easy to see how the Viewer::run() implementation works, and you can simply it further as you don't need to support all the options it has. It really is very straight forward. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer/CompositeViewer inconsistency?
Yeah, I have been looking at the source code quite a bit lately trying to get these things to work. I am not really sure what your are saying about the following method: Code: int Viewer::run() { if (!getCameraManipulator() getCamera()-getAllowEventFocus()) { setCameraManipulator(new osgGA::TrackballManipulator()); } setReleaseContextAtEndOfFrameHint(false); return ViewerBase::run(); } -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43673#43673 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Image pixel format conversion
I actually did check the png writing code and it supports BGRA as of OSG 3.0, however I have to support OSG 2.8 also, which does not have that pixel format yet. I did try acquiring the image from the GPU using GL_RGB but could not get it to work, so I stuck with how osgscreencapture did it. -Blake On 2011-10-31 23:58, J.P. Delport wrote: Hi, is the image coming from the GPU? If so, you can let OpenGL convert it for you on the way to CPU if you don't mind too much about transfer speed. Also, double check the image writing code if a certain format does not support BGRA. jp On 01/11/2011 02:40, Blake Mason wrote: I have a osg::image with pixel format of GL_BGRA. I need to convert it to GL_RGB so that I can write out any generic type of image with osgDB (i.e., jpg, png, tiff, etc). Is there an easy way to convert the _data in the image to be in some other format? I could obviously do this myself with a simple loop, but I wanted to see if there was a simple OSG way. writeImageFile is still commented out in the osgscreencapture.cpp example, and I wonder if it's a similar problem. ___ 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] Problems with setInfluenceMap to RigGeometry
Hi, I have two pictures where you can see the difference. RigGeometry (normal) [Image: http://s7.directupload.net/images/01/temp/iahp6pb2.png ] (http://s7.directupload.net/file/d/2695/iahp6pb2_png.htm) RigGeometry with InfluenceMap [Image: http://s1.directupload.net/images/01/temp/rrmcyovi.png ] (http://s1.directupload.net/file/d/2695/rrmcyovi_png.htm) Thank you! Cheers, Benjamin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43675#43675 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Viewer/CompositeViewer inconsistency?
On 11/01/2011 12:17 PM, Thomas Lerman wrote: Yeah, I have been looking at the source code quite a bit lately trying to get these things to work. I am not really sure what your are saying about the following method: Code: int Viewer::run() { if (!getCameraManipulator() getCamera()-getAllowEventFocus()) { setCameraManipulator(new osgGA::TrackballManipulator()); } setReleaseContextAtEndOfFrameHint(false); return ViewerBase::run(); } The last line is the key. Viewer::run() calls ViewerBase::run(). If you look at ViewerBase::run(), you'll see that it calls ViewerBase::frame() in a while (!_done) loop (along with some other ancillary stuff to handle on-demand rendering, run-to-frame control, etc). So, you could, in fact, write your own run loop like this: while (!viewer.done()) { viewer.frame(); } If you need more control than that (which it sounds like you do), you can look at ViewerBase::frame(). ViewerBase::frame() couldn't really be much simpler. Essentially, it is just: advance(); eventTraversal(); updateTraversal(); renderingTraversals(); You probably don't need to mess with the advance() step, or the renderingTraversals() call, so you can just look into the event and update passes to see where you might need to make some adjustments. Hopefully, this will help get you going in the right direction. --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] 3D models used in OSG ?
Greetings! The biggest issue that I have had with tools outside of Creator is Hierarchy! In simulation, you need to be able to control the model by using switching, level of detail, etc. I haven't seen that much in open source that addresses that issue! I'm not sure if they have addressed that in Blinder or have come up with some other way other than passing it through Creator or maybe Remo 3D to finish it! The only other way I can think of off hand is to convert a set or elements of a model to OSG format and hand jam a Hierarchy in a text editor. That is out of reach for most of the casual or intermediate modelers out there that I know of that has had exposure to Creator. ... D Glenn David Glenn --- D Glenn Computer Graphics amp; Media Systems. www.dglenn.com -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43677#43677 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org