Hi Oleg, Bug 4633701 - J3DGraphics.drawAndFlushImage(...) is ignoring GraphicsContext3D.setStereoMode() and 4633700 - J3DGraphics2D.drawAndFlushImage(...) doesn't work well with J3DG2D.copyArea()
is filed for them. We're looking to resolve all 3 bugs in v1.3 beta2. Thanks for your bug report. - Kelvin -------------- Java 3D Team Sun Microsystems Inc. >Delivered-To: [EMAIL PROTECTED] >Mime-Version: 1.0 >Date: Tue, 5 Feb 2002 14:43:13 -0800 >From: Oleg Pariser <[EMAIL PROTECTED]> >Subject: [JAVA3D] J3DGraphics.drawAndFlushImage(...) is ignoring >GraphicsContext3D.setStereoMode() >To: [EMAIL PROTECTED] > >Hi Kelvin, >First of all thanks for accepting and filing bug#4632388. Secondly, >I filed a couple of reports in Sun's Bug Database in late December >and since then haven't heard anything from Sun. So I though maybe >it's a good idea to post reports to this mailing list. > >Thanks, >-Oleg Pariser @ NASA-JPL Multimission Image Processing Lab >[EMAIL PROTECTED] > >>Date: Thu, 20 Dec 2001 17:23:54 -0800 (PST) >>From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> >>To: [EMAIL PROTECTED] >>Subject: Your Report: J3DGraphics.drawAndFlushImage(...) is ignoring >>GraphicsContext3D.setStereoMode() >>X-IM-Review-ID: 137628 >>Status: O >> >> ************************************************ >>Your report has been assigned an internal review ID of: 137628 >> >>This review ID is NOT visible on the "Java Developer Connection" (JDC). >> >>dateCreated: Thu Dec 20 18:23:52 MST 2001 >>type: bug >>cust_name: Oleg Pariser >>cust_email: [EMAIL PROTECTED] >>jdcid: opariser >>status: Waiting >>category: java3d >>subcategory: other >>company: Jet Propulsion Laboratory >>release: 1.2.1 >>hardware: sun4 >>OSversion: sol2.7 >>priority: 4 >>synopsis: J3DGraphics.drawAndFlushImage(...) is ignoring >>GraphicsContext3D.setStereoMode() >>description: FULL PRODUCT VERSION : >>java version "1.4.0-beta3" >>Java(TM) 2 Runtime Environment, Standard Edition (build >>1.4.0-beta3-b84) >>Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed >>mode) >> >>FULL OPERATING SYSTEM VERSION : >>SunOS monolith 5.7 Generic_106541-16 sun4u sparc >>SUNW,Ultra-5_10 >> >> >> >>EXTRA RELEVANT SYSTEM CONFIGURATION : >>Java 3D(TM) 1.3 Beta 1 >>Java Advanced Imaging(JAI) v1.1.1 >> >>A DESCRIPTION OF THE PROBLEM : >>In Immidiate mode, J3DGraphics2D.drawAndFlushImage(...) is >>ignoring >>GraphicsContext3D.setStereoMode(GraphicsContext3D.STEREO_LEFT) >>setting and renders to both eyes(i.e. stereoMode >>STEREO_BOTH). What is interesting, if I set stereoMode to >>STEREO_LEFT, then call GraphicsContext3D.draw(...), then >>call J3DGraphics2D.drawAndFlushImage(...), the result is >>correct: image is drawn only to left eye. >>But if I set stereoMode to STEREO_LEFT and call >>J3DGraphics2D.drawAndFlushImage(...) *without* calling >>GraphicsContext3D.draw(...) first, the image gets drawn to >>both eyes. >> >>P.S. In describing the problem I used STEREO_LEFT, but the >>same is applicable to STEREO_RIGHT >> >>STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : >>1.Compile and run submitted test program which requires two >>imageFileNames to run. >>2. Notice that images gets rendered to both eyes, even >>though the expected result is image#1 rendered to >>STEREO_LEFT and image#2 rendered to STEREO_RIGHT >> >>EXPECTED VERSUS ACTUAL BEHAVIOR : >>Expected result: After calling >>GraphicsContext3D.setStereoMode(GraphicsContext3D.STEREO_LEFT) >>J3DGraphics2D.drawAndFlushImage(...) renders only in left >>eye. >>Actual result: J3DGraphics2D.drawAndFlushImage(...) renders >>in both eyes. >> >>This bug can be reproduced always. >> >>---------- BEGIN SOURCE ---------- >>import java.awt.*; >>import java.awt.image.*; >>import java.awt.color.*; >>import javax.vecmath.*; >>import javax.media.j3d.*; >>import com.sun.j3d.utils.universe.SimpleUniverse; >>import javax.swing.event.*; >>import java.awt.event.*; >>import javax.media.j3d.*; >>import javax.media.jai.*; >>import com.sun.media.jai.codec.ImageCodec; >>import com.sun.j3d.utils.geometry.ColorCube; >>import java.awt.image.renderable.*; >>import java.io.*; >>import javax.swing.*; >> >>public class StereoCanvas extends Canvas3D { >> >> //Properties >> >> private GraphicsContext3D _gc3D; >> private J3DGraphics2D _j3DG2D; >> private BufferedImage _imageLeft; >> private BufferedImage _imageRight; >> >> public StereoCanvas(GraphicsConfiguration config, >> BufferedImage imageLeft, >> BufferedImage imageRight) >> { >> super(config); >> >> _imageLeft = imageLeft; >> _imageRight = imageRight; >> //Make sure that stereo is enabled >> setStereoEnable(true); >> //Stop the renderer, since we use immediate mode rendering. >> stopRenderer(); >> // Create a simple scene and attach it to the virtual >>universe >> SimpleUniverse universe = new SimpleUniverse(this); >> >> // This will move the ViewPlatform back a bit so the >> // objects in the scene can be viewed. >> >>universe.getViewingPlatform().setNominalViewingTransform(); >> } >> >> public void paint(Graphics g) >> { >> super.paint(g); >> if(_gc3D == null || _j3DG2D == null) { >> >> setDoubleBufferEnable(false); >> >> _gc3D = getGraphicsContext3D(); >> _gc3D.setBufferOverride(true); >> _gc3D.setAppearance(new Appearance()); >> _gc3D.setBackground(new Background(new >>Color3f(Color.black))); >> >> } >> _gc3D.setStereoMode(GraphicsContext3D.STEREO_BOTH); >> _j3DG2D = getGraphics2D(); >> _gc3D.clear(); >> _j3DG2D.flush(true); >> >> >> _gc3D.setStereoMode(GraphicsContext3D.STEREO_LEFT); >> //If the line below uncommented then this test program >> //runs correctly >> //_gc3D.draw(new ColorCube(0.01)); >> _j3DG2D.drawAndFlushImage(_imageLeft, 0, 0, null); >> _gc3D.setStereoMode(GraphicsContext3D.STEREO_RIGHT); >> //If the line below uncommented then this test program >> //runs correctly >> //_gc3D.draw(new ColorCube(0.01)); >> _j3DG2D.drawAndFlushImage(_imageRight, 0, 0, null); >> >> _gc3D.flush(true); >> >> } >> >> /** >> * This function simply calls paint(Graphics g) which is >>different >> * from parent's implementation >> */ >> public void update(Graphics g) >> { >> paint(g); >> } >> >> public static void main(String[] argv) >> { >> if(argv.length != 2) { >> System.out.println("Usage: java StereoCanvas >>imageLeftFileName imageRightFileName"); >> } >> GraphicsConfigTemplate3D template = new >>GraphicsConfigTemplate3D(); >> template.setStereo(GraphicsConfigTemplate.REQUIRED) ; >> GraphicsConfiguration config >> = >>GraphicsEnvironment.getLocalGraphicsEnvironment(). >> >>getDefaultScreenDevice().getBestConfiguration(template); >> PlanarImage imageLeft = JAI.create("fileload", argv[0]); >> PlanarImage imageRight = JAI.create("fileload", argv[1]); >> StereoCanvas myCanvas3D = >> new StereoCanvas(config, >> imageLeft.getAsBufferedImage(), >> imageRight.getAsBufferedImage()); >> >> JFrame jFrame = new JFrame(); >> jFrame.getContentPane().setLayout(new BorderLayout()); >> >> jFrame.getContentPane().add(myCanvas3D, >>BorderLayout.CENTER); >> >> jFrame.pack(); >> jFrame.setSize(200, 300); >> jFrame.setVisible(true); >> } >>} >> >>---------- END SOURCE ---------- >> >>CUSTOMER WORKAROUND : >>Set stereoMode to STEREO_LEFT and call >>GraphicsContext3D.draw(...) before calling >>J3DGraphics2D.drawAndFlushImage(...) >>workaround: >>comments: (company - Jet Propulsion Laboratory , 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". =========================================================================== 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".