Re: [osg-users] OSG and WPF Questions

2009-07-30 Thread Brian Stewart
Hi Martin,

I replied to your message earlier, but I thought I would post my experience 
here for the benefits of those reading this thread down the line:

What I did was create a WinForms Control that hosts the OSG window. Look for 
examples (theres a good one on CodeProject I think) of integrating WPF and 
OpenGL. OSG will be the same. This is necessary because WPF uses HWNDs only for 
the top-level window - everything below is DirectX. But a WinForms control has 
an HWND, and WPF has an interoperability feature where it can host WinForms 
controls. 

There are limitations however - principally that transparent WPF popup windows 
(used for messages, menus, etc) do not show up properly over the OSG window 
under XP on most NVIDIA graphics cards (non-Quadro cards), according to NVIDIA. 
One possible workaround would be to have OSG render to a texture and then blit 
that to a WPF canvas. I have been intending to do this - but have not gotten 
around to it yet.  Currently I just structured my menus to avoid the overlap.

I should also mention that it is useful to crank up the OSG render loop during 
the initialization of the control - not at construction, IIRC.

There are a few other hurdles, like having to use the dispatcher to update WPF 
UI widgets, when the update originates from OSG - but these type of threading 
issues are to be expected in this type of app anyway. A lot of my daily pain 
comes from having to drill a piece of information down through several layers 
of code (abstraction layers for threading and for the managed/native 
transition) to get from the UI to the OSG render loop, which is again, to be 
expected. I have found a couple of issues with events, such as WPF not passing 
drag events (that originated from outside the app) down to OSG - which I dealt 
with by handling the events at the WinForms level, and then drilling down the 
mouse drag info to my OSG render loop.

Best of luck,
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Custom EventHandlers and Manipulator problem

2009-06-30 Thread Brian Stewart
Hi,

I am using a combination of osg manipulators (fly, drive, etc.) with a 
KeySwitchManipulator. After these are set up, I have several tools which can 
be loaded at runtime, and each of them can register event handler callbacks for 
things like mouse up and mouse down. These handlers are working correctly, 
except the motion model manipulators furnished by osg are still getting the 
events, despite the fact that the handlers return true indicating the event was 
handled. So when you click and drag a building, for example, the view will 
rotate and spin in an undesirable fashion. 

I ran across a thread 
(http://forum.openscenegraph.org/viewtopic.php?t=2544highlight=return+manipulator)
 from back in May 2009  where Robert said:


 In OSG-1.x events were not passed on if handled. 
 
 In OSG-2.x events are passed on to all manipulators/event handlers and 
 it's the event handlers responsibility to decide whether they want to 
 ignore handled events or not. This approach is more flexible and 
 robust once you now about if (handled) trick. 
 


So what I am wondering is, what is the correct way to keep the built-in 
manipulators from responding to these handled events? I know about using the 
following code in custom maniuplators:

Code:
if (ea.getHandled()) return false; 



But what about with the built-in ones? And does the order in which the event 
handlers are registered affect anything?

I am using OSG 2.6.1 with MS Visual Studio 2008 on Vista-64.

Thank you!

Cheers,
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] MatrixManipulator::home(double) doesn't seem to work

2009-06-14 Thread Brian Stewart
Hi,

I am trying to reset my viewer's position in response to an external UI event 
using the home(double) function on MatrixManipulator, but to no avail. The call 
to setHomePosition() is working correctly, as I can hit the spacebar, and it 
takes me to the proper location. The online page for MatrixManipulator does not 
say what the double parameter does, but a comment in the code says it is the 
current time. I tried passing in viewer-elapsedTime() and then I tried 0.0 - 
and neither seemed to work. On digging through the code, it appears that 
KeyswitchMatrixManipulator does not actually implement this function (at least 
in my version of OSG - 2.6.1). I then tried getting the current 
MatrixManipulator from it and calling home(double) directly on that - still 
with no effect. 

Am I doing something wrong? Is there a better way to set the view to a desired 
location and orientation? Is this a bug that's been fixed in a more recent 
version?

Thank you!

Cheers,
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Outline Effect traversal crash

2009-05-22 Thread Brian Stewart
Hi Maciej,

Thank you for the example. It seems to be a lot faster than what I was doing 
earlier.  Before when a node was selected, I removed it from its parent, 
created an osgFX::Scribe effect and placed it under the parent, and then 
reattached my node under that. But there was a slight delay between when the 
node disappeared, and when it reappeared selected. Because the nodes are 
buildings placed on geo-specific high-resolution imagery, this had the curious 
effect of make the building appear to be push into the terrain temporarily, 
and then spring back into position with the Scribe effect applied. 

Thanks for the links to the post and to the cel-shading article - those helped 
a lot! I did have one question about the  new selection method you 
demonstrated. It makes the building appear to be all white, since the texture 
is turned off. Is this correct? I tried disabling that part of the code, but 
now the backfaced outlines are not enough to make the object stand out. What I 
would really like to do is outline the object in a striking color (say bright 
yellow, or something) and then render the textured object with a slight cast if 
the same color.  Is this possible in OSG? I have searched though the archives, 
but without a lot of success yet. Just a pointer to some techniques that might 
work, or to a forum thread I missed would be a great help!


Thank you!

Cheers,
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Outline Effect traversal crash

2009-05-21 Thread Brian Stewart
Hi Robert,

Thanks for that clarification, as my understanding of where nodes should be 
added and removed was exactly backwards.  I did paraphrase my code extensively, 
because there was a lot of unrelated code - but I guess I didn't include 
enough. I went to create a simpler example using osgcompositeviewer as a 
starting point, when I noticed that it is doing exactly the same thing that I 
am trying to, only in the handle() function of osgaGA::GUIEventHandler, which 
is called during the event traversal of frame(). When you said it's best to 
avoid modifying the scenegraph during a traversal, did that specifically mean 
the Update Traversal, when NodeCallbacks are called, and that modifications in 
event callbacks are OK?

Thank you!

Cheers,
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Outline Effect traversal crash

2009-05-21 Thread Brian Stewart
Hi,

I switched my code around to where the model was being added from the main loop 
rather than the update traversal, and it was still crashing. On closer 
examination I noticed that the crashes were occurring during the render 
traversal, so I began to suspect the effect itself. When I replaced the effect 
with an instance of osgFX::Scribe, then everything worked correctly. So 
something was amiss in the Outline effect itself. I was using it only because I 
did not know about the Scribe effect, which is better for my purposes anyway.

Thank you!

Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Outline Effect traversal crash

2009-05-20 Thread Brian Stewart
Hi,

I am trying to implement a mechanism by which selected objects in my scene are 
highlighted. Searching the forum I found a reference to the Outline effect (an 
implementation of osgFX::Effect)  on Ulrich Hertlein's web site 
(http://www.sandbox.de/osg/), and I have attempted to integrate it into our app 
- however, most of the time, whenever the object which is outlined first comes 
into view, the app crashes in osg::NodeCallback::traverse, because the 
_nestedCallback member is corrupted. This is on Windows Vista-64, running OSG 
2.6.1 built with Visual Studio 2008, in Debug mode. We are running OSG 
multithreaded, and all my code setting up the effect is called from 
osg::NodeCallback::operator() on the render thread. The general flow is as 
follows:


Code:

osg::NodeCallback::operator()
{
   osg::PositionAttitudeTransform* modelTransform; // local transform to 
position the model in the world
   osg::Node* someChild; // some model
   osg::ref_ptrosgFX::Effect fxNode = new osgFX::Outline();
   fxNode-addChild( someChild );
   modelTransform-addChild( fxNode.get() );
}




Am I missing something obvious? If not, ideas or debugging strategies would 
also be greatly appreciated!

Thank you!
Brian

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] What is everyone doing for GUIs?

2009-05-18 Thread Brian Stewart
Hi,

We are using WPF, which is Windows-only, of course. We have a thin layer 
written in C++/CLI that wraps our code that uses OSG.

Brian Stewart

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] SGI declares bankruptcy (UNCLASSIFIED)

2009-04-02 Thread Brian Stewart
So sad. I had the first Indigo that would digitize video back in '92, and later 
on I had an Onyx in my house for about a year. It did use a lot of electricity 
though... This certainly wasn't a surprise, but I will miss them.

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Blue Marble Map

2009-03-10 Thread Brian Stewart
Hi Albert,
I just did a project with the Blue Marble Next Generation data (BMNG), and I
just loaded the jpg tiles and used them to texture polygons. The BMNG data
set goes from -180,-90 to 180,90, and there are 5 rows by 10 columns in the
base set, and each set beyond that doubles the rows and columns, making for
pretty easy math.
Brian


On Tue, Mar 10, 2009 at 1:06 PM, Albert osgfo...@tevs.eu wrote:

 Hello all,

 I was curious if anyone out there knows a site where I can download a
 geo-referenced version of the blue marble map.  I was looking for the
 preprocessed version (not yet converted to an OSGA file).

 Best Regards,

 Albert

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





 ___
 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] WPF and OpenGL popup window problem

2009-03-04 Thread Brian Stewart
Hi,

I have developed an application where I have an OSG window embedded in a 
windows application built with WPF. On certain Geforce cards there seems to be 
a bug where WPF popup windows (like menus) that have AllowTransparency set to 
true do not draw correctly over my OSG window. Basically whenever the 
OSG/OpenGL window updates, it overwrites all overlapping pixels, even if the 
popup is higher in the window manager's Z-order. I have isolated it to an issue 
with the OpenGL driver. It only occurs on Geforce cards, not Quadro cards 
(which is not surprising, since I've read the Geforce cards were optimized for 
DirectX). I'm not so much looking for a fix (though one would be welcome) - I'm 
just wondering if anyone else has encountered this. I have already filed a bug 
report with nvidia, and it might help if I could report that others are having 
issues with it too (or maybe I really am the only person out there foolish 
enough to try this). If anyone is interested, I can supply a small 
 test project that uses WPF and OpenGL together to demonstrate the problem. 

Thanks!

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] msvc90 dependencies

2008-12-02 Thread Brian Stewart
Hi Mattias,
I have been meaning to do exactly what you have done, but have not gotten
around to it. According to Microsoft, if your libraries have only plain C
interfaces, and don't use STL internally, then you can get away with mixing
libraries from different versions of their compiler. When I quickly looked
over the third party libs for OSG they all seemed to be C (but I could have
easily missed something), except for maybe the input device one, which we
don't use, so we just used the VS8 third party libs while building OSG for
VS9. But I have been meaning to get around to building everything for VS9,
just to be safe. Are your binaries built with _SCL_SECURE=0 and
_HAS_ITERATOR_DEBUGIING=0? This would only apply to C++ third party libs,
but as J-S pointed out, it does cause binary incompatibilities, similar to
those caused by mixing /MT and /MD binaries. We turn these two features off
for performance reasons, and we recently discovered that boost 1.36.0 now
hardwires them to off - so anyone linking with this version (or I assume a
later version as well) of boost would need to build OSG and their own code
with these two features disabled as well.

On Mon, Dec 1, 2008 at 7:33 PM, Mattias Helsing [EMAIL PROTECTED] wrote:

 Hi all,

 I have seen in recent posts that people aren't aware of my set of
 prebuilt binaries for vc90. It is here:


 http://www.openscenegraph.org/projects/osg/wiki/Community/People/MattiasHelsing

 It has been there since early sept.

 A few people have requested that it be linked to from the win32
 dependencies wiki page but I have refrained from poking Robert about
 this since I know that Mike has a plan for msvc90. Until then the link
 may be a good idea.

 cheers
 Mattias
 ___
 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] Exception invalid lock sequence thrown from OSG App

2008-11-10 Thread Brian Stewart
I have an application that is built against OpenSceneGraph (2.6.1). The
application initializes and begins to run, but then I get the following
exception attempt was made to execute an invalid lock sequence in
OpenGL32.dll. When I re-run it, I sometimes get this exception, and
sometimes an exception about a privileged instruction. The call stack
looks like it is corrupted, so I can't really tell exactly where the
exception is being thrown from. I ran the app quite a bit a couple of days
ago and never saw this behavior. Since then I have added an else clause to a
couple of ifs, and that is all. My app is a console application, is built
with Visual Studio 2008, and it sets OpenScenGraph to SingleThreaded mode.
Anybody seen this before? Any debugging tips?

Thanks
Brian Stewart
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org