I looked at the bug parade, and there is a bug fix
as well as a workaround for this problem in Java3D1.3_beta1.
(Now you know why I wanted to see what version I was running :)
The error is this:
Modeler.Command.ExportToJPEG.Execute(ExportToJPEG.java:60)
D:\gedavesm\src\java\Modeler\Test1.jpg
java.lang.NullPointerException
at javax.media.j3d.Canvas3D.renderOffScreenBuffer(Canvas3D.java:1921)
at Modeler.Command.ExportJPEGAsThread.run(ExportToJPEG.java:152)
The description is :
"NullPointerException throws in offscreen canvas
renderOffScreenBuffer if :
(1) It is invoke in Canvas3D callback function
(2) The View of this offscreen canvas is shared by
an onScreen canvas
(3) The renderOffScreenBuffer() is invoke immediately
in the same frame when offscreen canvas created."
I am doing both 2 & 3.
The Workaround was described as saying :
"Wait for one more frame before invoke
renderOffScreenBuffer after Offscreen canvas is created."
Which I wasn't doing because I thought it was 'Fixed'.
So I decided to wait for a frame. I tried the following:
View view = ...
view.addCanvas3D( offscreencanvas );
view.stopView();
view.renderOnce();
view.startView();
offscreencanvas.renderOffScreenBuffer();
offscreencanvas.waitForOffScreenRendering();
view.removeCanvas3D( offscreencanvas );
BufferedImage bImageRet = offscreencanvas.
getOffScreenBuffer().
getImage();
But I don't get what's being displayed on my on-screen
buffer.
Does anyone have advice on rendering to an offscreen buffer?
Thanks,
-DaveS
ps. Thanks for the links for Version checking.
pps. Here is my setup:
version = 1.3.1-beta1
vendor = Sun Microsystems, Inc.
renderer = OpenGL
==========================================================================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".