Hi Raghav You should have a look into the J3D-archive:
http://swjscmail1.java.sun.com/cgi-bin/wa?S1=java3d-interest Search for "movie" or "avi" and you will find some discussions that may be of interest. regards andreas Raghavendra R wrote: > Hi Sean, > > I was able to get hold of a couple of GIF encoders (Acme, Neuquant). I > have already extended the Canvas3D class and overridden the postSwap > method as part of JPEG encoding. I will try these and will post a > query if i run into any problems. Also, are there any clauses in > encoding in Animated GIF format? Basically, i wanted to export the > canvas frames in Animated GIF or any movie format like AVI / MPEG. > > Thanks > Raghav > > Sean Sylvis wrote: > >> for the gif encoder, just do a google search for 'java gif encoder'. >> i think there is a list somewhere of java decoders/encoders for >> different image formats. >> >> to create animated gifs, you can simply write a gif file each time >> the postSwap() method is called (you should extend the Canvas3D class >> and subclass the postSwap() method to write the canvas image. for a >> more involved answer, this has been discussed on the list before, so >> you should search the archives for previous postings. and let me know >> if you need more direction. >> >> sean >> >> >> -----Original Message----- >> *From:* Raghavendra R [mailto:[EMAIL PROTECTED]] >> *Sent:* Wednesday, July 31, 2002 4:35 AM >> *To:* [EMAIL PROTECTED] >> *Subject:* Re: [JAVA3D] Change background color of Canvas3D >> >> Hi Sean / David, >> >> Thanks for the solution. It worked very well. I also need to save >> the Canvas3D frames in Animated GIF format. Are there any good >> "Animated GIF encoders" that i can use. >> >> Thanks once again >> Raghav >> >> Sean Sylvis wrote: >> >>>After you first create the Canvas3D... >>> >>>// Set background to pColor >>>Background vBackground = new Background(new Color3f(pColor)); >>>vCanvas.getGraphicsContext3D().setBackground(vBackground); >>> >>> >>>And in the preRender method of your extended Canvas3D... >>> >>>// Clear background to background color >>>super.getGraphicsContext3D().clear(); >>> >>>Sean >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: Raghavendra R [mailto:[EMAIL PROTECTED]] >>>>Sent: Tuesday, July 30, 2002 5:56 AM >>>>To: [EMAIL PROTECTED] >>>>Subject: Re: [JAVA3D] Change background color of Canvas3D >>>> >>>> >>>>Hi, >>>> >>>> >>>>I am calling the repaint method from a method "PrintImage". I >>>>have used >>>>the piece of code in "http://www.j3d.org/faq/capturing.html". I tried >>>>setting the Canvas background color and also tried to get Graphics2D >>>>from the BufferedImage and set the color etc, but still the background >>>>remains black. >>>> >>>>PrintImage() >>>>{ >>>>myCanvas.repaint() >>>>} >>>> >>>>RenderCanvas extends Canvas3D >>>>{ >>>>postSwap() >>>>{ >>>> GraphicsContext3D ctx = getGraphicsContext3D();* >>>> Rectangle rect = getBounds() ; >>>> >>>> Raster ras = new Raster(new Point3f(-1.0f,-1.0f,-1.0f), >>>>Raster.RASTER_COLOR, 0, 0, rect.width, >>>> rect.height, new >>>>ImageComponent2D(ImageComponent.FORMAT_RGB, >>>> new BufferedImage(rect.width, rect.height, >>>>BufferedImage.TYPE_INT_RGB)), null); >>>> >>>> BufferedImage img = ras.getImage().getImage(); >>>> >>>> try >>>> { >>>> FileOutputStream out = >>>> new >>>>FileOutputStream("images/Capture"+postSwapCount_+".jpg"); >>>> JPEGImageEncoder encoder = >>>>JPEGCodec.createJPEGEncoder(out); >>>> JPEGEncodeParam param = >>>>encoder.getDefaultJPEGEncodeParam(img); >>>> param.setQuality(0.9f, false); >>>> encoder.setJPEGEncodeParam(param); >>>> encoder.encode(img); >>>> writeJPEG = false; >>>> out.close(); >>>> } >>>> catch (IOException e) >>>> { >>>> >>>> >>>>} >>>>} >>>>} >>>> >>>>Shouldn't i be setting the background color of the Canvas3D before >>>>calling the repaint method or can we swap the colors in the >>>>BufferedImage? >>>> >>>>Thanks >>>>Raghav >>>> >>>> >>>>David Bourgais wrote: >>>> >>>>* >>>> >>>> * * >>>> >>>>> * * >>>>> >>>>>*Hi ! >>>>> >>>>>To change your background color, you sohould use this : >>>>> >>>>>float coul1, coul2, coul3; /*In french, coul for couleur (couleur = >>>>>color in perfect english)*/ >>>>>Background bg = new Background(coul1, coul2, coul3); >>>>>bg.setCapability(bg.ALLOW_COLOR_READ); >>>>>bg.setCapability(bg.ALLOW_COLOR_WRITE); >>>>>bg.setApplicationBounds(/*your BoundingSphere*/); >>>>>YourScene.addChild(bg); >>>>>//Changing the background color >>>>>float a, b, c; >>>>>bg.setColor(a,b,c); >>>>> >>>>>I hope that it will help you. >>>>> >>>>>David Bourgais >>>>> >>>>> >>>>>* >>>>> >>>>> * * >>>> >>>> * * >>>> >>>>*============================================================== >>>>============= >>>>* >>>> >>>> * * >>>> >>>>> * * >>>>> >>>>>*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". >>>>> >>>>> >>>>>* >>>>> >>>>> * * >>>> >>>> * * >>>> >>>>*============================================================== >>>>============= >>>>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". >>>> >>>>* >>>> >>>> * * >>> >>> * * >>> >>>* >>>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". >>> >>> >>>* >>> >>> * * >> >> * >> * >> >> * * > > * > * -- Andreas Moessner, Software Developer, IFAD A/S Forskerparken 10, DK-5230 Odense M, Denmark Phone: +45 6315 7131, Fax: +45 6593 2999 Email: [EMAIL PROTECTED] WWW: http://www.ifad.dk =========================================================================== 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".
