On Mon, Jan 30, 2012 at 2:48 PM, Jesper D. Thomsen <[email protected]> wrote:
> Hi guys,
>
>
>
> I have what may be a little bit of an unusual question regarding usage of
> OpenSceneGraph.
> In our application we use OSG for drawing views of a dynamically created and
> animated model, which has so far worked out very well for us.
>
> We are now in the situation where we would like to be able to interface with
> various CAD packages and be able to show our model inside them. A number of
> CAD packages support this by allowing plugins to render OpenGL calls within
> the host CAD programs viewports (so that the viewport can contain the
> combined contents of the plugin drawing and elements from the host CAD
> program).
>
> I am wondering if I can somehow use our existing setup for generating these
> OpenGL calls directly from OSG. Would it somehow be possible to “draw” to a

> kind of OpenGL call buffer rather than directly to a drawing context from
> OpenSceneGraph. I guess that there’s no code in OSG which can do this
> directly, but I was thinking that it might be possible to create a
> substitution for GraphicsWindow32 where I could catch the OpenGL calls being
> generated, and then transfer them to a plugin in the CAD program from there.
OSG makes OpenGL calls ;-) The issue is running OSG in a situation
where it is not in control of creating and managing the graphics
context. To get started, take a look at the examples like osgviewerSDL
that set up the viewer as an "embedded window."
>
> I do however see some possible issues where OSG is aware of the exact stage
> of the OpenGL setup, and I would somehow have to flush this when generating
> the OpenGL call stack.
Yes, that is the issue. It can be done with some careful use of
callbacks in the scene graph. In your situation, you need to be
careful to be in the expected state when OSG rendering starts, and
leave it in the state expected by the CAD program when OSG finishes
up.

Tim
>
>
>
> Regards, and thanks in advance.
>
>
>
> Jesper D. Thomsen
>
> AnyBody Technology
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to