Login  Register

Re: Rotating object inside actionPerformed()

Posted by bchinfosieeuw on Jul 15, 2018; 2:18pm
URL: https://forum.jogamp.org/Rotating-object-inside-actionPerformed-tp4039031p4039035.html

Thanks, the first example of SwingInteraction is helpful for me. Next question: how to rotate cylinder4, while rotating a cylinder 5 around cylinder4? When I do this:

public void actionPerformed(ActionEvent e ) {
        myBehavior5.rotate();
        myBehavior4.rotate();
}

then the two behaviors cause the cylinders to spirale out of the universe. So should I implement two separate behavior classes? Or is there another solution? Thanks in advance.