Please excuse these questions if they are going over well-trodden
ground but I am trying to piece together a means of saving 3D images
to disk.

I'm new to Java3D and have thus far put together some code to display
some basic shape primitives that I'm interested in.  I am now trying
to grab frames of these shapes (aiming for JPEG images).  I read in
the NCSA 3D FAQ, prompted by
http://java.sun.com/products/java-media/mail-archive/3D/2004.html,
that by overriding the postSwap method I could get at the image that I
want.

However, I think I am missing some of the subtleties of synchronizing
the events.  Specifically I am unsure about how to implement flagging
that a completed frame is now available for rastering.  Namely:

>> Effectively what you do is extend Canvas3D and override the
>> postSwap() method. This method is called after J3D has
>> rendered to the background buffer and then swapped it to screen
>> so you know you have a completed frame.
>>
>> Don't call postSwap() directly. Set a flag in another method
>> which you can call from within your program, and then call
>> repaint() from within that method.
>>
>> Once the postSwap method is called, check the flag. If it has
>> been set, you then use the readRaster() method to dump the raw
>> bytes from the frame.


I have scouted around the archive and found a couple of semi-related
articles (../3D.9.98/0389.html and ../3D/0074.html) but I couldn't
grasp the way to synchronize postSwap.  So if anyone could give a
`newby' some pointers as to how to implement grabbing an image from a
canvas, I would be most appreciative.

Best

Alistair Rust

===========================================================================
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".

Reply via email to