Using World to Model Space Transformations

The following is an example of a sequence of calls in which segment, model, and instance transformations are applied to graphics objects.

GpiSetDrawingMode (DM_RETAIN)   /* Sets the current drawing mode        */
                                /* to DM_RETAIN                         */

GpiOpenSegment (segment 1)      /* Creates a chained segment            */

GpiCloseSegment
GpiSetSegmentAttrs              /* Make segment 1 an unchained segment  */

GpiOpenSegment (segment 2)      /* Creates a retained, chained segment  */

GpiSetModelTransformMatrix (TRANSFORM_ADD)
                                /* Specifies a transformation to        */
                                /* apply to subsequent primitives.      */
                                /* This is in addition to the current   */
                                /* model transformation.                */

GpiCallSegmentMatrix (1, TRANSFORM_ADD)
                                /* Calls segment 1 and applies a        */
                                /* transformation to it.                */
                                /* This transformation is in addition   */
                                /* to the current model transformation, */
                                /* and applies only to the called       */
                                /* segment.                             */
   .
   .
GpiSetCurrentArcParams
GpiPointArc                     /* The 3-point arc is not subject       */
                                /* to the transformation specified      */
                                /* on the call to GpiCallSegmentMatrix. */
                                /* The transformation that was          */
                                /* current before segment 1 was called  */
                                /* is applied to the remainder of       */
                                /* segment 2.                           */

GpiCloseSegment
GpiSetSegmentTransformMatrix (segment 2)
                                /* Specifies a segment transformation   */
                                /* for segment 2                        */

GpiDrawSegment                  /* Draws segment 2                      */


[Back: Shearing a Picture]
[Next: Viewing Transformation]