In takeSnapshot() you are not supposed to call postSwap().
You have to wait for Canvas3D to do it. In takeSnapshot()
start a new thread. Yield on that thread until your override of
postSwap() is called which fills the image and resets your
bTakeSnapshot flag.
--jon
> Date: Thu, 04 Mar 1999 11:37:55 -0500
> From: Guillaume Bilodeau <[EMAIL PROTECTED]>
> Subject: [java3d] Capturing images from a Canvas3D
>
> This is a multi-part message in MIME format.
> - --------------75BB1891B45B580DCB1834DC
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> I am working on a 3D object viewer, in Java3D. One of the
> functionalities I'd
> like to implement is the capability to take a snapshot of the model, that is
> copying the content of the Canvas3D to a JPEG file. I currently have a class
> that extends Canvas3D, Viewer3D, that overrides the postSwap() method, in which
> I do the processing. Unfortunately, the call to the readRaster(Raster) method
> crashes opengl32.dll every time. Could you tell me what is wrong with my code?
> I am using Java 2 and Java3D 1.1, all this running on Windows 95.
> [snip]
--
____________________ Peculiar Technologies ____________________
Jon Barrilleaux 3800 Lake Shore Ave. Purveyors of
[EMAIL PROTECTED] Oakland, CA 94610 Alternate Reality
510.444.4370 voc Augmented Simulation
510.444.0231 fax www.augsim.com and 3D Solutions
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/