I would like to rotate a rectangle with some particular axis using timeline function(animation).
But it looks like rectangle doesn't have any method implementation which returns rotation axis property.
Is there any way to achieve the same ?
final Rectangle clipRect = new Rectangle();;
final Timeline timeline = new Timeline();
final KeyValue kv1 = new KeyValue(clipRect.rotationAxisProperty(). no method which returns x/y/z axis property ,1);
Thanks and Best Regards,
Your question's a bit unclear (to me, at least). Are you trying to animate the rotation around a fixed axis (i.e., axis is fixed, but the amount of rotation varies with time), or are you trying to animate the axis itself (the axis about which the rectangle is rotated varies over time). The latter would be a bit unusual but I guess I could see some use cases.
Take a look at a rotation animation example which animates rotation of a node by varying properties of a Rotate transform applied to the node:
Note that a shear transform is different from a rotate transform, normally you would use one transform or the other.