Computer Graphics: Raster Graphics, Image Formation, Color,2D Viewing

Computer Graphics: Raster Graphics, Image Formation, Color,2D Viewing

Overview Computer Graphics: Graphics Architecture Raster Graphics Raster Graphics, Image Formation, Image formation Color,2D Viewing, First Graphics Human visual system Pinhole camera model Program Synthetic camera Gerda Kamberova Graphics API (object-viewer-projection) Color Physics of color 3-color theory and display technology Human color perception RGB color model in CG Indexed color model GK, Intro 2 Computer Graphics 1 GK, Intro 2 Computer Graphics 2 Overview (cont) Graphics Standard 2D Viewing Goal: portability, standard graphics functions Clipping window are independent of programming language, bindings are defined for various languages Viewports GKS, PHIGS, OpenGL, Java3D Window-to-viewport transformation The standard provides specifications for basic Simple graphics program graphics functions. To insure independence and portability, there is no standard for graphics interface to output devices, image formats, or transfer protocols GK, Intro 2 Computer Graphics 3 GK, Intro 2 Computer Graphics 4 Creating graphics and animation APIs and Device Independent Graphics Programming One way to create computer graphics is to use some higher level ready made package Using APIs makes it possible to create programs that can be Maya Alias|Wavefront compiled and run on many different graphics platforms. 3ds Max (http://www.discreet.com) Most APIs are basically libraries of routines that take care of standard tasks like rasterization, hidden surface removal, polygon 3D Blender (http://www.blender3d.com/) clipping, projections. The alternative approach is to “Do it yourself”. This is The APIs serve as intermediaries between Graphics application particularly useful in the design of special applications, e.g. writing the application layer and the hardware computer game engines and scientific visualization packages. It layer. One of their main functions is to helps to use an Application Programming Interface (API), for API layer facilitate rendering but they can provide example OpenGL, or Direct3D, or Java 3D. APIs are used with a high also higher level as well as lower level level programming language. functions. Hardware Often even “Do it yourself” graphics involves objects created with high level ready made packages, for example, the characters in a game may be designed with a modeling package and then the meshes are imported in the custom designed game engine. GK, Intro 2 Computer Graphics 5 GK, Intro 2 Computer Graphics 6 1 Different API levels Application Programs, OpenGL, OS, Hardware and Drivers Lower level APIs (e.g. the rendering APIs Dircect3D and OpenGL) deal directly with the rendering task. Application program window system components and libraries various of the Relationships On the other hand a higher level API like the scene graph Motiff, Other GUI GLUT API Java3D takes care of maintaining and organizing GLU information about the graphic scenes, illumination, and GLX, WGL, etc environment states but needs the help a rendering API to OpenGL complete the rendering task. OS +window system GL . The relationship between different APIs, the operating system, and the hardware layer are illustrated in the following two pages. Hardware GK, Intro 2 Computer Graphics 7 GK, Intro 2 Computer Graphics 8 Graphics Standard Application Programs, Java 3D, Direct3D, OpenGL, Hardware and Drivers General purpose API For use in high- level programming language By programmers Graphics application Graphics application Graphics application Java 3D Direct3D Direct3D OpenGL GDI GDI DDI Hal/Hel components DDI Lower level rendering Hal/Hel components Java Of MS Windows OS API (OpenGL, Direct 3D) of MS Windows OS Hardware Hardware Hardware GK, Intro 2 Computer Graphics 9 GK, Intro 2 Computer Graphics 10 Graphics Standard Object-Light-Viewer Light source API contains functions for creation, manipulation and display of images Object Basic building blocks: primitives and attributes 3D object is viewer, Geometric transformations light source Modeling transformations independent Viewing transformations Structuring/manipulating components hierarchically 2D image of the object observed by the viewer is dependent on the Control functions Viewer light source and on the viewer GK, Intro 2 Computer Graphics 11 GK, Intro 2 Computer Graphics 12 2 Pinhole Camera Human Visual System Small hole in the center of one side Film placed on opposite side Need long exposure GK, Intro 2 Computer Graphics 13 GK, Intro 2 Computer Graphics 14 www.pinhole.com Pinhole Camera Model c Models geometry of image formation Image (projection) plane Optical center, C Focal length, d Projection: image of a point is a point Infinite Depth of Field: every point within field of view is in focus In basic computer graphics, all objects are in focus GK, Intro 2 Computer Graphics 15 GK, Intro 2 Computer Graphics 16 Synthetic Camera Model: simulates pinhole camera Real Camera • Place optical (projection) center behind projection plane, so image is not inverted Creating a computer generated image is similar to forming an image using an optical system Center of Projection Projection Plane GK, Intro 2 Computer Graphics 17 GK, Intro 2 Computer Graphics 18 3 Graphics Systems Synthetic Camera: clipping window Most API are based on the synthetic camera model They provide functions to specify Objects (defined by sets of primitives and attributes) Viewer Make image finite dimensions by placing Projection type Clipping Rectangle/Window in the projection Camera position plane Camera orientation The clipping rectangle acts as a window through Focal length (effects image size) which a viewer located at center of projection Image plane size (clipping rectangle) observes the world. GK, Intro 2 Computer Graphics 19 GK, Intro 2 Computer Graphics 20 2D Viewing: Window to Viewport transformation Viewing/clipping Window-to-viewport transformation window: part of projected image that is being viewed. In view/projection Range map: given values in range A, map coordinates them linearly in range B Viewport: part of X- r window (output window) A = [A min, A max] B = [B min, B max] where the viewing window is mapped. In A min <= a <= A max normalized device coordinates (0 to 1). b = r(a) = (B max− B min)(a − A min) /(A max− A min) + B min Device independent. Screen (device specific) coordinates, integers. GK, Intro 2 Computer Graphics 21 GK, Intro 2 Computer Graphics 22 Window to viewport transformation (4-11) 2D Viewing: window to screen coordinates (4-130) World coordinates Normalized Screen coord. Device coord. (device spec.) From world/view coordinates to NDC space Simply 2D case of range map Apply range map in x and y independently (1,1) Wx max,Wy max Vx max,Vy max Wx min,Wy min Vx min,Vy min (0,0) NDC space GK, Intro 2 Computer Graphics 23 GK, Intro 2 Computer Graphics 24 4 Aspect Ratio Coordinate systems used Aspect Ratio of a rectangle is the ratio of the Modeling coordinates: for specifying an object rectangle’s width to its height World coord.: for placing the object in a scene Viewing (eye) coord.: with respect to a coordinate system attached to the camera Clipping coord.: with respect to clipping window Normalized device coordinates: 2D, after projection, but device independent Adjust height & width of viewport to match the Physical device coordinates aspect ratio of viewing window. GK, Intro 2 Computer Graphics 25 GK, Intro 2 Computer Graphics 26 Graphics Pipeline Transformations and Color Coordinate Systems Light is electromagnetic radiation Visible light, 350 (blue) – 780 (red) nm Color light is characterized by a distribution C(λ) Monochromatic light – single frequency GK, Intro 2 Computer Graphics 27 GK, Intro 2 Computer Graphics 28 Color Attributes Three-color Theory Color is characterized also by attibutes Color is described as aditive mixture of 3 primary colors, C = T 1R + T 2G + T 3B Hue, dominant wavelength R,G,B , the coefficients are called Brightness, intensity tristimulus values Saturation, purity Tristimulus values – determine the intensities of the Chromaticity, hue and saturation primary colors Color on CRT display is created by exciting Three-color theory is based on popular theory, R,G,B phosphor. This approach is based on Thrichromatic theory, of human color perception the three-color theory GK, Intro 2 Computer Graphics 29 GK, Intro 2 Computer Graphics 30 5 Trichromaticity of color matching Trichromatic Theory of Human Color Perception Rushton:”…color vision is mediated by 3 different kinds of retinal receptors, each responding best to light from different part of the visible spectrum.” Each receptor is characterized by a sensitivity curve. By adjusting the radiance of the three lights of primary colors, R,G,B, match the fourth color, C. Color perception is facilitated by the cones in the Match is measured by the level of excitement of the photo receptors in retina. There 3 types of pigments in the cones. the cones of the retina The trichromatic theory is based on empirically The trichromatic theory predicts if two colors will look alike to an established trichromaticity of color matching objective viewer, but it does not characterized how actually the colors will look to an observer. The theory is proven wrong by Land, 1977. Color perception is subjective. It is not related solely to the wavelength (physics) of the light. GK, Intro 2 Computer Graphics 31 GK, Intro 2 Computer Graphics 32 Color in Computer Graphics RGB Color Model Based on the tricolor theory Color is described usually

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us