Main /
2DTransformationsIn the properties of a 2D view element, when you hover over the word 'Transform' the tooltip shows the kinds of input that the view property accepts. The listing states: AffineTransform, int, double, double[], double[][], Object. Int and Double shortcuts The inputs 'int' and 'double' provide the shortest way to specify a rotation. (Of course, the input can be either a simple number, or a variable that has been declared on the variables panel.) EJS takes an int to specify degrees, and a double to specify an angle in radians. Dialog box![]() The image to the right shows the dialog box that accompanies the cell 'Transform'. This dialog box will generate strings that specify various transformations. For example: enter the number "45" in the cell next to the button "Rotation", and press the button. The line on the bottom will then read: ro:45d That is entirely a string. To create the specified transform EJS processes that string. A subsequent transformation can be added by adding another number and pressing the adjacent button. For example 1 and 1 the cells next to "Translation" and pressing the button. The line on the bottom will then read ro:45d & tr:1,1 Advanced optionsA transformation for a 2D element is an object of the AffineTransform Java class. You can find some nice references if you google for AffineTransform, such as http://www.glyphic.com/transform/.
See the Javadoc page for AffineTransform to learn what this means.
You can also multiply (compose) several objects of the
Matrix2DTransformation class.
|