I'm posting this class for everyone who needs to print and/or capture from
their Canvas3D objects. As I was trying to figure out how to do it, I saw
many messages in the interest group archive on the subject asking for help,
I hope this helps.

First I must acknowledge the work done by:

    Peter Z. Kunszt
    Johns Hopkins University
    Dept of Physics and Astronomy
    Baltimore MD

I worked from his already published CapturingCanvas3D class. I've made some
minor revisions to his code by letting the captured image automatically size
itself to the Canvas3D with "this.getWidth()" & "this.getHeight()" methods.

I've then attempted to add printing capability. Printing does work, however
there are bugs to be resolved. Primarily the printed image seems to be
clipping only part of the captured image, but the captured-saved images are
correct. I've tested it with Windows95 to a dedicated printer & WindowsNT to
a network printer, and it seems to work ok for both, but is slower on the
Win95 system.

I request that if anyone finds improvements to the code, that they post it
to the group. Perhaps our friends at SUN can further develop this and make
it part of the next release of Java3D. I'd also like to see additional file
formats supported like GIF and TARGA.

Please let me know what you think.
 <<PrintCaptureCanvas3D.class>>  <<PrintCaptureCanvas3D.java>>

Don Casteel

Manufacturing Engineer
TEXTRON Automotive Company -- Athens Operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Voice:  (423)744-1109
        Fax:    (423)744-1112
        Pager:  (423)744-1129  -- 109
                Internet:       [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


PrintCaptureCanvas3D.class

PrintCaptureCanvas3D.java

Reply via email to