Chris Hidden | 21 Oct 16:20 2014

Low frame rate ( Update Callback on 50 bones ).

Hey everyone.

I've come a far way since my last post.  Our application is reading sensor data from the Leap Motion and we are
interpreting this data and using OSG to display the hand models on scene.  The issue now is that running on my
laptop I get a tops of 20 fps.  On other computers with lower specs the fr is abysmal.

The way its set up right now is that we load the fbx model of a hand and traverse through its nodes.  If it finds a
bone and if it is one of the bones we want to affect we attach an updateCallback.  The update callback queries
our data for a new position and the position is updated using a matrix and then the new position is set: 

Code:

osg::ref_ptr<osgAnimation::Bone>	bone			= dynamic_cast<osgAnimation::Bone*>(node);
	
	if (bone)
	{
		ref_ptr<osgAnimation::Bone>	parent				= bone->getBoneParent();
		const osg::Matrix&			matrix				= _transforms.getMatrix();
		_transforms.update					();
		setBoneOrientations					();
		setLocalMatrices					        ();
		setLocalTranslationsAndRotations	(parent, &matrix);
		
	
		
		

		if (parent)
			bone->setMatrixInSkeletonSpace(fingerSpace * fingerTranslation * parent->getMatrixInSkeletonSpace());
	}
(Continue reading)

Carlos Sanches | 21 Oct 13:53 2014
Picon

osgEarth SkyNode code setup

Hello !
How do I have to setup the SkyNode by code?

Thanks

--
 
<div><div dir="ltr">
<div>
<div>Hello !<br>
</div>How do I have to setup the SkyNode by code?<br><br>
</div>Thanks<br clear="all"><div><div><div><div><div><div>
<br>-- <br>&nbsp;<br>
</div></div></div></div></div></div>
</div></div>
Damian Stewart | 21 Oct 04:25 2014
Picon

Re: Issue with StateSet::setUpdateCallback and Drawable

Hi,

I didn't get a response to the above questions, so I'm hoping it was just missed due to my post awaiting moderation.

It seems like the Drawable StateSet problem is one a lot of people would run into, but I've not found any other
mention of it, so possibly I'm just missing something or doing something the wrong way.

Anyone able to shed some light on my questions please?

Thanks,
Damian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61344#61344

Roy Arents | 17 Oct 15:57 2014
Picon

Re: Transparent Window Application

Hi Chris Erghis,

Thank you for explaining your solution. 
I'm trying to achieve something similar, but cannot get it work just yet. Is it possible to share you source completely?
Did you manage to work out the FBO? If not, I sould be albe to help you with that.

Thank you!

Cheers,
Roy

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61332#61332

Wang xin | 17 Oct 10:04 2014

Re: Which one is beeter in volume rending, VTK or osgVolume?

Hi,

Recently,I have recived a task of volume rending.It's about DICOM data rending.
I am a freshman of this field. 
I know that VTK and osgVolume both provide the function.
So,I wanna ask which one is better in volume rending? 

Thank you!

Cheers,
Wang

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61330#61330

Glen | 17 Oct 05:20 2014

Web browser crash when OSGEarth loading large model

Hello All,

      Now I’m doing the work of wrapping OSGEarth into ActiveX control which is to be placed inside a web page. I use the framework of FireBreath to implement this task. But I encounter some strange problems as follows:

Development Environment: Visual Studio 2012, Windows 8.1, IE 11, OSG 3.2.0, OSGEarth 2.5

1.     I created an new FireBreath project to wrap OSGEarth into ActiveX control, compiled with Release mode. When I open the web page with this ActiveX control, the earth can be displayed normally. when the model data ( larger than 100 M ) is loaded progressively, the web browser will crash. I tied to load a small model ( about 5M ), the browser will not crash.  Then I tried to use osgearth_viewer to load the data, it will not crash too. It seems that the browser can’t hold too much memory. Any solution?

Main source code is as follows,

 

bool OsgWeb::onWindowAttached(FB::AttachedEvent* evt, FB::PluginWindow* win)

{

    FB::PluginWindowWin* window = reinterpret_cast<FB::PluginWindowWin*>(win);

    if ( window )

    {

       osgViewer::GraphicsWindowWin32::WindowData* windata = new osgViewer::GraphicsWindowWin32::WindowData(

           window->getHWND() );

       // This works under Windows only

       osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;

       traits->x = 0;

       traits->y = 0;

       traits->width = window->getWindowWidth();

       traits->height = window->getWindowHeight();

       traits->windowDecoration = false;

       traits->doubleBuffer = true;

       traits->sharedContext = 0;

       traits->setInheritedWindowPixelFormat = true;

 

       traits->inheritedWindowData = windata;

 

       osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext( traits.get() );

       osg::ref_ptr<osg::Camera> camera = new osg::Camera;

       camera->setGraphicsContext( gc );

       camera->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) );

       camera->setClearMask( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );

       camera->setClearColor( osg::Vec4f(0.2f, 0.2f, 0.6f, 1.0f) );

       camera->setProjectionMatrixAsPerspective(30.0f, (double)traits->width/(double)traits->height, 1.0, 1000.0 );

 

       _viewer.setCamera( camera.get() );

      

       _viewer.setKeyEventSetsDone( 0 );

 

       //Tell the database pager to not modify the unref settings

       _viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy( false, false );

 

       // install our default manipulator (do this before calling load)

       _viewer.setCameraManipulator( new osgEarth::Util::EarthManipulator() );

 

       // load an earth file, and support all or our example command-line options

       // and earth file <external> tags

       int argc = 1;

       char *argv[] = {"E:\\Software\\OSG\\OSGEarth\\tests\\vertical_datum.earth"};

       osg::ArgumentParser arguments(&argc,argv);

       osg::Node* node = osgEarth::Util::MapNodeHelper().load( arguments, &_viewer );

       if ( node )

       {

           _viewer.setSceneData( node );

 

           // configure the near/far so we don't clip things that are up close

           _viewer.getCamera()->setNearFarRatio(0.00002);

           _viewer.getCamera()->setSmallFeatureCullingPixelSize(-1.0f);

 

           //_viewer.run();

       }

       _thread = new RenderingThread;

       _thread->viewerPtr = &_viewer;

       _thread->start();

    }

    return false;

}

 

class RenderingThread : public OpenThreads::Thread

{

public:

    RenderingThread() : OpenThreads::Thread(), viewerPtr(NULL) {}

   

    virtual ~RenderingThread();

   

    virtual void run();

   

    osgViewer::Viewer* viewerPtr;

};

 

RenderingThread::~RenderingThread()

{

    if ( viewerPtr ) viewerPtr->setDone( true );

    while( isRunning() )

    OpenThreads::Thread::YieldCurrentThread();

}

 

void RenderingThread::run()

{

    if ( !viewerPtr ) return;

    do

    {

       viewerPtr->frame();

    }

    while ( !testCancel() && !viewerPtr->done() );

    viewerPtr = NULL;

}

 

2.     When I debug the sourcecode, the error occurs on the statement.  traits->inheritedWindowData = windata;

Obviously this statement has nothing to do with loading model data. Why it has different problem between release mode and debug mode?

 

Every Guru, Please help me to solve these two problem.

 

Thanks you all in advance!

 

Best regards

 

Glen

<div><div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello All,<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Now I&rsquo;m doing the work of wrapping OSGEarth into ActiveX control which is to be placed inside a web page. I use the framework of FireBreath to implement this task. But I encounter some strange problems as follows:<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">Development Environment: Visual Studio 2012, Windows 8.1, IE 11, OSG 3.2.0, OSGEarth 2.5<p></p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US">I created an new FireBreath project to wrap OSGEarth into ActiveX control, compiled with Release mode. When I open the web page with this ActiveX control, the earth can be displayed normally. when the model data ( larger than 100 M ) is loaded progressively, the web browser will crash. I tied to load a small model ( about 5M ), the browser will not crash. &nbsp;Then I tried to use osgearth_viewer to load the data, it will not crash too. It seems that the browser can&rsquo;t hold too much memory. Any solution?<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">Main source code is as follows,<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">bool</span><span lang="EN-US"> OsgWeb::onWindowAttached(FB::AttachedEvent* evt, FB::PluginWindow* win)<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">{<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; FB::PluginWindowWin* window = </span><span lang="EN-US">reinterpret_cast</span><span lang="EN-US">&lt;FB::PluginWindowWin*&gt;(win);<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">if</span><span lang="EN-US"> ( window )<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; {<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osgViewer::GraphicsWindowWin32::WindowData* windata = </span><span lang="EN-US">new</span><span lang="EN-US"> osgViewer::GraphicsWindowWin32::WindowData(<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window-&gt;getHWND() );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">// This works under Windows only</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osg::ref_ptr&lt;osg::GraphicsContext::Traits&gt; traits = </span><span lang="EN-US">new</span><span lang="EN-US"> osg::GraphicsContext::Traits;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;x = 0;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;y = 0;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;width = window-&gt;getWindowWidth();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;height = window-&gt;getWindowHeight();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;windowDecoration = </span><span lang="EN-US">false</span><span lang="EN-US">;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;doubleBuffer = </span><span lang="EN-US">true</span><span lang="EN-US">;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;sharedContext = 0;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;setInheritedWindowPixelFormat = </span><span lang="EN-US">true</span><span lang="EN-US">;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; traits-&gt;inheritedWindowData = windata;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osg::ref_ptr&lt;osg::GraphicsContext&gt; gc = osg::GraphicsContext::createGraphicsContext( traits.get() );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osg::ref_ptr&lt;osg::Camera&gt; camera = </span><span lang="EN-US">new</span><span lang="EN-US"> osg::Camera;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;setGraphicsContext( gc );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;setViewport( </span><span lang="EN-US">new</span><span lang="EN-US"> osg::Viewport(0, 0, traits-&gt;width, traits-&gt;height) );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;setClearMask( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;setClearColor( osg::Vec4f(0.2f, 0.2f, 0.6f, 1.0f) );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;setProjectionMatrixAsPerspective(30.0f, (</span><span lang="EN-US">double</span><span lang="EN-US">)traits-&gt;width/(</span><span lang="EN-US">double</span><span lang="EN-US">)traits-&gt;height, 1.0, 1000.0 );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.setCamera( camera.get() );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.setKeyEventSetsDone( 0 );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">//Tell the database pager to not modify the unref settings</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.getDatabasePager()-&gt;setUnrefImageDataAfterApplyPolicy( </span><span lang="EN-US">false</span><span lang="EN-US">, </span><span lang="EN-US">false</span><span lang="EN-US"> );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">// install our default manipulator (do this before calling load)</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.setCameraManipulator( </span><span lang="EN-US">new</span><span lang="EN-US"> osgEarth::Util::EarthManipulator() );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">// load an earth file, and support all or our example command-line options</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">// and earth file &lt;external&gt; tags</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">int</span><span lang="EN-US"> argc = 1;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">char</span><span lang="EN-US"> *argv[] = {</span><span lang="EN-US">"E:\\Software\\OSG\\OSGEarth\\tests\\vertical_datum.earth"</span><span lang="EN-US">};<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osg::ArgumentParser arguments(&amp;argc,argv);<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osg::Node* node = osgEarth::Util::MapNodeHelper().load( arguments, &amp;_viewer );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">if</span><span lang="EN-US"> ( node )<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.setSceneData( node );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">// configure the near/far so we don't clip things that are up close</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.getCamera()-&gt;setNearFarRatio(0.00002);<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _viewer.getCamera()-&gt;setSmallFeatureCullingPixelSize(-1.0f);<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">//_viewer.run();</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _thread = </span><span lang="EN-US">new</span><span lang="EN-US"> RenderingThread;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _thread-&gt;viewerPtr = &amp;_viewer;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _thread-&gt;start();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; }<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">return</span><span lang="EN-US"> </span><span lang="EN-US">false</span><span lang="EN-US">;<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">}</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">class</span><span lang="EN-US"> RenderingThread : </span><span lang="EN-US">public</span><span lang="EN-US"> OpenThreads::Thread<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">{<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">public</span><span lang="EN-US">:<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; RenderingThread() : OpenThreads::Thread(), viewerPtr(NULL) {}<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">virtual</span><span lang="EN-US"> ~RenderingThread();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">virtual</span><span lang="EN-US"> </span><span lang="EN-US">void</span><span lang="EN-US"> run();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; <p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; osgViewer::Viewer* viewerPtr;<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">};</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">RenderingThread::~RenderingThread()<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">{<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">if</span><span lang="EN-US"> ( viewerPtr ) viewerPtr-&gt;setDone( </span><span lang="EN-US">true</span><span lang="EN-US"> );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">while</span><span lang="EN-US">( isRunning() )<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; OpenThreads::Thread::YieldCurrentThread();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">}<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">void</span><span lang="EN-US"> RenderingThread::run()<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">{<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">if</span><span lang="EN-US"> ( !viewerPtr ) </span><span lang="EN-US">return</span><span lang="EN-US">;<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">do</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; {<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; viewerPtr-&gt;frame();<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; }<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span><span lang="EN-US">while</span><span lang="EN-US"> ( !testCancel() &amp;&amp; !viewerPtr-&gt;done() );<p></p></span></p>
<p class="MsoNormal" align="left"><span lang="EN-US">&nbsp;&nbsp;&nbsp; viewerPtr = NULL;<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US">}</span><span lang="EN-US"><p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><span>2.<span>&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US">When I debug the sourcecode, the error occurs on the statement. &nbsp;traits-&gt;inheritedWindowData = windata; <p></p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">Obviously this statement has nothing to do with loading model data. Why it has different problem between release mode and debug mode?<p></p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">Every Guru, Please help me to solve these two problem.<p></p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">Thanks you all in advance!<p></p></span></p>
<p class="MsoListParagraph"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards<p></p></span></p>
<p class="MsoNormal"><span lang="EN-US"><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span lang="EN-US">Glen<p></p></span></p>
</div></div>
夏清然 Xia Qingran | 16 Oct 17:06 2014
Picon

Android OSG crashed in libcurl of multi-thread

Hi,

I am developing a new app based on OSG 3.2.1.

For better download speed, I used a multi-threaded by following code in JNI:

==================
void OsgMainApp::loadModels() {
    if (_vModelsToLoad.size() == 0)
        return;

    osg::notify(osg::ALWAYS) << "There are " << _vModelsToLoad.size()
            << " models to load" << std::endl;

    _vTileInfoList.clear();

    downloadCacheXMl();
    _vTileInfoList = loadDataFromCacheXML();

    osgViewer::Viewer::Windows windows;
    _viewer->getWindows(windows);
    for (osgViewer::Viewer::Windows::iterator itr = windows.begin();
            itr != windows.end(); ++itr) {
        (*itr)->getState()->setUseModelViewAndProjectionUniforms(true);
        (*itr)->getState()->setUseVertexAttributeAliasing(true);
    }

    _manipulator->getNode();
    _viewer->home();

    _viewer->getDatabasePager()->clear();
    _viewer->getDatabasePager()->registerPagedLODs(_root.get());
    _viewer->getDatabasePager()->setUpThreads(3, 2);
    _viewer->getDatabasePager()->setTargetMaximumNumberOfPageLOD(2);
    _viewer->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true, true);
=====================

I set the   _viewer->getDatabasePager()->setUpThreads(3, 2); , but it often crashed.
However if I set _viewer->getDatabasePager()->setUpThreads(3, 2);, it is running smoothly.

Here is the crash call stack:
********** Crash dump: **********
Build fingerprint: 'Xiaomi/lcsh92_wet_jb9/lcsh92_wet_jb9:4.2.2/JDQ39/JHDCNBH37.0:user/release-keys'
pid: 22182, tid: 22479, name: Thread-9008  >>> osg.AndroidExample <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
Stack frame I/DEBUG   (22507):     #00  pc 00000000  <unknown>: Unable to open symbol file D:\mobile\workspace\osgViewer\obj\local\armeabi-v7a\/<unknown>. Error (22): Invalid argument
Stack frame I/DEBUG   (22507):     #01  pc 00481887  /data/app-lib/osg.AndroidExample-1/libosgNativeLib.so (osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&, osgDB::Options const*) const+630): Routine osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&, osgDB::Options const*) const at Z:/Code/OpenSceneGraph-3.2.1/src/osgPlugins/curl/ReaderWriterCURL.cpp:604
========================

How to solve this problem ? Thanks.
<div><div dir="ltr">
<div>
<div>Hi,<br><br>
</div>I am developing a new app based on OSG 3.2.1.<br><br><span tabindex="-1" class="" lang="en"><span class="">For better</span> <span class="">download speed</span><span>, I used</span> <span class="">a multi-threaded</span> <span class="">by following code in JNI:<br><br>==================<br>void OsgMainApp::loadModels() {<br>&nbsp;&nbsp;&nbsp; if (_vModelsToLoad.size() == 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br><br>&nbsp;&nbsp;&nbsp; osg::notify(osg::ALWAYS) &lt;&lt; "There are " &lt;&lt; _vModelsToLoad.size()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;&lt; " models to load" &lt;&lt; std::endl;<br><br>&nbsp;&nbsp;&nbsp; _vTileInfoList.clear();<br><br>&nbsp;&nbsp;&nbsp; downloadCacheXMl();<br>&nbsp;&nbsp;&nbsp; _vTileInfoList = loadDataFromCacheXML();<br><br>&nbsp;&nbsp;&nbsp; osgViewer::Viewer::Windows windows;<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getWindows(windows);<br>&nbsp;&nbsp;&nbsp; for (osgViewer::Viewer::Windows::iterator itr = windows.begin();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; itr != windows.end(); ++itr) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (*itr)-&gt;getState()-&gt;setUseModelViewAndProjectionUniforms(true);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (*itr)-&gt;getState()-&gt;setUseVertexAttributeAliasing(true);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; _manipulator-&gt;getNode();<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;home();<br><br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;clear();<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;registerPagedLODs(_root.get());<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;setUpThreads(3, 2);<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;setTargetMaximumNumberOfPageLOD(2);<br>&nbsp;&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;setUnrefImageDataAfterApplyPolicy(true, true);<br>=====================<br><br></span></span>
</div>
<span tabindex="-1" class="" lang="en"><span class="">I set the</span></span><span tabindex="-1" class="" lang="en"><span class="">&nbsp;&nbsp; _viewer-&gt;getDatabasePager()-&gt;setUpThreads(3, 2); , but it often crashed.</span></span><br>However if I set <span tabindex="-1" class="" lang="en"><span class=""> _viewer-&gt;getDatabasePager()-&gt;setUpThreads(3, 2);, it is running smoothly.<br><br></span></span><div>Here is the crash call stack:<br>********** Crash dump: **********<br>Build fingerprint: 'Xiaomi/lcsh92_wet_jb9/lcsh92_wet_jb9:4.2.2/JDQ39/JHDCNBH37.0:user/release-keys'<br>pid: 22182, tid: 22479, name: Thread-9008&nbsp; &gt;&gt;&gt; osg.AndroidExample &lt;&lt;&lt;<br>signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000<br>Stack frame I/DEBUG&nbsp;&nbsp; (22507):&nbsp;&nbsp;&nbsp;&nbsp; #00&nbsp; pc 00000000&nbsp; &lt;unknown&gt;: Unable to open symbol file D:\mobile\workspace\osgViewer\obj\local\armeabi-v7a\/&lt;unknown&gt;. Error (22): Invalid argument<br>Stack frame I/DEBUG&nbsp;&nbsp; (22507):&nbsp;&nbsp;&nbsp;&nbsp; #01&nbsp; pc 00481887&nbsp; /data/app-lib/osg.AndroidExample-1/libosgNativeLib.so (osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&amp;, osgDB::Options const*) const+630): Routine osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&amp;, osgDB::Options const*) const at Z:/Code/OpenSceneGraph-3.2.1/src/osgPlugins/curl/ReaderWriterCURL.cpp:604<br>========================<br><br>
</div>
<div>How to solve this problem ? Thanks.<br clear="all">
</div>
<div><div>
<div><br></div>
<div>Regards<br>
</div>
<div>&#22799;&#28165;&#28982;<br>Xia Qingran<br><a href="mailto:qingran.xia@...">qingran.xia@...</a><br><a href="http://www.qingran.net">http://www.qingran.net</a>
</div>
</div></div>
</div></div>
Trajce Nikolov NICK | 16 Oct 15:55 2014
Picon

osgText and languages

Hi community,

what are the steps to have different characters (language, like russian for example) working with osgText?

Thanks a bunch!

Nick

--
trajce nikolov nick
<div><div dir="ltr">Hi community,<div><br></div>
<div>what are the steps to have different characters (language, like russian for example) working with osgText?</div>
<div><br></div>
<div>Thanks a bunch!</div>
<div><br></div>
<div>Nick<br clear="all"><div><br></div>-- <br>trajce nikolov nick<br>
</div>
</div></div>
Hauck Robert | 16 Oct 14:27 2014
Picon

Depth Buffer/Culling Problem with osgViewer CompositeViewer

Hi all

I have a strange problem I cannot solve. I use OpenSceneGraph 3.2.1, osgEarth 2.6 and Equalizer (parallel
rendering framework).

When I load a sample osgEarth file, I should have a sky and the earth. But I only get one of these, depending on
how I set the depth buffer and culling options.

I can for example set
_camera->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
on the osg camera, then I can get the earth model when I enable the logarithmic buffer from osgEarth with
osgEarth::Util::LogarithmicDepthBuffer logDepth;
logDepth.install(_camera);

When i don't enable this log buffer, I get the sky, a simple sky model from osgEarth, but it flickers (black
and the sky), and it shows when I use the mouse to move around. (osgViewer)

When I don't set the DO_NOT_COMPUTE_NEAR_FAR, I always get a black screen (black because I disabled
GL_COLOR_BUFFER_BIT, otherwise would be the osg blue).

I also tried to set near far planes to 0.1, 100 or 0.1, 100000, but also with no result.

I know I could ask this also in osgEarth forums, but I think it's something I have to set on the osg camera, view
or somwhere there, as it is more related to OSG and Equalizer.

What could I do to resolve this? And on what all is it depending? Buffers, Culling, Frustum etc?

Thanks,
Rob
Alex Malygin | 16 Oct 06:58 2014
Picon

Help please. How to get the intersection point with the line?

Hi,

I have a few lines on stage. I need to get the coordinates of points on the line when you click on it. Please help
to solve this problem. Can someone faced with similar?

Thank you!

Cheers,
Alex

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61318#61318

Trajce Nikolov NICK | 15 Oct 15:47 2014
Picon

underline fonts

Hi Community,

any clue how to load fonts (or set) with underlined characters?

Thanks a bunch,
Nick

--
trajce nikolov nick
<div><div dir="ltr">Hi Community,<div><br></div>
<div>any clue how to load fonts (or set) with underlined characters?</div>
<div><br></div>
<div>Thanks a bunch,</div>
<div>Nick<br clear="all"><div><br></div>-- <br>trajce nikolov nick<br>
</div>
</div></div>

Gmane