I have a raster of data which I would like to draw over top of all geometry in my scene. However, no matter what values I pass to the array which should define the depth information, the color pixelsin the raster are written at the same depth as the point that defines the raster's location in the scene graph. I've also tried a two step process where I first write depth information and then color information in two different rasters. My depth information simply seems to be ignored. Is there any way to get these rasters to appear above all the geometry?
Mark McKay
private Shape3D buildFgRaster() { //Create raster image of logo Image logoImage = AppImageLoader.instance().getImage(AppImageLoader.IM_AUTO_REF_LOGO); int width = logoImage.getWidth(null); int height = logoImage.getHeight(null); BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); Graphics2D g = bi.createGraphics(); g.drawImage(logoImage, 0, 0, null); g.dispose();
ImageComponent2D ic = new ImageComponent2D(ImageComponent.FORMAT_RGBA, bi);
//Create foreground depth buffer DepthComponentFloat dc = new DepthComponentFloat(width, height); float[] depthData = new float[width * height]; for (int i = 0; i < width * height; i++) { depthData[i] = Float.POSITIVE_INFINITY; } dc.setDepthData(depthData);
//Build raster javax.media.j3d.Raster raster = new javax.media.j3d.Raster( new Point3f(0.00005f, 0.00005f, -10f), javax.media.j3d.Raster.RASTER_COLOR_DEPTH, 0, 0, width, height, ic, dc); raster.setClipMode(javax.media.j3d.Raster.CLIP_IMAGE); raster.setDstOffset(new Point(0, 0));
return new Shape3D(raster); }
=========================================================================== 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".