Re: [osg-users] Offscreen snapshot.
Thanks for the replay. It doesn't work for me. It seems that there are some side effects: when I add the slave camera the screenshot from the main camera stop to work. I tried also with a composite viewer but... no: it doesn't work. Anyway: thanks fot the suggestion. I'll study more carefully the example. Bye Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39648#39648 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Offscreen snapshot.
Hi, On 20/05/11 12:27, Giulio De Vecchi wrote: Hi all, I have a viewer from wihch i take some snapshot. The code is something like this: r_Viewer = new osgViewer::Viewer(); r_Viewer-setSceneData(p_RootNode); p_hWND = reinterpret_castHWND (wnd); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits(); traits-inheritedWindowData = new osgViewer::GraphicsWindowWin32::WindowData( p_hWND ); [...] // some init stuff [...] osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext (traits.get()); osg::ref_ptrosg::Camera camera = r_Viewer-getCamera(); camera-setGraphicsContext (gc.get()); camera-setViewport (...); camera-setProjectionMatrixAsPerspective (...); p_ScreenShot = new osg::Image; camera-attach(osg::Camera::COLOR_BUFFER, p_ScreenShot); [...] r_Viewer-frame(); // Note that i call frame() on demand. [...] p_ScreenShot-readPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE); This last call should not be needed, because if you attach the image to the camera OSG does the readPixels for you. If you want to manually read pixels you will have to do it in the camera callback so that the context is current. jp This work fine. The question is: what if i need to take an offscreen screenshot? In particular I need to take a snapshot of the same scene from a different point of view, but without render it. Is this possible? Thank you. Best regards. Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39594#39594 ___ 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
[osg-users] Vec4Array for vertex array and the MatrixTransform transform is no longer applied.
Hi, I need to save an osg/ive file using 4 components for vertex positions (x y z and 1.0 for w). I need this so the texgen planes work correctly (if I omit w, for some strange reason, the texture gen planes no longer apply correctly). The problem now is that the matrix transform is no longer applied. Is like OSG is considering my positions already transformed. Is this is a know issue? Please refer to the attached file for an example of an OSG file. It contains 3 LOD for 2 terrain meshes. The vertex positions are 4D (with w == 1). As you can see both meshes are placed in the origin (one above another) as their matrix transform is no longer applied. For exactly the same file if .w is not present, the matrices are applied but my texgen planes no longer work as expected. Thank you! Cheers, Adrian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39650#39650 Attachments: http://forum.openscenegraph.org//files/osg_177.zip ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] model placing using osgdem
Yes, but I meant that you could load your VPB model as usual, but use osgEarth just to render just the buildings and features. Glenn Waldron / Pelican Mapping / @glennwaldron On Mon, May 23, 2011 at 11:56 PM, Vijeesh Theningaledathil vije...@nal.res.in wrote: Hi Glenn Waldron But will osgearth can render the terrain at 60Hz. The terrain is required for a flight simulator. so the timing is very important. ... Thank you! Cheers, Vijeesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39645#39645 ___ 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] Offscreen snapshot.
Hi, I removed the manual call to readPixel and now... it works! Thank you very much. Cheers, Giulio -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39656#39656 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgexport for blender?
I have been plugging away at this script and have a much better version now. See attached. It works well for my simple tests - but I don't have many example models to try. Animations are supported as well as textures (either image or generated). It does not support animated materials like the old script does (mainly because I don't know how to create them in blender). If you have problems and want to report a bug - including the model will be a big help. I would still class this script as unstable - mainly because I haven't done too much testing - but if you have problems I'm willing to try and fix them. Cheers, Damyon -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39657#39657 Attachments: http://forum.openscenegraph.org//files/osgexport_no_mercurial_20100515_r2tar_145.gz ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg Widget image transparent
On Mon, 2011-05-23 at 19:02 +0200, daniele argiolas wrote: Hi, is there a way to put a semitransparent image in a widget? I build my widget as: Code: widget = new osgWidget::Widget(imageSrc,notifySize[0],notifySize[1]); widget-setColor(1.0,1.0,1.0,1.0); widget-setImage(imageSrc); widget-setSize(notifySize); widget-setTexCoord(0.0f, 0.0f, osgWidget::Widget::LOWER_LEFT); widget-setTexCoord(1.0f, 0.0f, osgWidget::Widget::LOWER_RIGHT); widget-setTexCoord(1.0f, 1.0f, osgWidget::Widget::UPPER_RIGHT); widget-setTexCoord(0.0f, 1.0f, osgWidget::Widget::UPPER_LEFT); widget-setAlignHorizontal(osgWidget::Widget::HA_CENTER); widget-setAlignVertical(osgWidget::Widget::VA_CENTER); widget-setLayer(osgWidget::Widget::LAYER_TOP ); You're doing everything right except one small thing, which I will be changing in future versions of osgWidget. The transparency is working, but the background widget of the Window you put your Widget in is probably full white. So: Window-getBackground()-setColor(0, 0, 0, 0); ...and you should be good. :) imageSrc is a PNG transparent file, but I can't see the trasparence. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39637#39637 ___ 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 Widget image transparent
On Mon, 2011-05-23 at 19:02 +0200, daniele argiolas wrote: Hi, is there a way to put a semitransparent image in a widget? I build my widget as: Code: widget = new osgWidget::Widget(imageSrc,notifySize[0],notifySize[1]); widget-setColor(1.0,1.0,1.0,1.0); widget-setImage(imageSrc); widget-setSize(notifySize); widget-setTexCoord(0.0f, 0.0f, osgWidget::Widget::LOWER_LEFT); widget-setTexCoord(1.0f, 0.0f, osgWidget::Widget::LOWER_RIGHT); widget-setTexCoord(1.0f, 1.0f, osgWidget::Widget::UPPER_RIGHT); widget-setTexCoord(0.0f, 1.0f, osgWidget::Widget::UPPER_LEFT); widget-setAlignHorizontal(osgWidget::Widget::HA_CENTER); widget-setAlignVertical(osgWidget::Widget::VA_CENTER); widget-setLayer(osgWidget::Widget::LAYER_TOP ); I should also mention that if you call: -setImage(imageSrc, true) ...you will not need to manually call setTexCoord(). imageSrc is a PNG transparent file, but I can't see the trasparence. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39637#39637 ___ 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] osgexport for blender?
Thanks a lot . testing -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39660#39660 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Texture2DMultisample test code?
On 5/22/2011 2:49 PM, Paul Martz wrote: Hi all -- I've recently backported the Texture2DMultisample support to the 2.8 branch and was wondering if anyone had any simple test code they could share that tests the functionality? A re-post: I'd really appreciate community help to get the 2.8.5 release out the door. If you have some small test code that uses Texture2DMultisample, I'd really appreciate it if this could be submitted to trunk (currently there are no examples that use this feature), or sent to me offline (if it needs to remain non-public). Thanks! -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] replacing models at runtime
Hi, so basicaly i want to replace the models at runtime i have a node callback visitor that traverse a loaded model and in certains conditions replace the child nodes with something like this : osg::Node* _node = findNode(test); _Node = osgDB::readNodeFile(myfile.ive); but this have no effect thanks and good day[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39664#39664 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] replacing models at runtime
On 5/24/2011 9:28 AM, issam boughanmi wrote: so basicaly i want to replace the models at runtime i have a node callback visitor that traverse a loaded model and in certains conditions replace the child nodes with something like this : osg::Node* _node = findNode(test); _Node = osgDB::readNodeFile(myfile.ive); but this have no effect _node is a local pointer. You're only changing what _node points to. Elsewhere, the scenegraph is still pointing to what _node originally pointed to. You need to find the parent of _node, because it has a child pointer pointing to whatever _node originally pointed to. Then you need to remove that child, and then add the result of readNodeFile. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] replacing models at runtime
yes this is what i have done + setting the actual node mask to 0x0 but i was thinking that there is a better method anyway thanks for your help -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39667#39667 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Performace issue with nVidia 400 series
mrohn wrote: Hi, now we discovered that the fps drop down is related to the two sided lightning. If we disable the support for the two sided lightning we have the expected performance. But this is not a really good solution for us. Is there any assumption why this happens? ... Thank you! Cheers, Michael Greetings: Well, I checked the code and unless it is changed someware else by defalt the setting for dubble sided lighting in LightModel.ccp is set to false. Any arguments to the contrary? D Glenn D Glenn (a.k.a David Glenn) - Moving Heaven and Earth! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39669#39669 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Maya2OSG patches
Hello all, I've attached small patches to two issues I've found with Maya2OSG. One allows it to build successfully with the current 2.8 branch - there are some manipulators not available in this branch so we just disable them by checking the osg version. The other issue was ambiguity in calling inTolerance, preventing me from building successfully on VC9 x64. I solved this two different ways: take your pick of which way you prefer. - I've made inTolerance a template function with a single parameter type and explicitly specified the template parameter in the one case. (fix-vc9-build) - inTolerance is a template function with three parameter types, and static_casts all arguments to the type of the tolerance parameter before doing math. This one doesn't require explicit template param specification, and seems more correct to me, or at least more explicit in how it works. I personally prefer this one. (alternate-fix-build) These patches were made against the latest svn trunk of maya2osg using tortoisesvn. Ryan -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com maya2osg-alternate-fix-build.patch Description: Binary data maya2osg-fix-vc9-build.patch Description: Binary data maya2osg-fix-osg28.patch 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] Maya2OSG patches
Hi Ryan, Thank you for the patches. Can you send the whole files instead of patches, please? You can zip all files together to make it easy. Thank you! Best Regards, On Tue, May 24, 2011 at 7:28 PM, Ryan Pavlik rpav...@iastate.edu wrote: Hello all, I've attached small patches to two issues I've found with Maya2OSG. One allows it to build successfully with the current 2.8 branch - there are some manipulators not available in this branch so we just disable them by checking the osg version. The other issue was ambiguity in calling inTolerance, preventing me from building successfully on VC9 x64. I solved this two different ways: take your pick of which way you prefer. I've made inTolerance a template function with a single parameter type and explicitly specified the template parameter in the one case. (fix-vc9-build) inTolerance is a template function with three parameter types, and static_casts all arguments to the type of the tolerance parameter before doing math. This one doesn't require explicit template param specification, and seems more correct to me, or at least more explicit in how it works. I personally prefer this one. (alternate-fix-build) These patches were made against the latest svn trunk of maya2osg using tortoisesvn. Ryan -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] 2.8.5 wrappers and osgconv
Hi Ryan -- I just wanted to alert you that the 2.8 branch now contains some changes that will likely break the wrappers: Texture2DMultisample support (you'll probably need to add support for this new StateAttribute) and some changes to osgText. If you could provide updated wrappers, that would be great. Thanks! Also, you mentioned some additional changes to osgconv. I'm still waiting on those. The only other work to be done is the 3ds backport, and I understand that's in progress, so hopefully done soon. We're vary close to a release candidate. -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Virtual Planet Builder
Hi, i'm new @ vpb.. i was trying to install vpb0.9.10 on ubuntu10.10 when i make then it shows following errors bhishek@abhishek-T12Eg:~/VirtualPlanetBuilder$ make Scanning dependencies of target vpb [ 3%] Building CXX object src/vpb/CMakeFiles/vpb.dir/BuildLog.o [ 6%] Building CXX object src/vpb/CMakeFiles/vpb.dir/BuildOperation.o [ 9%] Building CXX object src/vpb/CMakeFiles/vpb.dir/BuildOptions.o [ 12%] Building CXX object src/vpb/CMakeFiles/vpb.dir/BuildOptionsIO.o [ 15%] Building CXX object src/vpb/CMakeFiles/vpb.dir/Commandline.o [ 18%] Building CXX object src/vpb/CMakeFiles/vpb.dir/DatabaseBuilder.o [ 21%] Building CXX object src/vpb/CMakeFiles/vpb.dir/DatabaseBuilderIO.o [ 24%] Building CXX object src/vpb/CMakeFiles/vpb.dir/DataSet.o [ 27%] Building CXX object src/vpb/CMakeFiles/vpb.dir/Date.o [ 30%] Building CXX object src/vpb/CMakeFiles/vpb.dir/Destination.o [ 33%] Building CXX object src/vpb/CMakeFiles/vpb.dir/ExtrudeVisitor.o [ 36%] Building CXX object src/vpb/CMakeFiles/vpb.dir/FileCache.o [ 39%] Building CXX object src/vpb/CMakeFiles/vpb.dir/FileDetails.o [ 42%] Building CXX object src/vpb/CMakeFiles/vpb.dir/FileUtils.o [ 45%] Building CXX object src/vpb/CMakeFiles/vpb.dir/FilePathManager.o [ 48%] Building CXX object src/vpb/CMakeFiles/vpb.dir/GeospatialDataset.o [ 51%] Building CXX object src/vpb/CMakeFiles/vpb.dir/HeightFieldMapper.o [ 54%] Building CXX object src/vpb/CMakeFiles/vpb.dir/MachinePool.o [ 57%] Building CXX object src/vpb/CMakeFiles/vpb.dir/ObjectPlacer.o [ 60%] Building CXX object src/vpb/CMakeFiles/vpb.dir/PropertyFile.o /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp: In constructor ‘vpb::FileProxy::FileProxy(const std::string)’: /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp:51: error: ‘S_IREAD’ was not declared in this scope /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp:51: error: ‘S_IWRITE’ was not declared in this scope make[2]: *** [src/vpb/CMakeFiles/vpb.dir/PropertyFile.o] Error 1 make[1]: *** [src/vpb/CMakeFiles/vpb.dir/all] Error 2 make: *** [all] Error 2 abhishek@abhishek-T12Eg:~/VirtualPlanetBuilder$ can you help me ? waiting for reply. Thank you! Cheers, abhishek -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39672#39672 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Virtual Planet Builder
On 5/24/2011 12:19 PM, abhishek agarwal wrote: Hi, i'm new @ vpb.. i was trying to install vpb0.9.10 on ubuntu10.10 when i make then it shows following errors /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp: In constructor ‘vpb::FileProxy::FileProxy(const std::string)’: /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp:51: error: ‘S_IREAD’ was not declared in this scope /home/abhishek/VirtualPlanetBuilder/src/vpb/PropertyFile.cpp:51: error: ‘S_IWRITE’ was not declared in this scope make[2]: *** [src/vpb/CMakeFiles/vpb.dir/PropertyFile.o] Error 1 make[1]: *** [src/vpb/CMakeFiles/vpb.dir/all] Error 2 make: *** [all] Error 2 abhishek@abhishek-T12Eg:~/VirtualPlanetBuilder$ It is possible that your Ubuntu headers don't define S_IREAD, because it's a deprecated symbol: http://www.gnu.org/s/hello/manual/libc/Permission-Bits.html There may be a define you can invoke to re-enable it. Also, it might be smart if VPB's source was changed to refer to the current synonym, apparently S_IRUSR. I could be off here, but that's my take on it. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Maya2OSG patches
The changes to osgpreview.cpp are for the first issue, while the changes to utility.h are for the second way of solving the second issue. Ryan On Tue, May 24, 2011 at 12:59 PM, Javier Taibo javier.ta...@gmail.comwrote: Hi Ryan, Thank you for the patches. Can you send the whole files instead of patches, please? You can zip all files together to make it easy. Thank you! Best Regards, On Tue, May 24, 2011 at 7:28 PM, Ryan Pavlik rpav...@iastate.edu wrote: Hello all, I've attached small patches to two issues I've found with Maya2OSG. One allows it to build successfully with the current 2.8 branch - there are some manipulators not available in this branch so we just disable them by checking the osg version. The other issue was ambiguity in calling inTolerance, preventing me from building successfully on VC9 x64. I solved this two different ways: take your pick of which way you prefer. I've made inTolerance a template function with a single parameter type and explicitly specified the template parameter in the one case. (fix-vc9-build) inTolerance is a template function with three parameter types, and static_casts all arguments to the type of the tolerance parameter before doing math. This one doesn't require explicit template param specification, and seems more correct to me, or at least more explicit in how it works. I personally prefer this one. (alternate-fix-build) These patches were made against the latest svn trunk of maya2osg using tortoisesvn. Ryan -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com /** Maya2OSG - A toolkit for exporting Maya scenes to OpenSceneGraph Copyright (C) 2010-2011 Javier Taibo javier.ta...@gmail.com This file is part of Maya2OSG. Maya2OSG is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Maya2OSG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Maya2OSG. If not, see http://www.gnu.org/licenses/. */ // This is previewer is a modified version of OSG application osgviewer #include osgpreview.h #include version.h #include maya/MArgList.h #include maya/MStringArray.h #include osg/Version #include osgDB/ReadFile #include osgUtil/Optimizer #include osg/CoordinateSystemNode #include osg/Switch #include osgText/Text #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgGA/TrackballManipulator #include osgGA/FlightManipulator #include osgGA/DriveManipulator #include osgGA/KeySwitchMatrixManipulator #include osgGA/StateSetManipulator #include osgGA/AnimationPathManipulator #include osgGA/TerrainManipulator #if OSG_MIN_VERSION_REQUIRED(2,9,5) #include osgGA/OrbitManipulator #include osgGA/SphericalManipulator #endif void* OSGPreview::creator() { return new OSGPreview(); } MStatus OSGPreview::doIt( const MArgList args ) { MStringArray argStringArray; for( unsigned int i = 0 ; i args.length() ; ++i ) { argStringArray.append( args.asString( i ) ) ; } int argc = args.length() + 1; char **argv = (char **)malloc(argc * sizeof(char *)); argv[0] = osgpreview; argStringArray.get(argv+1); osg::ArgumentParser arguments(argc, argv); osgViewer::Viewer viewer(arguments); unsigned int helpType = 0; if ((helpType = arguments.readHelpType())) { arguments.getApplicationUsage()-write(std::cout, helpType); return MStatus::kFailure; } // report any errors if they have occurred when parsing the program arguments. if (arguments.errors()) { arguments.writeErrorMessages(std::cout); return MStatus::kFailure; } if (arguments.argc()=1) { arguments.getApplicationUsage()-write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); return MStatus::kFailure; } std::string url, username, password; while(arguments.read(--login,url, username, password)) { if
Re: [osg-users] Maya2OSG patches
Thanks for the fixes. Changes are now committed to svn trunk. About the second issue, it seems a much complicated piece of code for what it's doing. I suggest this lighter and cleaner alternative instead of a template with three different typename parameters and the huge expression with four static_cast. #define inTolerance(base, match, tolerance) ( osg::absolute((base)-(match)) tolerance ) However, this part of the code was written by Peter Particle, so I'll redirect to him both proposals. Meanwhile, can you test if it is working for you right now? Regards, On Tue, May 24, 2011 at 11:08 PM, Ryan Pavlik rpav...@iastate.edu wrote: The changes to osgpreview.cpp are for the first issue, while the changes to utility.h are for the second way of solving the second issue. Ryan On Tue, May 24, 2011 at 12:59 PM, Javier Taibo javier.ta...@gmail.com wrote: Hi Ryan, Thank you for the patches. Can you send the whole files instead of patches, please? You can zip all files together to make it easy. Thank you! Best Regards, On Tue, May 24, 2011 at 7:28 PM, Ryan Pavlik rpav...@iastate.edu wrote: Hello all, I've attached small patches to two issues I've found with Maya2OSG. One allows it to build successfully with the current 2.8 branch - there are some manipulators not available in this branch so we just disable them by checking the osg version. The other issue was ambiguity in calling inTolerance, preventing me from building successfully on VC9 x64. I solved this two different ways: take your pick of which way you prefer. I've made inTolerance a template function with a single parameter type and explicitly specified the template parameter in the one case. (fix-vc9-build) inTolerance is a template function with three parameter types, and static_casts all arguments to the type of the tolerance parameter before doing math. This one doesn't require explicit template param specification, and seems more correct to me, or at least more explicit in how it works. I personally prefer this one. (alternate-fix-build) These patches were made against the latest svn trunk of maya2osg using tortoisesvn. Ryan -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Javier Taibo ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org