Q.1.How can scaling with respect to a point P
) be defined in termsof scaling with respect to the origin?
Ans the matrix expression for scaling transformation of a position p=(x0,y0,z0)relative to the coordinate origin can be written asX’
sx 0 0 0 x0
Y’ 0 sy 0 0 y0Z’ = 0 0 sz 0 z01 0 0 0 1 1 P’=s.pWhere scaling parameters sx,sy,sz are assigned any positive values.X’=x.sxY’=y.syZ’=z.szScaling an object with transformation changes the size of object and repositionsthe object relative to coordinate origin. Also if the transformations parametersare not all equal,relative dimentions in the object are changed.we preserve theoriginal shape of the object with a uniform scaling(sx=sy=sz).Scaling about a fixed point P
) can be accomplished by the following:1. Translating P
to the origin2. Scaling the object3. Translating P
back to original position.
Develop a text clipping algorithm that clips individual charactersassuming that the characters are defined in a pixel grid of a specified size
With regard to the representation of characters, we can split clipping into
. Area clipping is used in the case where characters arerepresented by a bitmap, and line clipping is practical if characters arerepresented by lines. But, in the majority of cases we use characters composedfrom lines and curves, so-called vectors. Its advantage is that we can zoom or scale, without a loss of quality.