--You received this message because you are subscribed to the Google Groups "coin3d-discuss" group.To unsubscribe from this group and stop receiving emails from it, send an email to coin3d-discus...@googlegroups.com.For more options, visit https://groups.google.com/d/optout.
Writing 5 frames...
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 150 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 25
Current serial number in output stream: 28
#include <Inventor/SoDB.h>
#include <Inventor/SoOffscreenRenderer.h>
#include <Inventor/engines/SoInterpolateVec3f.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoDirectionalLight.h>
#include <Inventor/nodes/SoPerspectiveCamera.h>
#include <Inventor/nodes/SoSeparator.h>
#include <iostream>
int main()
{
// Init Coin
SoDB::init();
// The root node
SoSeparator * root = new SoSeparator;
root->ref();
// It is mandatory to have at least one light for the offscreen renderer
SoDirectionalLight * light = new SoDirectionalLight;
root->addChild(light);
// It is mandatory to have at least one camera for the offscreen renderer
SoPerspectiveCamera * camera = new SoPerspectiveCamera;
SbRotation cameraRotation = SbRotation::identity();
cameraRotation *= SbRotation(SbVec3f(1, 0, 0), -0.4f);
cameraRotation *= SbRotation(SbVec3f(0, 1, 0), 0.4f);
camera->orientation = cameraRotation;
root->addChild(camera);
// Something to show... A box
SoCube * cube = new SoCube;
root->addChild(cube);
// Set up the two camera positions we want to move the camera between
SoInterpolateVec3f * interpolate = new SoInterpolateVec3f;
interpolate->input0 = SbVec3f(2, 2, 9);
interpolate->input1 = SbVec3f(2, 2, 5);
camera->position.connectFrom(&interpolate->output);
// Set up the offscreen renderer
SbViewportRegion vpRegion(400, 300);
SoOffscreenRenderer offscreenRenderer(vpRegion);
// How many frames to render for the video
int frames = 5;
std::cout << "Writing " << frames << " frames..." << std::endl;
for (int i = 0; i < frames; i++) {
// Update the camera position
interpolate->alpha = float(i) / (frames - 1);
// Render the scene
SbBool ok = offscreenRenderer.render(root);
// Save the image to disk
SbString filename = SbString("coinvideo-") + (i + 1) + ".jpg";
if (ok) {
offscreenRenderer.writeToFile(filename.getString(), "jpg");
} else {
std::cout << "Error saving image: " << filename.getString() << std::endl;
break;
}
}
std::cout << "Done!" << std::endl;
root->unref();
return 0;
Writing 5 frames...
Coin info in CoinOffscreenGLCanvas::getMaxTileSize(): cc_glglue_context_max_dimensions()==[0, 0]
Coin info in CoinOffscreenGLCanvas::setWantedSize(): killing current context, (clamped) reqsize==[256, 256], previous size==[0, 0], resourcehog==FALSE
Coin info in CoinOffscreenGLCanvas::tryActivateGLContext(): Tried to create offscreen context of dimensions <256, 256> -- succeeded
Coin info in SoOffscreenRendererP::renderFromBase(): fullsize==<400, 300>, glsize==<256, 256>
Coin info in SoOffscreenRenderer::renderFromBase(): GL context GL_[RED|GREEN|BLUE|ALPHA]_BITS==[8, 8, 8, 8]
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <0, 0>: <0.000000, 0.000000> - <0.640000, 0.853333>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <1, 0>: <0.640000, 0.000000> - <1.000000, 0.853333>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <0, 1>: <0.000000, 0.853333> - <0.640000, 1.000000>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <1, 1>: <0.640000, 0.853333> - <1.000000, 1.000000>
Render ok? 1
osv::getImage::buffer: 0x7f0a63048010
Coin info in SoOffscreenRendererP::renderFromBase(): fullsize==<400, 300>, glsize==<256, 256>
Coin info in SoOffscreenRenderer::renderFromBase(): GL context GL_[RED|GREEN|BLUE|ALPHA]_BITS==[8, 8, 8, 8]
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <0, 0>: <0.000000, 0.000000> - <0.640000, 0.853333>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <1, 0>: <0.640000, 0.000000> - <1.000000, 0.853333>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <0, 1>: <0.000000, 0.853333> - <0.640000, 1.000000>
Coin info in SoOffscreenRendererP::setCameraViewvolForTile(): narrowing for tile <1, 1>: <0.640000, 0.853333> - <1.000000, 1.000000>
Render ok? 1
osv::getImage::buffer: 0x7f0a63048010
And then repeats... At present it seems workable as long as I render the first one twice...
You received this message because you are subscribed to a topic in the Google Groups "coin3d-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coin3d-discuss/eyb9jCIOkpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coin3d-discus...@googlegroups.com.