Hi Ben:
 
Something like the following may be what you're after (from archives):
    GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
    graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment().
        getDefaultScreenDevice().getBestConfiguration(template);
    canvas3D = new Canvas3D(graphicsConfiguration);
 
We don't do the above, but just use:
      graphicsConfiguration = SimpleUniverse.getPreferredConfiguration();
      canvas3D = new Canvas3D(graphicsConfiguration);
And from Java3D install documention: "Many Java 3D programs pass null to the Canvas3D constructor.  By doing this, Java 3D will select a default GraphicsConfiguration that is appropriate for Java 3D.  However, this is a bad practice, and can lead to errors when applications try to run in alternate environments, such as stereo viewing.  Java 3D will now print out a warning if the Canvas3D constructor is passed in a null argument for the GraphicsConfiguration."
Regards,
Geoff.
 
----- Original Message -----
From: Ben Arbel
Sent: Wednesday, May 09, 2001 11:12 PM
Subject: [JAVA3D] Viewer Question

Hi All
 
when i create a viewer it creates it own frame and panel which i don't want and i cant really
create the viewer object with a canvas3d as the viewer creations happens before the creation
of the canvas3d.
 
 
my code looks something like this:

    Viewer viewer = new Viewer();
    mUniverse3D = new SimpleUniverse(mViewingPlatform,viewer);
 
    mScreenBounds = mUniverse3D.getPreferredConfiguration().getBounds();
    mCanvas3D = mUniverse3D.getCanvas();
 
i tried creating a canvas3D with a null graphicsConfiguration object so now it looks like this:
    mCanvas3D = new Canvas3D(null);
    Viewer viewer = new Viewer(mCanvas3D);
    mUniverse3D = new SimpleUniverse(mViewingPlatform,viewer);
 
    mScreenBounds = mUniverse3D.getPreferredConfiguration().getBounds();
    mCanvas3D = mUniverse3D.getCanvas();
 
when i ran it i got this warning from the jvm
WARNING: Canvas3D constructed with a null GraphicsConfiguration.
is there a way to remove this warning ? are there any implications
for creating a canvas3D with a null GraphicsConfiguration ?
 
what is the best solution to this problem ?
 
thanks,

Ben Arbel
Xtivia Technologies
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.xtivia.com
http://www.comsoft.co.il
work phone(NJ): 732 248 9399
work phone(Israel):  972-2-9598999

 

Reply via email to