Friday, July 8, 2011

Java3D MouseWheelZoom *Zooming Values*

To be able to track the values everytime you zoom in or zoom out with your mousewheel.
You need to overload the function "transformChanged(Transform3D transform).

Below is a sample snippet.

protected class MyOverloadedMouseWheelZoom extends MouseWheelZoom { public void transformChanged(Transform3D transform) { System.out.println(transform.toString()); } }

And then, in your calling function, you only need to proceed with the followings:

MyOverloadedMouseWheelZoom myMouseWheelZoom = new MyOverloadedMouseWheelZoom(); myMouseWheelZoom.setTransformGroup(objRotate); // my objRotate is a TransformGroup with children myMouseWheelZoom.setSchedulingBounds(bounds); // my bounds is a predefined BoundingSphere objRoot.addChild(myMouseWheelZoom);

Gd lck!

No comments:

Post a Comment