×
YOU DID NOT WAKE UP TODAY TO BE MEDIOCRE.
--Your friends at LectureNotes

Note for Computer Graphics - CG By SAHELI BASU

• Computer Graphics - CG
• Note
• 12 Views
• Uploaded 8 months ago
0 User(s)

Text from page-1

PROBLEM DEFINITION Viewing transformation is the mapping of a part of a world-coordinate scene to device coordinates. Mapping a window onto a viewport involves converting from one coordinate system to another .Here we discuss about the topic: Windows to Viewport Coordinate Transformation . Abstract To find the transformation matrix that maps the window in world coordinates to the viewport in screen coordinates. Introduction Screen Coordinates: The coordinate system used to address the screen (device coordinates). World Coordinates: A user-defined application specific coordinate system having its own units of measure, axis, origin, etc. Window: The rectangular region of the world that is visible. Viewport: The rectangular region of the screen space that is used to display the window. Literature review A series of three computer operations converts world coordinates to pixel positions on the screen . Methods The overall transformation process: 1. Translating the window to the origin. 2. Then Scaling it to the size of the viewport. 3. Translating it to the viewport location. From above figure, Coordinate Units of Window = (xw, yw) Coordinate Units of Viewport = (xv, yv) Where, xw = X-coordinate in window xv = X-coordinate in viewport yw = Y-coordinate in window yv = Y-coordinate in viewport Now, let us map (xw,yw) to the (xv,yv).So when mapping takes place then the relative places (positions) in Two areas (window and Viewport) are the same. xwmin = Minimum X-coordinate value in window xwmax = Maximum X-coordinate value in window ywmin = Minimum Y-coordinate value in window ywmax = Maximum Y-coordinate value in window xvmin = Minimum X-coordinate value in viewport xvmax = Maximum Y-coordinate value in viewport yvmin = Minimum X-coordinate value in viewport yvmax = Maximum Y-coordinate value in viewport To maintain same relative position, we need (xv- xvmin)/( xvmax– xvmin) = (xw- xwmin)/( xwmax– xwmin) — Eq 1 (yv- yvmin)/( yvmax– yvmin) = (yw- ywmin)/( ywmax– ywmin) — Eq 2

Text from page-2

From the above equations, we need to find out the values for Viewport coordinate points (xv,yv).Remember above Eq 1 and Eq 2,since without which we cannot get Viewport mapping coordinate units. Mapping xw to xv: From Eq 1, (xv- xvmin) = [( xvmax– xvmin)/( xwmax– xwmin)] * (xw- xwmin) Where, Scaling factor ∆x = [( xvmax– xvmin)/( xwmax– xwmin)] Therefore, xv = {∆x * (xw- xwmin)} + xvmin Mapping yw to yv: From Eq 2, (yv- yvmin) = [( yvmax– yvmin)/( ywmax– ywmin)] * (yw- ywmin) Where, Scaling factor ∆y = [( yvmax– yvmin)/( ywmax– ywmin)] Therefore, yv = {∆y * (yw- ywmin) } + yvmin DISCUSSION & CONCLUSION When scaling factors same ∆x = ∆y, we can say that relative proportions of Objects are maintained. Generally a simple window to viewport mapping concerning Character strings, keep up a constant character size irrespective of the viewport area (may be increased or decreased) and this is used generally when character font cannot be changed. If characters formed with line wise segments then this window to viewport mapping can be conveyed as a sequence of line transformations. This mapping is referred as Window to viewport mapping. BIBLIOGRAPHY • https://bit.ly/2S5cxSh • https://bit.ly/2zjy8zr

Text from page-3

FILE TRANSFER PROTOCOL 3RD SEMESTER BCA 303 ROLL NO.S:1820055 – 1820063 MINI PROJECT

Text from page-4

GROUP MEMBER LIST SERIAL NO. ROLL NO. NAME 1 1820055 RIDAM CHAKRABORTY 2 1820056 RISHAB OJHA 3 1820057 RITAM CHAKRABORTY 4 1820058 RIYAMI DUTTA 5 1820059 RIYANKA DHAR 6 1820060 ROHAN ROY 7 1820061 ROUNAK PAL 8 1820062 SAHELI BASU 9 1820063 SANJAY MARDI