Title: Message
No - think about the language of the thing - you want two different views of the SAME universe. The Universe, after all, by defintion, contains everything - all of your objects.
 
So - you want to have two ViewPlatform nodes in your unique Universe. The ViewPlatform node encapsulates all the gubbins about camera position etc, etc, and so with two, you can set them both independently. This is something I did once, where I had a method that manufactured new ViewPlatforms at will, attaching them to new Canvas3Ds for display, and adding them to the Universe's scene graph.
Unfortunately, I moved away from having multiple views, and now the code is gone, so I can't show you anything!
 
Lewis.
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED] On Behalf Of dafna gordon
Sent: 08 September 2003 15:22
To: [EMAIL PROTECTED]
Subject: [JAVA3D] multiple views

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".

Reply via email to