Changing clear color in vrj::osg::App

7 views
Skip to first unread message

Kevin Godby

unread,
May 6, 2014, 9:28:33 PM5/6/14
to vrjuggler...@googlegroups.com
Hello.

I'm using the vrj::osg::App and OpenSceneGraph for my application. I'd
like to be able to change the clear color while the program is
running. What's the best way to handle this?

Thanks!

—Kevin Godby

Todd Furlong

unread,
May 7, 2014, 8:31:30 AM5/7/14
to vrjuggler...@googlegroups.com
In contextInit or another context method, do something like this:
(*sceneViewer)->setClearColor(osg::Vec4(mBGColor[0], mBGColor[1], mBGColor[2], 1.0));



—Kevin Godby

--

---
You received this message because you are subscribed to the Google Groups "vrjuggler-questions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vrjuggler-quest...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Godby

unread,
May 9, 2014, 2:42:28 PM5/9/14
to vrjuggler...@googlegroups.com
Hi, Todd.

On Wed, May 7, 2014 at 7:31 AM, Todd Furlong <furl...@gmail.com> wrote:
> In contextInit or another context method, do something like this:
> (*sceneViewer)->setClearColor(osg::Vec4(mBGColor[0], mBGColor[1],
> mBGColor[2], 1.0));

Thanks, that worked perfectly!

(I had tried that earlier but it failed due to a bug elsewhere in my
code. I was overwriting the desired color. Your post caused me to
revisit things.)

—Kevin
Reply all
Reply to author
Forward
0 new messages