26 #include <Inventor/SoOffscreenRenderer.h>
27 #include <Inventor/engines/SoElapsedTime.h>
28 #include <Inventor/nodes/SoDirectionalLight.h>
29 #include <Inventor/nodes/SoPerspectiveCamera.h>
30 #include <Inventor/nodes/SoRotationXYZ.h>
35 SoSeparator* root =
new SoSeparator();
38 SoPerspectiveCamera* camera =
new SoPerspectiveCamera();
39 root->addChild(camera);
41 SoDirectionalLight* light =
new SoDirectionalLight();
42 root->addChild(light);
46 SbViewportRegion
const region;
47 camera->viewAll(node, region);
49 SoOffscreenRenderer offscreenRenderer(region);
50 offscreenRenderer.setComponents(SoOffscreenRenderer::Components::RGB_TRANSPARENCY);
51 offscreenRenderer.render(root);
53 QImage img(offscreenRenderer.getBuffer(), width, height, QImage::Format_ARGB32);
58 return img.rgbSwapped();
64 SoSeparator* root =
new SoSeparator;
66 SoRotationXYZ* myRotXYZ =
new SoRotationXYZ;
67 root->addChild(myRotXYZ);
71 myRotXYZ->axis = SoRotationXYZ::Y;
72 SoElapsedTime* myCounter =
new SoElapsedTime;
73 myRotXYZ->angle.connectFrom(&myCounter->timeOut);