Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1 Computer Graphic. People remember 10% of what they read 20% of what they hear 30% of what they see 50% of what they hear and see 80% of what.

Similar presentations


Presentation on theme: "Lecture 1 Computer Graphic. People remember 10% of what they read 20% of what they hear 30% of what they see 50% of what they hear and see 80% of what."— Presentation transcript:

1 Lecture 1 Computer Graphic

2 People remember 10% of what they read 20% of what they hear 30% of what they see 50% of what they hear and see 80% of what they hear, see and say 90% of what they hear, see, say and touch

3 What is Computer Graphics? A field of study that deals with the pictures generated by a computer and the tools used to make and present them. 1. Information becomes more communicative when its represented graphically 2.A huge number of numbers may be replaced by a simple graph or chart diagram 3. visual form of data may be more relevant to realize their characteristics 4. creation of engineering designs and architectural blue-print may be fully automated 5.Mathematical models of hyperspace can be easily realized using computers 6.Using motion dynamics simulation experiments of moving objects can be performed Some of major advantages of computer graphics

4 Operations of Computer Graphics 1. Creation of elementary objects: The fundamental element of any graphical object is a pixel or picture element. Its an isolated a black or colored dot. 2. Creating Basic Shapes: Basic shapes are components of object boundaries. These can be defined by mathematical functions. Examples include line segments, circle, triangle, rectangular,etc 3. Creating solid objects: Solid boundaries in 2D or 3D can be produced by combining above-mentioned components. 4. Sizing and positioning: using geometrical transformations, object or their parts can be resized, and their position and orientation can be changed. Geometrical operations includes translation, rotation, scaling, reflection, shearing,etc

5 5. Projection on 2D: Projection is a specific transformation that converts 3D object description into its 2D representation. 6. Shading and coloring : To give a real look to the objects rendering process are applied.For a black and white objects this method is called shading, and for colored objects it is called coloring and rendering. 7. Viewing and clipping : sometime only a part of object(s) needs to be viewed. This done by viewing and clipping. Objects can be zoomed in and out. 8.Hidden surface elimination: real objects do not show their back surfaces so while producing object surfaces from their mathematical representations, we need to eliminate the back surface

6 Basic Graphics System Input devices Output device Image formed in frame buffer

7  Powerful processor to perform primitive graphical operations  Memory (Frame buffer memory )  Input devices eg. mouse, keyboard (trackball, joystick, etc )  Output devices eg., monitor, screen, audio (multiple screens, HMD, multiple speakers)  A complete computer system consists of many components  We shall focus on video display devices Graphic System INPUTPROCESSING DISPLAY/ OUTPUT Mouse Tablet and stylus Force feedback device Scanner Live video streams Screen Paper-based printer Video recorder Projector VR/AR headset Memory

8 Overview of Graphics Systems Images Hardware ◦Input Systems ◦Output Systems Software ◦OpenGL

9 Two Dimensional Images  Images (at least the ones in this class) are two dimensional shapes.  The two axes we will label as X (horizontal), and Y (vertical). X Axis Y Axis (0,0) +X +Y

10 Hardware Pipeline InputOutputComputation We want to draw a rectangle, how do we describe it to a computer? Model (n) - object description that a computer understands.

11 Partition the space (7,3) (7,9) (14,3) (14,9) 1. Define a set of points (vertices) in 2D space. 2. Given a set of vertices, draw lines between consecutive vertices.

12 Record every position Bitmap - a rectangular array of bits mapped one-to-one with pixels.

13 Position relative Vector display system - graphical output system that was based on strokes (as opposed to pixels). Also known as: random, calligraphic, or stroke displays.

14 Representing Objects Most common method is the VERTEX method. Define the object as a set of points with connectivity information. Why is connectivity important? Connectivity - information that defines which vertices are connected to which other vertices via edges. Edge - connects two vertices

15 Model file for rectangle v 4 e 4 7 3 7 9 14 9 14 3 1 2 2 3 3 4 4 1 (7,3) (7,9) (14,3) (14,9)

16 Input Devices Locator Devices Keyboard Scanner –Images –Laser Cameras (research)

17 Computation Stage Now that we have a model of what we want to draw, what goes on inside the computer to generate the output? InputOutputComputation Transformations Rasterization

18 Computation Stage Computation Transformations Rasterization Model Transformed Model Output

19 How do we store this? We would like to allocate memory to hold the results of the computation stage.

20 Framebuffer Framebuffer - A block of memory, dedicated to graphics output, that holds the contents of what will be displayed. Pixel - one element of the framebuffer

21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Framebuffer How big is the framebuffer? What is the largest image you can display? How many pixels are there? How much memory do we need to allocate for the framebuffer?

22 Framebuffer in Memory If we want a framebuffer of 640 pixels by 480 pixles, we should allocate: framebuffer = 640*480 bits How many bit should we allocate? Q: What do more bits get you? A: More values to be stored at each pixel. Why would you want to store something other than a 1 or 0?

23 Framebuffer bit depth How many colors does 1 bit get you? How many colors do 8 bits get you? –Monochrome systems use this (green/gray scale) What bit depth would you want for your framebuffer? bit depth - number of bits allocated per pixel in a buffer

24 Framebuffer bit depths Remember, we are asking “how much memory do we allocate to store the color at each pixel?” Common answers: –16 and 32 bits

25 Bit depths 16 bits per pixel (high color) –5 bits for red, 5/6 bits for green, 5 bits for blue –potential of 32 reds, 32/64 green, 32 blues –total colors: 65536 32 bits per pixel (true color) –8 bits for red, green, blue, and alpha –potential for 256 reds, greens, and blues –total colors: 16777216 (more than the eye can distinguish) Let’s look at Display Control Panel

26 Memory unsigned byte framebuffer[640*480*3]; framebuffer = [255 255 255 0 0 255 0 0 255 0 255 0 255 0 0 0 255 0 0 255 0 …]

27 Graphic Card Memory How much memory is on our graphic card? –640 * 480 * 32 bits = 1,228,800 bytes –1024 * 768 * 32 bits = 3,145,728 bytes –1600 * 1200 * 32 bits = 7,680,000 bytes How much memory is on your graphics card? As a side note: PlayStation 1 has 2 MB RAM. How do they do it? What is the TV resolution? 1 bit alpha, no z buffer.

28 Output We have an image (framebuffer or model), now we want to show it. Display –Vector –Raster Scan InputOutputComputation

29 Framebuffer -> Monitor The values in the framebuffer are converted from a digital (1s and 0s representation, the bits) to an analog signal that goes out to the monitor. A video card’s RAMDAC performs this operation, once per frame. This is done automatically (not controlled by your code), and the conversion can be done while writing to the framebuffer.

30 Pixels Pixel - The most basic addressable image element in a screen –CRT - Color triad (RGB phosphor dots) –LCD - Single color element Screen Resolution - measure of number of pixels on a screen (m by n) –m - Horizontal screen resolution –n - Vertical screen resolution

31 Raster Displays Cathode Ray Tubes (CRTs), most “tube” monitors you see. Very common, but big and bulky. Liquid Crystal Displays (LCDs), there are two types transmissive (laptops, those snazzy new flat panel monitors) and reflective (wrist watches).

32 Cathode-ray tubes (CRT) Base Connector Pins Y deflect x deflect Phosphor Electron Gun Focusing System Control grid voltage

33 Cathode Ray Tubes (CRTs) Heating element on the yolk. Phosphor coated screen Electrons are boiled off the filament and drawn to the focusing system. The electrons are focused into a beam and “shot” down the cylinder. The deflection plates “aim” the electrons to a specific position on the screen.

34 scan line - one row on the screen interlace vs. non-interlace - Each frame is either drawn entirely, or as two consecutively drawn fields that alternate horizontal scan lines. vertical sync (vertical retrace) - the motion of the beam moving from the bottom of the image to the top, after it has drawn a frame. refresh rate - how many frames are drawn per second. Eye can see 24 frames per second. TV is 30 Hz, monitors are at least 60 Hz. Beam Movement

35

36 Graphics Types Vector Graphics Specify the content of the image using Primitive shapes such points, lines, circles, etc. Their size Their positions Resolution independent Has to be translated into a raster image before displayed (rendering) OpenGL, SVG, PS, VRML, etc. Raster Graphics Specify the content as a 2D array of pixels (picture elements) Resolution dependent Often provides rich details Bmp, gif, jpeg, etc.

37 Vector stands for line. A set of line drawing instructions are stored in memory The electron beam is directed only to parts of the screen where the picture is to be drawn. Random-Scan (Vector) displays MoveTo (300,800) LineTo (700,800) LineTo (500,300) LineTo (300,800)

38 Raster Scan Displays Developed in the early seventies. It is today's dominant hardware technology. Almost all graphics systems are raster-based. raster A picture is produced as an array – the raster – of picture elements. Pixels This elements are called Pixels or Pels (Picture Elements). A pixel corresponds to a location, or small area, in the image. refresh bufferframe buffer Collectively, the pixels are stored in a part of memory called the refresh buffer or frame buffer.

39 Refresh Rate Definition: Definition: The number of times per second the image is redrawn. refresh rate The entire contents of the frame buffer are displayed on the CRT at a rate high enough to avoid flicker. This rate is called the refresh rate. For a human to see a steady image on most CRT displays, the same path must be retraced, or refreshed, by the beam at least 60 times per second. Current raster-scan displays perform refreshing at the rate of 60 to 80 frames per second, although some systems now have refresh rates of up to 120 frames per second. Refresh rates are described in units of cycles per second, or Hertz (Hz), where a cycle corresponds to one frame (i.e. a refresh rate of 60 frames per second = 60 Hz).

40 The Frame Buffer x y 0 0800 600 Display surfaceFrame buffer at (800,600) pixel at address (x,y)

41 Some Applications Of Computer Graphics Some of the application areas which make heavy use of computer graphics are: Computer aided design Scientific visualisation Films Games Virtual/Augmented Reality NOTE: There are lots more and there is huge overlap between these different areas

42 Computer Aided Design ( CAD )

43 GAME

44 Film

45 Scientific Visualization

46 Virtual/Augmented Reality


Download ppt "Lecture 1 Computer Graphic. People remember 10% of what they read 20% of what they hear 30% of what they see 50% of what they hear and see 80% of what."

Similar presentations


Ads by Google