1 / 26

Computer Graphics OpenGL Continued...

Computer Graphics OpenGL Continued. C o m p u t e r G r a p h i c s. OpenGL state settings :. Many characteristics of graphical objects can be affected by the setting of various state variables in OpenGL. Color of objects to be drawn is one example: glColor3f(1.0, 0, 1.0);.

Télécharger la présentation

Computer Graphics OpenGL Continued...

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer GraphicsOpenGL Continued... Computer Graphics

  2. OpenGL state settings: Many characteristics of graphical objects can be affected by the setting of various state variables in OpenGL Color of objects to be drawn is one example: glColor3f(1.0, 0, 1.0); glColor3ub(255,0,255);

  3. s Stroke text - vertices, line segments and curves used to outline each character. Easily scaled. Raster text - each character is basically a small image (pixels). Rapidly rendered by bit-block-transfer (BITBLT) into the frame buffer. Text as primitive objects : • There are two forms of text in graphics: • Stroke • Raster

  4. Drawing text in OpenGL : OpenGL does not provide a text drawing primitive since stroke and raster characters can be created from other primitives GLUT provides a few stroke and raster character sets. glutBitmapCharacter (GLUT_BITMAP_8_BY_13, 'c'); glutStrokeCharacter (GLUT_STROKE_MONO_ROMAN, 'c');

  5. OpenGL object attributes: An attribute is a property that determines how a primitive will be displayed Point: color, size Line: color, thickness and type Polygons: attributes to specify filling

  6. OpenGL:color RGB system is a three color ADDITIVE COLOR MODEL each color is specified in terms of Red, Green, and Blue intensities

  7. BLUE (0,0,1) CYAN (0,1,1) MAGENTA (1,0,1) GREEN (0,1,0) RED (1,0,0) YELLOW (1,1,0) RGB color model

  8. OpenGL:color RGB system is a three color ADDITIVE COLOR MODEL each color is specified in terms of Red, Green, and Blue intensities glColor3f(R,G,B); // where R, G, & B are in the range [0.0..1.0] we can use 4 parameters R,G,B,A glColor4f(R,G,B,A); where A=0.0 is transparent and A=1.0 is opaque

  9. OpenGL:color glClearColor(1.0, 1.0, 1.0 ,1.0); // defines the clearing color (R,G,B) as // opaque white glClear(); // then clears the window

  10. - Use a table of RGB values indexed by a k-bit number allows 2 colors - This is called a color-lookup table k OpenGL:indexed color

  11. 0 0 0 255 255 0 0 0 0 128 255 0 255 128 0 ... 0 0 0 255 0 0 0 255 255 0 255 255 0 0 0 0 0 255 0 0 0 128 255 255 OpenGL:indexed color index color 0 1 2 3 4 5 6 7 8 9 10 11 ... 255

  12. Creation of a 3D View Mapping a 3D view onto a 2D screen requires: • specifying a projection model • specifying viewing parameters • 3d clipping • projection and display

  13. 3D Projection “defined by straight projection of rays emanating from a center of projection (COP), passing through each point in the object and intersecting the projection plane.”

  14. Planar Geometric Projection Perspective - has a finite COP Parallel - has an infinite COP

  15. Planar Geometric Projection Perspective - has a finite COP

  16. Planar Geometric Projection Perspective : - has a finite COP - foreshortening yields more realistic images - less suitable for measurement of exact shape and relative size

  17. Planar Geometric Projection Parallel - has an infinite COP

  18. Planar Geometric Projection Parallel : - has an infinite COP, sometimes referred to by DOP (direction of projection) - yields less realistic images - more suitable for measurement of exact shape and relative size

  19. Parallel Projection Orthographic - projection plane is parallel to a principal face of the object Axonometric - projectors are normal to the projection plane but can have any orientation with respect to the object Oblique - the projectors form any angle with the viewing plane

  20. Parallel Projection Orthographic - projection plane is parallel to a principal face of the object

  21. Parallel Projection Orthographic - projection plane is parallel to a principal face of the object FRONT TOP SIDE

  22. Perspective Projection One point Two point Three point Depends upon how many of the principal faces of the object are parallel to the viewing plane

  23. Perspective Projection One point

  24. Perspective Projection Two point

  25. Perspective Projection Three point

More Related