thanks for the help, postponed dealing with this problem, it does too much trouble.
----- Original Message ----- From: "Josh Richmond" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 08, 2003 3:32 PM Subject: Re: [JAVA3D] multiple views > Hi Dafna, > > You need to define two Views into the same universe. I seem to remember you can't use SimpleUniverse for that purpose. If you look in the archives you should find some sample code. I know I posted some about 3 years ago. > > josh > > >>> [EMAIL PROTECTED] 09/08/03 10:21AM >>> > Hi all, > > i want to create another view (a top view) of my scene. > i tried to create another simpleUniverse, another canvas3D and another JFrame. > but i can't add the same scene (BranchGroup) to two differet simpleUniverses. > i got an exception of multiple parent. > i also tried to define two canvases to the same simpleUniverse, but i had problem defining the different views. > i get an exception of illegal sharing: sharing canvas with multiple views. > how do i create another view which will be connected to the same scene? > > thanks!! > > here is my code: > > frame = new JFrame("Transwell Model"); > JFrame frame2 = new JFrame("Top View"); > > frame.pack(); > frame.setVisible(true); > frame2.pack(); > frame2.setVisible(true); > //===================================================== > config = SimpleUniverse.getPreferredConfiguration(); > canvas3D = new Canvas3D(config); > Canvas3D canv2 = new Canvas3D(config); > frame.getContentPane().add(canvas3D); > frame2.getContentPane().add(canv2); > scene = createSceneGraph3(); > System.out.println("*****************************"); > //====================================================== > scene.compile(); > simpleU = new SimpleUniverse(canvas3D); > simpleU = new SimpleUniverse(canv2); > View view = new View(); > View view2 = new View(); > Viewer viewer1 = new Viewer(canvas3D); > Viewer viewer2 = new Viewer(canv2); > viewer1 =simpleU.getViewer(); > //view = simpleU.getViewer().getView(); > viewer2 = simpleU.getViewer(); > view = viewer1.getView(); > view2 = viewer2.getView(); > view.setBackClipDistance(2000); > view2.setBackClipDistance(2000); > view.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY); > view2.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY); > view2.setProjectionPolicy(View.PARALLEL_PROJECTION); > > > TransformGroup vtg = simpleU.getViewingPlatform().getViewPlatformTransform(); > Transform3D t1 = new Transform3D(); > //t1.set(new Vector3f(0.0f,0.0f,94.499f)); > t1.set(new Vector3f(0.0f,0.0f,155.0f)); > vtg.setTransform(t1); > //simpleU.getViewingPlatform().setNominalViewingTransform(); > simpleU.addBranchGraph(scene); > //========================================================= > > > =========================================================================== > 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".