rotation.toAngles(angles);
// Create a tube to rotate about the X axis. The tube is drawn in the
// X-Z plane, so we must rotate 90 degrees about the +z axis so that the
// axis of rotation is about +x axis.
xEntity = new Entity("Tube X");
xNode = createTube("Tube X", outerRadius, innerRadius, THICKNESS, ColorRGBA.red);
Quaternion xQ = new Quaternion().fromAngleAxis(1.5707f, new Vector3f(0, 0, 1));
xNode.setLocalRotation(xQ);
xNode.setLocalScale(new Vector3f(currentScale, 1.0f, currentScale));
xNode.setRenderState(zbuf);
addSubEntity(xEntity, xNode);
xListener = addRotateListener(xEntity, xNode, RotateAxis.X_AXIS);
// Create a tube to rotate about the Y axis. The tube is drawn in the
// X-Z plane already.
yEntity = new Entity("Tube Y");
yNode = createTube("Tube Y", outerRadius, innerRadius, THICKNESS, ColorRGBA.green);
yNode.setLocalScale(new Vector3f(currentScale, 1.0f, currentScale));
yNode.setRenderState(zbuf);
addSubEntity(yEntity, yNode);
yListener = addRotateListener(yEntity, yNode, RotateAxis.Y_AXIS);
// Create a tube to rotate about the Z axis. The tube is drawn in the
// X-Z plane, so we must rotate 90 degrees about the +x axis so that the
// axis of rotation is about +z axis.
zEntity = new Entity("Tube Z");
zNode = createTube("Tube Z", outerRadius, innerRadius, THICKNESS, ColorRGBA.blue);
Quaternion zQ = new Quaternion().fromAngleAxis(1.5707f, new Vector3f(1, 0, 0));
zNode.setLocalRotation(zQ);
zNode.setLocalScale(new Vector3f(currentScale, 1.0f, currentScale));
zNode.setRenderState(zbuf);