I am trying to get an image from the frame buffer, rendered by Java3D.
The Raster class is supposed to be helpfull for this, I understand.
The following code doesnt seem to work...
screenImage = new BufferedImage( viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB );
ImageComponent2D imcmp = new ImageComponent2D( ImageComponent2D.FORMAT_RGB,
screenImage );
javax.media.j3d.Raster raster = new javax.media.j3d.Raster(
new Point3f( 1.f, 10.f, 0.f ),
javax.media.j3d.Raster.RASTER_COLOR,
0, 0,
viewWidth, viewHeight, //size in device coords
imcmp, null );
GraphicsContext3D gc = canvas.getGraphicsContext3D();
Transform3D t = new Transform3D();
t.set( viewPerDevice );
gc.setModelTransform( t );
gc.readRaster( raster );
It attempts to create a raster geometry, specified in device coordinates
and and transforms to viewport coordinates with the matrix "viewPerDevice".
The same positioning DOES work for writing (as opposed to reading) to the
the screen.
Isnt there some simple way to do this using the old AWT? Can I give Java3D
an array to render to as a back buffer?
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".