add: webInterface = new WebInterface(); webInterface->setRoot(scene);
context: int main(int argc, char **argv){    osgInit(argc,argv);    // GLUT init    glutInit(&argc, argv);        glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);        glutCreateWindow("OpenSG");        glutReshapeFunc(reshape);    glutDisplayFunc(display);    glutIdleFunc(display);    glutMouseFunc(mouse);    glutMotionFunc(motion);    glutKeyboardFunc(keyboard);    PassiveWindowPtr pwin=PassiveWindow::create();    pwin->init();           // create the texture    tx1 = TextureChunk::create();       const UInt16 width = 16, height = 1;        ImagePtr pImg1 = Image::create();    pImg1->set(Image::OSG_RGB_PF, width, height );        beginEditCP(pImg1);    UInt8 *d = pImg1->getData();        for(UInt16 y = 0; y < height; ++y)    {        for(UInt16 x = 0; x < width; ++x)        {            *d++ = static_cast<UInt8>(x * 255.f / width);            *d++ = static_cast<UInt8>(y * 255.f / height);            *d++ = static_cast<UInt8>(128);        }    }    endEditCP(pImg1);            beginEditCP(tx1);    tx1->setImage(pImg1);     tx1->setMinFilter(GL_NEAREST);    tx1->setMagFilter(GL_NEAREST);    tx1->setWrapS(GL_REPEAT);    tx1->setWrapT(GL_REPEAT);    endEditCP(tx1);    TexGenChunkPtr tg = TexGenChunk::create();        beginEditCP(tg);    tg->setGenFuncS(GL_EYE_LINEAR);    tg->setGenFuncSPlane(Vec4f(0,.15,0,0));    endEditCP(tg);          // create the material    SimpleMaterialPtr mat = SimpleMaterial::create();        beginEditCP(mat);    mat->setDiffuse(Color3f(1,1,1));    mat->setLit(false);    mat->addChunk(tx1);    mat->addChunk(tg);    endEditCP(mat);        // create the scene    NodePtr torus = makeTorus( .5, 2, 16, 32 );    GeometryPtr geo = GeometryPtr::dcast(torus->getCore());        beginEditCP(geo, Geometry::MaterialFieldMask);    geo->setMaterial(mat);    endEditCP(geo, Geometry::MaterialFieldMask);           NodePtr transn = makeCoredNode<Transform>(&trans);    beginEditCP(transn, Node::CoreFieldMask | Node::ChildrenFieldMask);    {        transn->addChild(torus);    }    endEditCP  (transn, Node::CoreFieldMask | Node::ChildrenFieldMask);    NodePtr scene = makeCoredNode<Group>();      beginEditCP(scene);    scene->addChild(transn);    endEditCP(scene);        beginEditCP(tg);    tg->setSBeacon(scene);    endEditCP(tg);        // create the SimpleSceneManager helper    mgr = new SimpleSceneManager;    // create the window and initial camera/viewport    mgr->setWindow(pwin );    // tell the manager what to manage    mgr->setRoot  (scene);        // show the whole scene    mgr->showAll();    mgr->redraw();        // GLUT main loop    glutMainLoop();    return 0;}