written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University > mechanical engineering > Sem 7 > CAD/CAM/CAE
Marks: 8 Marks
Year: May 2016
written 7.9 years ago by | modified 2.8 years ago by |
Mumbai University > mechanical engineering > Sem 7 > CAD/CAM/CAE
Marks: 8 Marks
Year: May 2016
written 7.9 years ago by |
This mapping or transformation involves developing formulas that start with a point in the world window, say (xw, yw). The formula is used to produce a corresponding point in viewport coordinates, say (xv, yv). We would like for this mapping to be "proportional" in the sense that if xw is 30% of the way from the left edge of the world window, then xv is 30% of the way from the left edge of the viewport. Similarly, if yw is 30% of the way from the bottom edge of the world window, then yv is 30% of the way from the bottom edge of the viewport. The picture below shows this proportionality.
Using this proportionality, the following ratios must be equal.
$\dfrac{xv-xv_{\min}}{xv_{\max}-xv_{\min}} = \dfrac{xw-xw_{\min}}{xw_{\max}-xw_{\min}} \\ \dfrac{yv-yv_{\min}}{yv_{\max}-yv_{\min}} = \dfrac{yw-yw_{\min}}{yw_{\max}-yw_{\min}} \\ \text{The translation factors (Tx, Ty) would be:} \\ t_x=\dfrac{xw_{\max}xv_{\min}-xw_{\min}xv_{\max}}{xw_{\max}xw_{\min}} \\ t_y=\dfrac{yw_{\max}yv_{\min}-yw_{\min}yv_{\max}}{yw_{\max}yw_{\min}}$
The position of the viewport can be changed allowing objects to be viewed at different positions on the Interface Window. Multiple viewports can also be used to display different sections of a scene at different screen positions. Also, by changing the dimensions of the viewport, the size and proportions of the objects being displayed can be manipulated. Thus, a zooming affect can be achieved by successively mapping different dimensioned clipping windows on a fixed sized viewport.