Re: [osg-users] wrong calculation of bounding box
Hi John, De: John Doves evage...@gmail.com Wrong calculation a bounding box of model which contains biped or bones. I'm used this code to calculate bounding box: Code: model = (osg::Geode*) osgDB::readNodeFile(testmodel.fbx); //calculating bounding box of model osg::ComputeBoundsVisitor cbbv; model-accept(cbbv); osg::BoundingBox bb = cbbv.getBoundingBox(); osg::Vec3f sz = bb._max - bb._min; It returns double size of model which contains biped or bones. If model without biped or bones the size as expected. Does anyone have idea why so? Maybe because mixing bounding boxes and bounding spheres inflate the result. I did this diagram several month ago : http://frbouvi.free.fr/flightsim/bounding_sphere.jpg Regards, -Fred ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] bug in ShapeDrawable.cpp
Hi, void PrimitiveShapeVisitor::createCylinderBody(unsigned int numSegments, float radius, float height, const osg::Matrix matrix) has a bug.. it doesn't transform the last two points: // do last point by hand to ensure no round off errors. _functor.vertex(osg::Vec3(r,0.0f,topz)); _functor.vertex(osg::Vec3(r,0.0f,basez)); missing * matrix osg version 2.8.3 Thank you! Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43827#43827 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] bug in ShapeDrawable.cpp
Hi Peter, This bug has been fixed in 3.0.0. Thanks, Robert. On 11 November 2011 09:29, Peter Wraae Marino marino.pe...@gmail.com wrote: Hi, void PrimitiveShapeVisitor::createCylinderBody(unsigned int numSegments, float radius, float height, const osg::Matrix matrix) has a bug.. it doesn't transform the last two points: // do last point by hand to ensure no round off errors. _functor.vertex(osg::Vec3(r,0.0f,topz)); _functor.vertex(osg::Vec3(r,0.0f,basez)); missing * matrix osg version 2.8.3 Thank you! Cheers, Peter -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43827#43827 ___ 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] Stereo and Render to Texture effects
Hi Farshid, I just did a quick test and you appear to be right. SceneView.cpp ~line 1099 Changing the following: _renderStageLeft-drawPreRenderStages(_renderInfo,previous); _renderStageRight-drawPreRenderStages(_renderInfo,previous); _renderStageLeft-draw(_renderInfo,previous); _renderStageRight-draw(_renderInfo,previous); To: _renderStageLeft-drawPreRenderStages(_renderInfo,previous); _renderStageLeft-draw(_renderInfo,previous); _ _renderStageRight-drawPreRenderStages(_renderInfo,previous); _renderStageRight-draw(_renderInfo,previous); Resolves the issue, allowing me to use the same FBO for both eyes. Robert, if you're reading this, shouldn't this be the correct behaviour for quad buffered stereo or is it designed this way to be consistent with the other stereo modes? I haven't yet looked at the implications for other stereo modes. Cheers, Kim. On 10 November 2011 16:43, Kim Bale kcb...@googlemail.com wrote: Hi Farshid, Thanks for your reply. Fortunately I'm working with quad buffered stereo so I'll have a dig around in the SceneView code and see if your idea works. Cheers, K. On 10 November 2011 16:14, Farshid Lashkari fla...@gmail.com wrote: Hi Kim, On Thu, Nov 10, 2011 at 6:21 AM, Kim Bale kcb...@googlemail.com wrote: Is there a way of reusing the FBOs so that I don't need to duplicate them all for each eye? I couldn't seem to find a way of doing that without the previous data being overwritten. Which stereo mode are you using? I run into this problem a lot as well. I believe the reason the previous data gets overwritten is that osgUtil::SceneView explicitly calls RenderStage::drawPreRenderStages() on both eyes, before drawing the main render stage. You might be able to fix this by commenting out these calls and letting RenderStage::draw() take care of the prerender stages, depending on which stereo mode you are using. I believe these explicit calls are necessary for the anaglyphic and interlace stereo modes, because you wouldn't want the color/stencil mask affecting the prerender stages. However, for the split and quad buffer stereo modes, I don't believe these calls are necessary and it should be safe to comment those lines out. With a slight modification to SceneView::draw() it should be possible to get this working with anaglyphics/interlace modes as well. This is something that's been on my todo list for a while. Now might be a good time to try and tackle the issue :) Cheers, Farshid Regards, Kim. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How? Model-View space based bounding sphere for osgText::Text in OSG3.0.1
Hello OSGers! :) I am porting an application from OSG3.0.0 to OSG3.0.1. One of the reasons I am doing this is because of a well known bug with osgText::Text. In the new version of OSG this problem is fixed and the text renders perfectly. In my application I have a series of text labels (osgText::Text) attached to some nodes in my scenegraph. All these nodes combined result a bounding sphere with a radius of 25 units. The labels are configured like this: Code: osgText::Text* label = new osgText::Text; label-setDataVariance(osg::Object::DYNAMIC); label-setFont( font ); label-setCharacterSize( 22 ); label-setFontResolution( 22, 22 ); label-setColor( osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f )); label-setPosition( position ); label-setAlignment( osgText::Text::CENTER_BASE_LINE ); label-setAxisAlignment( osgText::Text::SCREEN ); label-setCharacterSizeMode( osgText::Text::SCREEN_COORDS ); // I tried OBJECT_COORDS too. It won't make any difference. label-setBackdropColor(osg::Vec4(0,0,0,1)); label-setBackdropType( osgText::Text::OUTLINE ); label-setBackdropImplementation( osgText::Text::STENCIL_BUFFER ); label-setBackdropOffset(0.2f,0.2f); label-setAutoRotateToScreen( true ); label-setText( my_label_text ); At some point in my application I wants to calculate the overall bounding sphere of my scenegraph (which only includes my model nodes with the attached labels) by calling the function osg::Node::getBound() on my root node. When I do this, the BoundingSphere I get has a huge radius, and not a radius of 25 units. Looks like OSG calculates the bounding sphere of the osgText::Text in screen space and does not map the screen space bounding sphere coordinates to the current model view space coordinates. Is there any way to do this automatically? Or somehow tell OSG not to take into consideration the osgText::Text bounding spheres when calculating the bounding sphere of the whole scenegraph? One solution I can think of is to set a custom ComputeBoundingSphereCallback and do all the calculations myself. Any other ideas? Thanks a lot for your time! Cheers, George -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43830#43830 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Stereo and Render to Texture effects
Hi Kim, The only problem I would see with this re-ordering is that if users are relying upon stereo and frame buffer based render to texture then their second render to texture pass would render over the top of the left image. Given this one would certainly have to make your suggested re-ordering optional, even if it became the default. As a general comment, I'm wanting to replace the SceneView based stereo with osgViewer based stereo using slave Camera. One of the consequences of this would be the pre render stages for each slave camera would be done right before that camera's main render stage so you'd end up the behavior you are currently looking for. For this slave Camera based approach I'd need to think about what would happen with the frame buffer based rendering to texture. Robert. On 11 November 2011 11:43, Kim Bale kcb...@googlemail.com wrote: Hi Farshid, I just did a quick test and you appear to be right. SceneView.cpp ~line 1099 Changing the following: _renderStageLeft-drawPreRenderStages(_renderInfo,previous); _renderStageRight-drawPreRenderStages(_renderInfo,previous); _renderStageLeft-draw(_renderInfo,previous); _renderStageRight-draw(_renderInfo,previous); To: _renderStageLeft-drawPreRenderStages(_renderInfo,previous); _renderStageLeft-draw(_renderInfo,previous); _ _renderStageRight-drawPreRenderStages(_renderInfo,previous); _renderStageRight-draw(_renderInfo,previous); Resolves the issue, allowing me to use the same FBO for both eyes. Robert, if you're reading this, shouldn't this be the correct behaviour for quad buffered stereo or is it designed this way to be consistent with the other stereo modes? I haven't yet looked at the implications for other stereo modes. Cheers, Kim. On 10 November 2011 16:43, Kim Bale kcb...@googlemail.com wrote: Hi Farshid, Thanks for your reply. Fortunately I'm working with quad buffered stereo so I'll have a dig around in the SceneView code and see if your idea works. Cheers, K. On 10 November 2011 16:14, Farshid Lashkari fla...@gmail.com wrote: Hi Kim, On Thu, Nov 10, 2011 at 6:21 AM, Kim Bale kcb...@googlemail.com wrote: Is there a way of reusing the FBOs so that I don't need to duplicate them all for each eye? I couldn't seem to find a way of doing that without the previous data being overwritten. Which stereo mode are you using? I run into this problem a lot as well. I believe the reason the previous data gets overwritten is that osgUtil::SceneView explicitly calls RenderStage::drawPreRenderStages() on both eyes, before drawing the main render stage. You might be able to fix this by commenting out these calls and letting RenderStage::draw() take care of the prerender stages, depending on which stereo mode you are using. I believe these explicit calls are necessary for the anaglyphic and interlace stereo modes, because you wouldn't want the color/stencil mask affecting the prerender stages. However, for the split and quad buffer stereo modes, I don't believe these calls are necessary and it should be safe to comment those lines out. With a slight modification to SceneView::draw() it should be possible to get this working with anaglyphics/interlace modes as well. This is something that's been on my todo list for a while. Now might be a good time to try and tackle the issue :) Cheers, Farshid Regards, Kim. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] wrong calculation of bounding box
hi Frederic, hmm.. How it possible? I did not mix anything I just exported from 3d studio max to fbx a model which contains mesh and biped or bones. Well I have two models one model contains only mesh and bounding box calculating as expected but if I use same model with biped the size of bounding box is wrong. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43832#43832 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Get camera X rotation angle in rads?
Hi, I wish to get the camera X rotation relative to the scene in rads, any ideas? Thank you! Cheers, Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43833#43833 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG website unresponsive
From Colorado, USA at this time. -- 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
[osg-users] using view dependent overlays
I was looking at the example osganimate and I attempted to use the --ortho option which sets the overlay technique to osgSim::OverlayNode::VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY. However, nothing is overlaid when this method is selected. My assumption is that this method should increase the resolution of the overlaid image as the viewer is zooming into the object receiving the overlay. Someone mentioned that J.P.Delport had a patch to fix this method, but I couldn't find any information on it. I also looked in the trunk and didn't see any updates related to this change. -Blake ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Saving a Texture3D to an Image
Hi, I've been banging my head against how to save a 3D texture out to a dds file for some time now. I've read posts that suggest simply attaching the texture's image to the buffer rather than the texture itself. I've done that for 2D textures with no problem. However, I don't see how that will work in this case; given the setup below. Code: ... camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera-setImplicitBufferAttachmentMask(osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT, osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT ); camera-attach(osg::Camera::COLOR_BUFFER0, tex1, 0, osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER); camera-attach(osg::Camera::COLOR_BUFFER1, tex2, 0, osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER); viewer.frame(); ... So, after I render the frame I want to be able to say Code: osgDB::writeImageFile( *tex1-getImage(), foo.dds ) But, of course, this doesn't work since the image isn't updated when the texture changes. Is there a strait forward way to get the texture data back to an image that I'm missing? Thank you! Cheers, Trystan[/code][/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43837#43837 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org