GDDM V3R2 Base Application Programming Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Examples of transformations

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



To help you understand the GSSAGA call, Figure 47 illustrates the effects of several transformations.

The diagram labeled START shows the starting position for each of the seven transformation sequences that follow.

The first transformation, diagram 1, is a simple displacement. The square moves 30 units to the right and 30 units upward.

Diagram 2 shows the effect of following this displacement with a rotation. The square does not rotate about its center; it rotates about the segment origin which is still in its default position of (0,0). The rotation therefore causes the square to change position.

In diagram 3 the segment origin is set to the center of the square before the rotation is performed. The square therefore maintains its position when it is rotated.

Diagram 4 shows the effect of scaling by 2 in the x direction. Because the scaling is about the segment origin at (0,0), the left-hand bottom corner of the box has its x coordinate increased from 10 to 20. So, in addition to becoming twice its original width, the box also changes position.

Diagram 5 shows how you can scale the box without changing its position. You set the segment origin to the center of the box before performing the scaling operation.

The first two transformations in diagram 6 displace the box by (30,30), then rotate the box about its center. The angle of rotation is that given by dx=10, dy=4. After the rotation, a scaling is applied in the x-direction. This distorts the original shape, giving the same effect as a shear operation.

If you want to double the width of the box without the shearing effect, you must perform the scaling before you rotate it. Either apply the scaling GSSAGA first, or (as shown in diagram 7) set the last parameter of the scaling GSSAGA to 2. This ensures that the scaling is done before all the other transformations. Note that the segment origin has to be reset to the original center of the box before the prescaling is performed.


   PICTURE 35          

PICTURE 36

Figure 47. Results of example transformations

Subtopics:

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012