Hello,

I'm new to OSG and WPF (though I've read quite a view tutorials the past 2 
weeks) so I hope I don't ask too many stupid questions :)

Task
I have to program something very similar to a CAD-program. The program should 
be able to load files (stl-files) and you should be able to manipulate the 
model in different ways, selecting triangles, points, cutting, ...
For the visualisation of the models and functionality I chose OSG since it 
seems to offer quite a lot and is pretty fast. (Also it has a reader for 
stl-files ;) )
The UI has to be made with WPF. So basically the "OSG-window" should be 
controlled via menus, buttons, mouse and keyboard-input.

What I found out
For the past view days I've researched this matter and found only a few 
tutorials on msdn and codeproject. But if I got that right the way to do the 
integration is:
- C++: create a class ("OpenGLHwnd") that inherits from HwndHost
- C++: create a window (or a dialog, but dialog didn't work for me) 
- C++: attach the viewer with the window (code taken from this site "... 
.NET-control ...")
- C++: compile the whole thing as managed dll (/clr)
- C#/WPF: use the dll and attach an instance of the class as child in a 
placeholder

In the OpenGLHwnd-class I have to override BuildWindowCore, DestroyWindowCore, 
OnRenderSizeChanged and OnRender.

Status
Well, I just set up the whole thing and tried to make the "OpenGL"-window fit 
in the WPF-application. In this "OpenGL"-Window I just try to display two 
pyramids using OSG.

My Problem
If I use "normal" OpenGL-commands everything is displayed, but if I use the 
viewer, somehow not only the WPF-window is opened, but also an additional 
fullscreen window which shows the pyramids. I don't seem to get the window out 
of the fullscreen mode and fit in the WPF-application.

My Questions
Well, can anyone give me some advise to fix the problem? Or can someone tell me 
if the way I want to integrate OSG in WPF is right, because it seems pretty 
much like a bad "workaround" to me ^^;
Are there any tutorials on this matter? (I've looked at the osgDotNetDemo from 
hesicong.net, but it doesn't work -> applicationcan't be initialized)

I hope everything is understandable since english is not my mother tounge.

Thank you in advance!

Cheers,
Martin

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to