Working with Coordinate System Transformations
Contents
[
Hide
]
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 theGraphics
object to specify the rotation angle. - Draw the shapes with 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.
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.
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 theGraphics
class object. - Draw a shape such as a
Rectangle
.
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 theGraphics
class object. - Draw shapes such as rectangles.
World Transformation in Java
To apply world transformation 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
translateTransform()
method to set the transformation. - Draw a shape such as a rectangle.