An analysis of OpenGL graphics development under Delphi

Source: Internet
Author: User

OpenGL was originally a specification of the underlying graphics library developed by the silicon Graphic company. The part of your system that accurately implements this specification, usually called OpenGL Drive, allows you to use a geometric set (dots, lines, polygons, images, and so on) to describe the scene you wish to perform. Medium-scale scenarios, which allow the naked eye to look comfortable, are usually implemented at a millisecond speed, which means that the library file has enough power to support you in creating a vibrant virtual world.

OpenGL drivers are generally provided as binary library files. It can be dynamically connected to your program. On the Windows platform, it will be the form of a DLL (check opengl.dll in your system directory). Since Delphi can start with any DLL, its ability to program OpenGL 3D is as easy as any other language. This article will help you gain an effective knowledge of OpenGL development in Delphi.

Mathematical Foundation

OpenGL has a strong mathematical foundation, so the limits to its functionality depend entirely on your imagination (translator: Nothing can be done, only unexpected). For the understanding of those axioms and lemma, it is better to let us know immediately a simple 3D coordinate system, which is the usual coordinate system in 3D programming. As follows:

How do you understand where your screen (the blue box) is placed in the scene? The point that emits four rays and forms the screen is the view in the imaginary space. OpenGL lets you call two simple functions to define this scene

glMatrixMode(GL_PROJECTION);
glFrustum(-0.1, 0.1, -0.1, 0.1, 0.3, 25.0);

The -0.1,0.1,-0.1,0.1 in this call defines the upper-left and lower-right coordinates of the visual screen, 0.3 specifies the distance from the viewport to the screen (as if the "near Clipboard" (near clipping plane)) and 25.0 specifies "far clipboard" (far Clipping plane). Any object near the front of the Clipboard and objects behind the Clipboard will not be visible. Of course, you can fiddle with these numbers to make them fit the scene you need.

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.