4 Replies Latest reply: May 4, 2013 11:36 AM by Kishan18

Skewing(shearing)  effect  in animation(Timeline )

Hi experts,

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();
timeline .setCycleCount(2);
timeline .setAutoReverse(true);
final KeyValue kv1 = new KeyValue(clipRect.rotationAxisProperty(). no method which returns x/y/z axis property ,1);

Thanks and Best Regards,
Kishan
• 1. Re: Skewing(shearing)  effect  in animation(Timeline )
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.
• 2. Re: Skewing(shearing)  effect  in animation(Timeline )
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:

https://gist.github.com/jewelsea/1475424 "RotationTransformExample.java"

Note that a shear transform is different from a rotate transform, normally you would use one transform or the other.

http://en.wikipedia.org/wiki/Shear_mapping
http://docs.oracle.com/javafx/2/api/javafx/scene/transform/Shear.html
http://docs.oracle.com/javafx/2/api/javafx/scene/transform/Rotate.html
• 3. Re: Skewing(shearing)  effect  in animation(Timeline )
Hi James,

Yes I was trying to animate the rotation around a fixed axis.