/***************************************************************************** Polyline transformation subroutine for CS480 Programming Assignment 2 ****************************************************************************** Author: ******************************************************************************/ #include #include #include #include #include "draw.h" transform_polyline(poly,u,res) Polyline *poly; /* the input polyline structure */ Polyline *res; /* store the resulting deformed polylines here */ float *u; /* the slider parameter values */ { /* Write a polyline transformation program. Use the values stored in the parameter vector "u" to build the transform, and then apply this transform to each of the points stored in the polyline structure. Store the result in the "res" polyline structure. Rotate around the polyline's center point, which is stored in the polyline structure as "poly->center". When transforming the points, do the non-rigid transforms first, then the scaling, rotation, and translation. */ /* The values of the parameter vector u can be obtained by using the defined constants in "draw.h", i.e.: u[TRANSLATE_X] is the X translation value u[TRANSLATE_Y] is the Y translation value u[SCALE_X] is the X scale value etc. */ }