Hi,
I'm developing an augmented reality application for iPad. I'm using
OpenSceneGraph to render the 3D objects over the camera view.
My code is based on the view_test iPhone example given with the sources on
Github, so we can discuss my problem from this exemple.
I wish to set the background of the OSG Viewer transparent, so we can see the
UIView behind (which contains the iPad camera preview layer in my application,
that works well).
To be clear, say that in the view_test exemple, I change the background color
of the view in FlipsideViewController.mm
Code:
- (void)viewDidLoad {
...
self.view.backgroundColor = [UIColor redColor];
...
}
Then, I wish to see this red color as background for my 3D scene (the box)
instead of the default blue background.
My intuition was to change the clearColor to black with the alpha channel set
to 0 :
Code:
_viewer->getCamera()->setClearColor(osg::vec4(0.0f, 0.0f, 0.0f, 0.0f));
The background is black as expected, but the alpha value is not considered (as
if it was always 1.0f).
Any ideas?
Thanks!
Cheers,
Jeremy
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44055#44055
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org