Chris, Rob,
The temporary workaround is to add
g2.setComposite(AlphaComposite.Src);
before
g2.flush(true);
which will eliminate the superimposing new draws
over all the old ones.
Hope it helps, Jean
> MIME-Version: 1.0
> Date: Wed, 5 Apr 2000 11:37:50 -0400
> From: "Williams, Christopher" <[EMAIL PROTECTED]>
> Subject: Re: [JAVA3D] Another Question about the J3DGraphics2D object...
> Comments: To: Rob Bishop <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
>
> You are correct..I did a simple example trying to draw an oval in one update
> and a line in another and they both were showing. But if I do drawing in
> one update and nothing in the following but a flush..it disappears. I guess
> I am still confused on how this interacts with the Canvas3D still. I am
> keeping a static reference to the J3Dgraphics2D object around. Any other
> insights on what is going on?
> Thanks
> Chris
>
> ----------
> From: Rob Bishop[SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, April 05, 2000 11:00 AM
> To: Williams, Christopher
> Cc: Discussion list for Java 3D API
> Subject: Re: [JAVA3D] Another Question about the J3DGraphics2D
> object...
>
> Chris,
>
> Is your image the same every frame (that is, would you be able to
> see any
> superimposition)? Do you use a transparent/translucent background?
> I found
> when using a translucent background that it would just keep adding
> on top until
> I got a solid color.
>
> I also found that you have to call flush(true) every time in
> postRender in order
> to see the results. However, I want to show just what's been drawn
> during the
> last frame. Not every draw command I ever issued. That's why I'm
> asking about
> clearing the drawing buffer. I would have thought that would happen
> automatically, so maybe it's a bug. Or maybe I don't understand the
> class well
> enough yet. It'd be nice if they were better documented.
>
> - Rob
>
>
> "Williams, Christopher" wrote:
>
> > Hmmm..I don't get the same results. I am also doing my drawing
> while in the
> > postRender and I have to call my drawImage every time in order for
> it to
> > stay on the screen constantly. I wish this was the case so I
> wouldn't have
> > to do the draw everytime in the potRender call which slows down my
> display.
> > Chris
> >
> > ----------
> > From: Rob Bishop[SMTP:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 05, 2000 10:18 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JAVA3D] Another Question about the
> J3DGraphics2D
> > object...
> >
> > J3D Team,
> >
> > I'm having some difficulty getting the J3DGraphics2D
> object to draw
> > properly.
> > I'm able to get Strings and images drawn on the Canvas3D,
> but it
> > appears that
> > the J3DGraphics2D internal buffer is never cleared. So it
> winds up
> > superimposing my new draws over all the old ones. For
> example, say
> > in
> > postRender() I:
> >
> > j3dg2d.drawString("A");
> > j3dg2d.flush(true);
> >
> > and then next time through:
> >
> > j3dg2d.drawString("B");
> > j3dg2d.flush(true);
> >
> > B will be superimposed over A.
> >
> > Is there a way to clear J3DGraphics2D drawing buffer????
> (Note that
> > this is
> > different from clearing the Canvas3D to the background
> color which
> > happens every
> > frame anyway).
> >
> > Is this a bug or am I doing something wrong?
> >
> > Rob Bishop
> > TASC
> >
> > "Williams, Christopher" wrote:
> >
> > > I am trying to draw a string into the J3DGraphics2D
> object that I
> > am
> > > grabbing from my Canvas3D. When I do the drawString
> method,
> > nothing shows
> > > up on the screen. But when I do a drawLine across the
> screen
> > instead, that
> > > works. Are all the draw methods from the graphics
> object
> > implemented? I am
> > > using JDK 1.2.2-5 with Java3D 1.2 beta 2 on a Solaris
> machine.
> > > Thanks
> > > Chris
> > >
> > >
> >
> ===========================================================================
> > > 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".
******************************************
* Graphics Systems Software *
* Sun Microsystems,Inc. *
* Email:[EMAIL PROTECTED] *
******************************************
===========================================================================
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".