24 #include <Inventor/engines/SoElapsedTime.h>
25 #include <Inventor/nodes/SoPerspectiveCamera.h>
26 #include <Inventor/SoOffscreenRenderer.h>
27 #include <Inventor/nodes/SoDirectionalLight.h>
28 #include <Inventor/nodes/SoRotationXYZ.h>
34 SoSeparator* root =
new SoSeparator();
37 SoPerspectiveCamera* camera =
new SoPerspectiveCamera();
38 root->addChild(camera);
40 SoDirectionalLight* light =
new SoDirectionalLight();
41 root->addChild(light);
45 SbViewportRegion
const region;
46 camera->viewAll(node, region);
48 SoOffscreenRenderer offscreenRenderer(region);
49 offscreenRenderer.setComponents(SoOffscreenRenderer::Components::RGB_TRANSPARENCY);
50 offscreenRenderer.render(root);
52 QImage img(offscreenRenderer.getBuffer(), width,
53 height, QImage::Format_ARGB32);
58 return img.rgbSwapped();
63 SoSeparator* root =
new SoSeparator;
65 SoRotationXYZ* myRotXYZ =
new SoRotationXYZ;
66 root->addChild(myRotXYZ);
70 myRotXYZ->axis = SoRotationXYZ::Y;
71 SoElapsedTime* myCounter =
new SoElapsedTime;
72 myRotXYZ->angle.connectFrom(&myCounter->timeOut);