Hi,
I have a 3D scene with 3 elements. I would like to
change 2 of them inside a loop and then see on the
screen the resultant "animation". That work without
any user interface but with one, I'm just able to see
the final scene after a wait with a white screen during
which the "animation" run...

Here is the code which call the 3D display method
of the ComputeDisplay class (from the main window
of the user interface)

    ....
    displayButton = new JButton("Run Display");
    displayButton.addActionListener(this);
    .....

    public void actionPerformed(ActionEvent e) {
      JComponent c = (JComponent) e.getSource();
 
      if (c == displayButton) {
         computeDisplay.display3D();
      }
    }

 
And here is the code of display3D method :

  public void display3D() throws Exception {
    SceneConstruct scene = new SceneConstruct();
    ObjectScene objects  = new ObjectScene();

    scene.addObject3D(objects, planes[0], -1, imagePath);
    scene.addObject3D(objects, planes[1], -1, "");
    scene.addObject3D(objects, segarray[0], -1);
 
    scene.addObjects3D(objects, -1);
 
    frame2 = new MainFrame(scene, 512, 512);

    int index = 2;
    while (index<NUMBER_RECORD-1) {
      scene.addObject3D(objects, planes[index], 1, "");
      scene.addObject3D(objects, segarray[index-1], 2);
      index++;
      Thread.sleep(1000);
    }
  }

I'll appreciate any help,
Brice

Reply via email to