Robert Osfield schrieb:
HI Andreas,
Nice to see the plugin work coming along. The
setUpViewerAsEmbeddedInWindow calls tricks the viewer into thinking
that it has a valid graphics context, but in reality the
GraphicsWindowEmbedded that this call creates is just a non op for all
makeCurrent/swapBuffer calls, which means the viewer itself can't do
these operations. This scheme only works when you have one context
per viewer and run the viewer single threaded, and the app that calls
viewer.frame() creates it's own graphics context and makes it current,
and does the swap buffers call itself.
The Embedded functionality of osgViewer does make it extremely easy to
graft an viewer into an code that provides the graphics context, but
it is limiting - you won't be pbuffer support, or any
multi-window/context support, nor threading support, but for a browser
this possible isn't to much of an issue as you aren't likely to be
drive a full blow simulation from a browser.
To get get the full capabilities of osgViewer then using the window
inheritance features of osgViewer would be the way forward - here
you'd like the browser provide the parent widget that osgViewer will
create it's own OpenGL GraphicsContext within. This is typically more
awkward to code as you have to go get the native window handle, but if
this is possible then you should be able to code up a solution similar
to the osgviewerMFC example.
Robert.
Hi Robert,
in my opinion those web-plugins should function as a "teaser" making
people think: That looks cool, lets try the application. Thus the
embedded-functionality will be enough for me.
I am now packaging the plugin and encounter a problem: The plugin starts
(meaning that the core osg-dlls are found), but it does not find the
osg-plugins (I have removed osg from my path for testing reasons).
Usually when you start an osg-application and put the plugins into the
applicaiton-folder (or below into the correct plugin-folder) they are
found. Maybe this is different here, as the plugin itself is not an
application but a dll.
Any idea how I could trick the osg to make it find the plugins? The
problem is that I can run the plugin in firefox only, it´s hard to debug
there.
Regards,
Andreas
On Thu, Dec 4, 2008 at 8:32 PM, Andreas Goebel <[EMAIL PROTECTED]> wrote:
Hi all,
as posted above in the thread "reading a node file from http", I have
assembled a small firefox-plugin to display osg-files.
It is not yet "packed", I will have to carefully read the documentation on
how to do this (I would like the plugin to be downloaded automatically when
a user does not have it).
If someone would like to try it:
- it´s windows only, firefox 3.04 only (newer versions should work)
- you must have osg2.7.6 installed, bin-dir in your path. The plugin is
compiled with VC 2005, so maybe only this will work
- download the plugin here: http://raumgeometrie.de/testplugin/npbasic.dll
(it´s so small, not even worth zipping)
- testpages here: http://www.raumgeometrie.de/testplugin/gallery.html
I attach the source to the plugin. But be aware of the fact, that the most
time-consuming step of building this plugin was to get the basic-example I
started with to compile. I will send a zip with project-file later on.
Note that the sample-plugins shipped with the firefox-source do use
completely different function-names than those described in the plugin-api
that can be read on the firefox-dev site. I sticked to the functions named
in the sample (and had to research with google for some things). I don´t
know if their own samples are outdated, or if the api-documentation is
outdated or whatever.
The thing that does not (!) work is to put several instances of the plugin
on one page. Maybe robert can jump in and explain how the
window = viewer->setUpViewerAsEmbeddedInWindow(100,100,800,600);
viewer->setSceneData(loadedModel.get());
(which works like next to magic for me)
does find it´s OpenGL-context. Probably this is not so easy when there is
more than one context.
But even if this won´t work, it´s quite a nice plugin so far. Read the
source as an inspiration on how very easy this was - hopefully someone can
jump in and do this for linux and mac.
Regards,
Andreas
_______________________________________________
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