> What I would like to do is setup a toolbar on my JFrame and have buttons
> for specifying what the mouse will do when interacting with my 3D scene.
> eg a button to pick, a button to rotate, zoom etc..
> So that the user clicks, say the zoom button, and when the click and drag
> on the 3D scene the scene zooms. If the click the rotate buton then when
> they
> click and drag on the 3D scene then it rotates.. you get the idea.
Just do it like this:
public class CLASS extends Applet implements ActionListener {
private Transform3D trans = new Transform3D();
private Button Right = new Button("Right");
private Button Left = new Button("Left");
public void init() {
setLayout(new BorderLayout());
Panel p = new Panel();
p.add(Left);
p.add(Right);
Right.addActionListener(this);
Left.addActionListener(this);
add("South", p);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == Right){
angle += Math.toRadians(10.0);
trans.rotY(angle);
objTrans.setTransform(trans);
// objTrans is the TransformGroup of the object to rotate
} else if (e.getSource() == Left){
angle += Math.toRadians(-10.0);
trans.rotY(angle);
objTrans.setTransform(trans);
}
}
That´s all, cu Timo.
===========================================================================
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".