Working with Coordinate System Transformations

Global Transformation in Java

To globally transform a scene in Java, follow these steps:

  • Create an instance of the Bitmap class.
  • Initialize a new object of the Graphics class with this bitmap object.
  • Use the rotateTransform() method of the Graphics object to specify the rotation angle.
  • Draw the shapes with global transformation.

Global Transformation

Local Transformation of in Java

To locally transform an object in Java, follow these steps:

  • Create an instance of the Bitmap class.
  • Initialize a new object of the Graphics class with this bitmap object.
  • Create a shape such as Ellipse.
  • Define a Matrix object with the desired transformation.
  • Apply the matrix to the defined object.

Local Transformation

Matrix Transformation of a Path in Java

To perform a matrix transformation on a path in Java, follow these steps:

  • Create an instance of the Bitmap class.
  • Initialize a new object of the Graphics class with this bitmap object.
  • Create a shape such as a Rectangle.
  • Define the Matrix Transformation using the Matrix class.
  • Apply the transformation to a defined rectangle.

Matrix Transformation

Page Transformation in Java

To perform a page transformation of a scene in Java, follow these steps:

  • Create an instance of the Bitmap class.
  • Initialize a new object of the Graphics class with this bitmap object.
  • Set the GraphicsUnit for the Graphics class object.
  • Draw a shape such as a Rectangle.

Page Transformation

Applying Different Units of Measurement in Java

To apply different units of measurement to different objects in a scene in Java, follow these steps:

  • Create an instance of the Bitmap class.
  • Initialize a new object of the Graphics class with this bitmap object.
  • Set the pageUnit properties for the Graphics class object.
  • Draw shapes such as rectangles.

Units of Measure

World Transformation in Java

To apply world transformation in Java, follow these steps:

World Transformation