I use the method canvas.getGraphics()

      Color bgColor=Color.white;
      Color fgColor=Color.black;
      Graphics g2d = canvas.getGraphics();

      g2d.setXORMode(bgColor);
      g2d.setColor(fgColor);

      // draw using g2d
 

Tero Karhunen wrote:

Hi all.I have to implement geometry picking using a "rubber band", that is, where you draw a (2d) shape on the viewport and underlaying shapes will be picked.Now the problem is that 2D rendering on Canvas3D is horribly slow, so using J3DGraphics2D doesn't work.I've tried some other approaches too (drawing a 3D polygon, mouse control gets pretty difficult because of perspective projection and the fact that front clip distance is greater than zero) , but this is pretty basic stuff (as is 2D rendering on top of 3D view!)and i'm sure someone has done it.I actually found a rubber band example from the Java3D interest archives, but it didn't work, it used a LineArray and Immediate mode, but nothing got drawn.So if anybody has ideas, examples or implementations, they would be appreciated.thanks.Tero Karhunen   

--

---------------------------
Jose L. Hernandez Taberner
mailto:[EMAIL PROTECTED]
http://jlhernandez.webjump.com
 

Reply via email to