Important Questions and Answers on Computer Graphics and Animation – Part 1

 what is computer graphics?

Ans:

Computer graphics is generally regarded as a branch of computer science that deals with the theory and technology for computerized image synthesis.

Describe RGB color model:




Given this RGB color model an arbitrary color within the cubic color space can be specified by its color coordinates: (r, g, b). For example, we have (0,0,0) for black, (1, 1, 1) for white.

R+G = yellow(1,1,0) 

B+G = cyan(0,1,1)

R+B= magenta(1,0,1) 


Scan Convertion:

Scan convertion is the process of converting geometric representations of graphics objects (like lines, circles, polygons) into a collection of pixels that can be displayed on a screen.

Scan converting a point




Scan converting a line:



A simple approach to scan-converting a line is to first scan-convert P₁ and P₂ to pixel coordinates (x1,y1) and (x2,y2), respectively; then set m = (y2-y1)/(x2-x1) and b = y-mx. If m ≤ 1, then for every integer value of x between and excluding x₁ and x2, calculate the corresponding value of y using the equation and scan-convert (x, y). If [m] > 1, then for every integer value of y between and excluding y, and , calculate the corresponding value of x using the equation and scan-convert (x, y).


Bresenham's line algorithm

Now consider the difference between these two distance values: s - t. When s - t is less than zero, we have s < t and the closest pixel is S. Conversely, when s-t is greater than zero, we have s > t and the closest pixel is T. We also choose T when s -t is equal to zero.



Math:






No comments

Theme images by hdoddema. Powered by Blogger.