Problem using two canvas

hi,



we want to use four canvas in order to render the same scene out of four perspectives. The four canvas may have different sizes. The Problem is that the renderer can’t handle those canvas with different sizes. Resizing one canvas the other ones also change their size, resulting in funny effects.



In the example the lower right canvas uses normal rendering, the others show the same scene as wireframe with parallelprojection. Note the incorrect size of the other canvas’ viewports.







thanks in advance

Our JMECanvas was not built/tested for multiple sim. usage, so you are breaking new ground for us.  If you can send a simple test to me I'll see if I can fix things up.

Ok,



here is a patch for JMESwingTest.java demonstrating the problem. Just resize one frame…



Index: JMESwingTest.java
===================================================================
RCS file: /cvs/jme/src/jmetest/util/JMESwingTest.java,v
retrieving revision 1.13
diff -u -r1.13 JMESwingTest.java
--- JMESwingTest.java   13 Jan 2006 19:37:43 -0000      1.13
+++ JMESwingTest.java   20 Jan 2006 13:19:26 -0000
@@ -86,14 +86,21 @@
     int width = 640, height = 480;

     // Swing frame
-    private SwingFrame frame;
+    private SwingFrame frame1;
+    private SwingFrame frame2;

     public JMESwingTest() {
-        frame = new SwingFrame();
+        frame1 = new SwingFrame();
         // center the frame
-        frame.setLocationRelativeTo(null);
+        frame1.setLocationRelativeTo(null);
         // show frame
-        frame.setVisible(true);
+        frame1.setVisible(true);
+
+        frame2 = new SwingFrame();
+        // center the frame
+        frame2.setLocationRelativeTo(null);
+        // show frame
+        frame2.setVisible(true);
     }

     /**
@@ -280,7 +287,7 @@
         }

         public void simpleSetup() {
-
+                       TextureManager.clearCache();
             // Normal Scene setup stuff...
             rotQuat = new Quaternion();
             axis = new Vector3f(1, 1, 0.5f);

To solve this problem, add a "cam.update();" to the beginning of your JMECanvasImplementor class's doRender method.  In JMESwingTest you can see how this works by adding:


        public void doRender() {
            cam.update();
            super.doRender();
        }



to the MyImplementor class in that same file.