[osg-users] Rendering of 3d model over the video stream

74 views
Skip to first unread message

Kataev Victor

unread,
Jun 6, 2011, 11:57:23 AM6/6/11
to osg-...@lists.openscenegraph.org
I use OSG of augmented reality and use setRenderBin() for 3D model to be above the video stream like in OSG Art but it doesn`t work) I think the problem is in large amount of textures properties and stateSet but I cann`t find documentation for them.

Could you please send me some code which solve this task?

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

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

Robert Osfield

unread,
Jun 7, 2011, 1:44:58 AM6/7/11
to osg-...@lists.openscenegraph.org
Hi Kataev,

On Mon, Jun 6, 2011 at 4:57 PM, Kataev Victor <victo...@list.ru> wrote:
> I use OSG of augmented reality and use setRenderBin() for 3D model to be above the video stream like in OSG Art but it doesn`t work) I think the problem is in large amount of textures properties and stateSet but I cann`t find documentation for them.
>
> Could you please send me some code which solve this task?

Sorry... the OSG has plenty of examples, no need to write your
application code for you. Have a look at osghud, and instead of
having the HAD render after the main scene, set the RenderOrder to
PRE_RENDER so it draws first, this way you can just leave the 3D scene
as it is.

Robert.

Kataev Victor

unread,
Jun 8, 2011, 8:56:38 AM6/8/11
to osg-...@lists.openscenegraph.org
Thanks for reply!

I connected the camera, which returns createHud to osgViewer, Hud has been successfully drawn over the 3D-model, but when i change POST_RENDER to PRE_RENDER, an image of 3D-model (simple pyramid) among an empty space entirely overlaps Hud

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=40212#40212

Robert Osfield

unread,
Jun 8, 2011, 9:12:16 AM6/8/11
to osg-...@lists.openscenegraph.org
Hi Kataev? Victor? Could you sign with the name you'd like to be
addressed as it's difficult to guess.

On Wed, Jun 8, 2011 at 1:56 PM, Kataev Victor <victo...@list.ru> wrote:
> I connected the camera, which returns createHud to osgViewer, Hud has been successfully drawn over the 3D-model, but when i change POST_RENDER to PRE_RENDER, an image of 3D-model (simple pyramid) among an empty space entirely overlaps Hud

The main Camera will be clearing the colour buffer and depth buffer
before it draws, so what you need to do is disable the clear of the
colour buffer. The osghud example shoes this for the HUD camera which
is the overlay, you just need to apply this to the main viewer's
Camera or what ever Camera you are using for the main 3D scene.

Robert.

Reply all
Reply to author
Forward
0 new messages