Introduction to OpenGL

Source: Internet
Author: User
Tags win32

1, OpenGL Introduction

OpenGL is developed in recent years, a performance of the three-dimensional graphics standards, it is in SGI and other world-renowned computer companies under the initiative of the SGI GL three-dimensional graphics library based on a common shared open three-dimensional graphics standards. At present, including Microsoft, SGI, IBM, DEC, SUN, HP and other large companies have adopted OpenGL as a three-dimensional graphics standards, many software vendors have to OpenGL as the basis for the development of their own products, including more well-known products including animation production software soft Image and 3D Studio MAX, emulation software open inventor, VR software world Tool Kit, Cam software proengineer, GIS soft arc/info, and so on. It is worth mentioning that, as Microsoft offers OpenGL standards and OpenGL three-dimensional graphics accelerator cards in Windows NT and the latest Windows 95, OpenGL will be widely used in microcomputers, At the same time, for the vast number of users to use the computer can only be used on High-performance graphics workstations to run a variety of software opportunities.

2, OpenGL features and functions

OpenGL is actually an open three-dimensional graphics package, which is independent of the window system and the operating system, the application developed on its basis can be easily ported between various platforms; OpenGL can be tightly interfaced with Visual C + + to facilitate the calculation and graphics algorithms of the manipulator. It can guarantee the correctness and reliability of the algorithm, and the OpenGL is easy to use and high efficiency. It has seven main functions:

Modeling

    • In addition to providing basic point, line and polygon drawing functions, the OpenGL graphics library also provides complex three-dimensional objects (spheres, cones, polyhedron, teapot, etc.), as well as complex curves and surfaces (such as Bezier, NURBS, etc.) drawing functions.

    • Transform

      The transformation of OpenGL graphics library includes basic transformation and projection transformation. The basic transformation has four kinds of transformations, such as translation, rotation and change ratio, and the projection transformation has two transformations, which are parallel projection (also called orthographic projection) and perspective projection. The transformation method is consistent with the coordinate transformation method in robot kinematics, which is helpful to reduce the running time of the algorithm and improve the display speed of three-dimensional graphics.

    • Color Mode settings

      There are two OpenGL color modes, the RGBA mode and the color index.

    • Lighting and material settings

      OpenGL Light has radiant light (emitted Light), ambient light (ambient Light), diffuse reflective light (diffuse Light) and specular light (specular Light). The material is expressed by the light reflectivity. In the scene (Scene) The object is ultimately reflected in the color of the human eye is the color of the red, green and blue components of the light multiplied by the reflectivity of the red, green and blue components of the material.

    • Texture mapping (texture Mapping)

      Using the OpenGL texture mapping function, the surface details of the object can be expressed very realistically.

    • Bitmap Display and image enhancement

      In addition to basic copy and pixel reading and writing, image function also provides fusion (blending), anti-aliasing (antialiasing) and Fog (fog) special image effect processing. The above three articles are more realistic than the simulation and enhance the effect of graphic display.

    • Double cache animation (double buffering)

      Double cache is the foreground cache and the background cache, in short, the background cache calculation scene, generate screen, foreground cache shows the background cache has been painted good picture. In addition, the use of OpenGL can also achieve depth hint (Depth Cue), motion blur (Motion Blur) and other special effects. Thus, the blanking algorithm is realized.

3. OpenGL for Windows 95 graphics library

There are more than 100 functions in the OpenGL graphics library. There are 115 core functions, they are the most basic function, its prefix is the Gl,opengl utility library (OpenGL utility Library,glu) functions of a higher function, such as the mapping of complex curved surface, advanced coordinate transformation, polygon segmentation, a total of 43, Functions prefixed with the Glu;opengl Helper library (OpenGL Auxiliarylibrary,glaux) are special functions, including simple window management, input event processing, and some complex three-dimensional object rendering functions, a total of 31, with a prefix of aux.

In addition, there are six WGL functions that are important for OpenGL and Windows 95 window System joins, with a prefix of WGL, which is primarily used to create and select graphical Action description tables (RENDERINGCONTEXTS) and to display character bitmaps in any location within the window. These features are the only additions to OpenGL for Windows 95. In addition, there are five Win32 functions for processing pixel format (pixel formats) and dual caching. Since they are extensions to the WIN32 system, they cannot be applied to other OpenGL platforms.

4. OpenGL for Windows 95 program design

The design of OpenGL for Windows 95 is a little different from OpenGL for UNIX programming, and the key lies in how OpenGL is linked to the Windows system under different operating systems. If you call the OpenGL Helper Library window management functions, you do not have to consider these issues. The following is a brief introduction to the programming key for OpenGL under Windows 95.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.