Hi Folks,
I have question concerning the getBounds() methods.
First I create a simple box and let java compute the bounds of this box.
Before visualization is done everything seems o.k. The coordinates of
the bounding
sphere are correct. Take a look:
Appearance tbapp= new Appearance();
ColoringAttributes tbc = new ColoringAttributes();
tbc.setColor(0.5f, 0.5f,0.5f);
tbapp.setColoringAttributes(tbc);
testbox = new Box(1.0f,1.0f,1.0f, tbapp);
testbox.setCapability(Box.ALLOW_BOUNDS_READ);
testbox.setCapability(Box.ALLOW_LOCAL_TO_VWORLD_READ);
cgroot.addChild(testbox);
System.out.println("Testbox Bounds before visualization:");
System.out.println(testbox.getBounds().toString());
Here's what I get:
Testbox Bounds before visualization:
Center=(0.0, 0.0, 0.0) Radius=1.7320508075688772
In the application there exists a button to get the bounds after
the visualization of the scene:
JButton button2 = new JButton("Bounds");
button2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
System.out.println("Event :" + e.paramString());
System.out.println("Testbox Bounds after visualization:");
System.out.println(testbox.getBounds().toString());
Transform3D t = new Transform3D();
testbox.getLocalToVworld(t);
System.out.println("Applied Transformationmatrix (from
LocalToVWorld):");
System.out.println(t.toString());
}});
But after visualization the coordinates of the sphere have changed
although
no transformations were applied:
Testbox Bounds after visualization:
Center=(-0.10811912386401538, -0.44295890247114555,
-0.10811912386401538) Radius=2.1302550034132155
Applied Transformationmatrix (from LocalToVWorld):
1.0, 0.0, 0.0, 0.0
0.0, 1.0, 0.0, 0.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
Am I too stupid or is it a bug ?
Joerg
===========================================================================
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".