Hi Auguste, thanks for your answer. I have already made the changes that you suggest me. But the problem that im having is only whith this command:
ctx.ReadRaster(ras); only this commmand takes 200ms. If i dont use this command and make one measurement of the time i can make everything in 30ms. I had another strange problem too when i try to use this command. With linux he takes the buffer of the Graphics card. That means that if i run my application and select another application in the monitor, he takes snapshots of what im showing in the monitor, and not of the 3d scenario of my application. I think that this is a problem with OpenGL, since i dont have this problem whit windows. I tried to make too offscreen rendering and i get a better perfomance of 100ms, but thats not enough for the application. My problem is that i need to acquire a BufferedImage of my scenario and send it to a stream. This code that i showed was based in a implementation of J3d.org to save a JPEG file. If someone have another idea to capture Images from the scenario i would be glad to know. greetings, Tiago > actually this is the same for ImageComponent and Raster so t he only > thing wich should stay - INSIDE - the method should be > > SendImage(ctx.readRaster(ras)); > > > > the rest is OUTSIDE, once for all. > > > tiagoscalheiros wrote: > > >Hi, > > > >I have rewrited the postswap() of a canvas 3d to collect a > >bufferedImage of the scenario and then sent it to another > >aplication. > > > >The program is working but im having a problem with the > >performance: > >I discovered that the method readRaster(Raster r) from > >graphicsContext3d takes 200ms in Suse Linux 1,8Ghz to > >retrieve the raster image and that is to slow for the > >application. > > > >I would like to know if someone knows why these method is s o > >slow, if i cann make it faster or if someone knows a better > >and fast way to get a bufferedImage of one canvas 3d? > > > > public void postSwap() > > { > > GraphicsContext3D ctx = getGraphicsContext3D(); > > > > Rectangle rect = this.getBounds(); > > > > BufferedImage img = new BufferedImage > >(rect.width,rect.height, > > > >BufferedImage.TYPE_INT_RGB); > > > > ImageComponent2D comp = > > new ImageComponent2D(ImageComponent.FORMAT_RGB, > >img, true, false); > > > > Raster ras = new Raster(new Point3f(-1.0f,-1.0f,- > >1.0f), > > Raster.RASTER_COLOR, > > 0, > > 0, > > rect.width, > > rect.height, > > comp, > > null); > > > > > > ctx.readRaster(ras); > > > > // Now strip out the image info > > > > BufferedImage output_img = ras.getImage().getImage (); > > > > SendImage(output_img); > > > > } > > > > > > > >--- > >Acabe com aquelas janelinhas que pulam na sua tela. > >AntiPop-up UOL - É grátis! > >http://antipopup.uol.com.br > > > >=========================================================== ================ > >To unsubscribe, send email to [EMAIL PROTECTED] and inc lude in the body > >of the message "signoff JAVA3D- INTEREST". For general help, send email to > >[EMAIL PROTECTED] and include in the body of the messag e "help". > > > > > > > > > > > -- > A. Genovesio > Quantitative Image Analysis Group > Institut Pasteur > 25, rue du Docteur Roux > 75724 Paris Cedex 15 > > ============================================================ =============== > To unsubscribe, send email to [EMAIL PROTECTED] and incl ude 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". > --- Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - É grátis! http://antipopup.uol.com.br =========================================================================== 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".