Hi Doug,

How exactly is this library drawing the video? Is it feeding the video data
into a texture, and applying that texture onto a simple quad? If so, it
seems like the best approach would be to use the osg::TexMat class to
transform the texture coordinates of the quad to simulate a zooming in
effect. Either way, it's difficult to say what is going wrong without
knowing more about how this library works.

Cheers,
Farshid

On Thu, Mar 15, 2012 at 1:01 PM, Doug Domke <doug.do...@boeing.com> wrote:

> Hi,
>
> We have an OSG-based application that uses a 3rd party library to draw
> video.  We want my application to perform a "digital zoom" on this video.
>  Given the API to this library, we wrote an OSG node with a draw callback
> that calculates the viewport for the video to draw in, and lets the library
> do its magic.
>
> My theory for the "digital zoom" feature is to give the library a larger
> viewport (it always draws the same scene into the viewport) and
> cull/clip/stencil the result.  My current attempt is in using a glStencil
> in the draw callback as follows:
>
>
> Code:
> glEnable(GL_STENCIL_TEST);
> glClear(GL_STENCIL_BUFFER_BIT);
> glStencilFunc(GL_ALWAYS, 1, 1);
> glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
> glBegin(GL_QUADS);
> glVertex2d(left, bottom);
> glVertex2d(left, top);
> glVertex2d(right, top);
> glVertex2d(right, bottom);
> glEnd();
> glStencilFunc(GL_EQUAL, 1, 1);
> <draw video>
> glDisable(GL_STENCIL_TEST);
>
>
>
> Unfortunately, the video ends up disappearing entirely.  If I remove the
> Code:
> glEnable(GL_STENCIL_TEST);
>
>  line, the video draws in the larger viewport and overlaps areas that it
> shouldn't.
>
> Can anyone identify a flaw in my code?  Is there another approach that may
> be better?
>
> Thank you!
> -Doug[/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46318#46318
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to