Introduction to OpenGL and introduction to programming

Source: Internet
Author: User

To be precise, OpenGL is called the high-performance graphics algorithm industry standard. Write all to open graphics library. It is the most widely accepted 2D/3D graphics API in the industry. Is a specification that defines a cross-programming language and cross-platform programming interface. It is used for three-dimensional images (two-dimensional ). Applications: CAD, content creation, energy, entertainment, game development, manufacturing, pharmaceutical, and virtual reality. DirectX leads the world in the graphic programming field in the home market, but OpenGL cannot be replaced in the professional and high-end graphics field. Note: OpenGL is only a graphical function library. DirectX contains graphics, sound, input, network, and other modules. Development Company: SGI OpenGL programming entry: OpenGL is very convenient, so it is increasingly popular, but for many people, it is on a microcomputer, the first problem encountered is how to adapt to the microcomputer environment. This is often the most critical step, although it is also the initial one. Generally, I do not recommend using the glut package. in this way, it is difficult to make full use of the functions on the Windows interface. openGL programming steps in the VC environment: Create an OpenGL-based application framework to create a project: Create a project in File> New, add a library based on the single document, View Class Based on the cview: in Project-> setting, specify the library initialization: select View-> Class Wizard to open the MFC dialog box, and add the corresponding definition. Adding class members indicates that the OpenGL-based program framework has been constructed, in the future, you only need to add the program code to the corresponding function. OpenGL features and functions: OpenGL is an open 3D graphics software package, which is independent of the window system and operating system, applications developed based on it can be easily transplanted between various platforms. OpenGL can work closely with Visual C ++ to implement computation and graphics algorithms of robots, it ensures the correctness and reliability of the algorithm. OpenGL is easy to use and efficient. It has seven functions: 1. modeling: In addition to providing basic points, lines, and polygon drawing functions, the OpenGL graphics library also provides complex 3D objects (such as balls, cones, polygons, and teapot) and Complex Curve and surface rendering functions. 2. Transformation: the transformation of OpenGL graphics library includes basic transformation and projection transformation. Basic transformations include four types of transformations: translation, rotation, and ratio of variation image. projection transformations include two types: Parallel projection (also called normal projection) and Perspective Projection. The transformation method reduces the running time of the algorithm and improves the display speed of 3D images. 3. color mode setting: There are two OpenGL color modes: rgba mode and color index ). 4. Illumination and material settings: OpenGL light includes emitted light, ambient light, diffuse light, and specular light ). The material is represented by light reflectivity. In scene (scene), the object eventually reflects the human eye color, which is formed after the red, green, and blue components of light are multiplied by the reflectivity of the red, green, and blue components of the material. 5: texture mapping ). The OpenGL texture ing function can be used to express the surface details of objects in a realistic manner. 6: In addition to basic copying and pixel reading and writing, the bitmap display and image enhancement functions also provide blending, antialiasing, and fog functions) special image processing. The above three items can make the simulated objects more realistic and enhance the graphic display effect. 7: double buffering (dual cache) Dual cache is the front-end cache and the back-end cache. In short, the background cache computing scenario and generated screen are displayed, and the front-end cache displays the pictures that have been cached in the back-end. In addition, OpenGL can be used to implement special effects such as depth cue and motion blur. Thus, the Blanking algorithm is implemented.

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.