Hi,

I am trying to implement the 3D overlay above current view. I am trying to
set the camera background color as transparent. I am using following code.

osg::Node* node= osgDB::readNodeFile( "Models/cessna.osg");
osg::Camera* camera = new osg::Camera;
camera->setViewport( 0, 0, 200, 200 );
camera->setClearColor(osg::Vec4(1.0f,1.0,0.8f,0.2f));
osg::StateSet* stateset = camera1->getOrCreateStateSet();
stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
camera->setStateSet(stateset);
camera->setRenderOrder( osg::Camera::POST_RENDER );
camera->setAllowEventFocus( true );
camera->setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
camera->addChild( node1 );


Above code only set the white background. Please help to set the camera
backgroud color as transparent.

Thanks
Vishwa
---------- Forwarded message ----------
From: shekhar vishwa <vishwa.shek...@gmail.com>
Date: Sat, Jun 2, 2012 at 5:00 PM
Subject: Set Viewport background color as transparent
To: osg-users@lists.openscenegraph.org


Hi,

I am using the OSG, but I unable to set the viewport or view backgraund
color as transparent.

Please help me to resolve this issue.

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

Reply via email to