Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Raster Devices Transformations Areg Sarkissian.

Similar presentations


Presentation on theme: "Computer Graphics Raster Devices Transformations Areg Sarkissian."— Presentation transcript:

1 Computer Graphics Raster Devices Transformations Areg Sarkissian

2 Raster Devices Most displays used for computer graphics are raster displays. The surface of raster displays has a certain number of pixels that it can show, such as 640 X 480 ~ 307,000 pixels All raster displays have a built-in coordinate system that associates a given pixel in an image with a given physical position on the display surface. The horizontal coordinate Sx increases from left to right, and the vertical coordinate Sy increases from top to bottom. They have an upside-down coordinate system. (0,0) (639,0) (0,479) Consist of three main parts: 1) Frame Buffer 2) Scan Controller 3) Digital to Analog Converter (DAC)

3 Frame Buffer A region of memory sufficiently large to hold all of the pixel values for display. A graphic card that is installed in a personal computer actually houses the memory required for the frame buffer. The display memory can be thought of a two dimensional array: mem[x][y]

4 Scan Controller & DAC The scan controller causes the frame buffer to send each pixel through a converter to the appropriate physical spot on the display surface. The scan controller addresses one pixel value, mem[x][y], in the frame buffer at the same time it addresses one position, (x, y), on the face of CRT. The converter takes a pixel value such as 010010 and converts it to the corresponding quantity that produces a spot for each red, green, and blue colors on the display. The dots are so close together that eye sees one composite dot and a single color that is the sum of the three component colors. Thus, the composite dot can be made glow in a total of 4x4x4=64 different colors.

5

6 Scan Controller & DAC Some of the more expensive systems have a frame buffer that support 24 planes of memory. Each of the DACs has eight input bits, so there are 256 level of red, green, blue. (16 million colors) Monochrom A single DAC converts pixel values in the frame buffer to voltage levels, which drive a single electron-beam gun. Note that 6 planes in frame buffer give 64 levels of gray.

7 Indexed Color and the Lookup Table A color lookup table (LUT), which offers a programmable association between a pixel value and the final displayed color The color depth is again six, but the 6 bits stored in each pixel go through an intermediate step before they drive the CRT. These bits are used as an index into a table of 64 values (LUT[0]…LUT[63]) Each LUT[i] contains a 15-bit value, which every five bits drives corresponding DAC. (Red, Green, Blue) The set of 2^15 possible colors that the system is capable of displaying is called its palette, so the palette for this system is 32K colors Since LUT has only 64 bits index, so it can only show 64 different color at a time on the screen.

8 Indexed Color

9 Coordinates Translation Usually the upside-down coordinates of raster displays are translated to a more familiar coordinates (Cartesian Coordinates) in programming languages, such as OpenGL. x y (0, 0)

10 Transformations Transformations are very useful in computer graphics in a number of situations: A scene can be fashioned by placing a number of instances of an object at different places and with different sizes using proper transformation. A single motif can be designed and then fashion the whole shape of an object by reflection, rotation, and translation of the motif. (ex. Snowflake) Helps a designer to view an object from different vantage points and make a picture from each one. In a computer animation, several objects must move relative to one another from frame to frame.

11 Transformations A transformation alters each point P in space (2D or 3D) into a new point Q by means of a specific formula or algorithm. An arbitrary point P in the plane is mapped to another point Q. We say that Q is the image of P under the mapping T. An object is being transformed by transforming each of its points using the same function T(P) for each point. Points are represented as: P Q=T(P) y x z P y x

12 Affine (or Linear) Transformations Types of Affine Transformations: Translation Scaling Reflection Rotation An affine transformation is represented by matrices.

13 Translation Translates a picture into a different position on a graphics display. The translation part of the affine transformation arises from the third column of the matrix for 2D and forth column for 3D. 2D3D Example: 2D translation 

14 Scaling Changes the size of a picture and involves two scale factors Sx and Sy for the x- and y-coordinates (Qx, Qy) = (SxPx, SyPy) Thus, the matrix for scaling is simply: Example: 2D 3D

15 Reflection If a scale factor is negative, then there is also a reflection about a coordinate axis. About x-axisAbout y-axis P Q=T(P) Example: reflection about x-axisx

16 2D Rotation The rotation of a figure about a given point through some angle. The matrix for 2D rotation about origin: Example: P=(x, y) and Q=T(P) P 60

17 3D Rotation The 3D rotation matrices about each coordinate: About x-axis (x-roll) About y-axis (y-roll) About z-axis (z-roll)

18 Rotation about an arbitrary point The result of this rotation will be product of three matrices. Step 1) Translation (a, b) to (0, 0) Step 2) Rotation point P about origin (0, 0) Step 3) Translation (0, 0) to (a, b) Example: (a, b) is an arbitrary point and P=(x, y) Step 1Step 2Step 3 (a, b) T(P)=Q P (0,0)

19 References Computer Graphics – Using OpenGL F.S Hill, Jr


Download ppt "Computer Graphics Raster Devices Transformations Areg Sarkissian."

Similar presentations


Ads by Google