Traditional Culture Encyclopedia - Traditional stories - Three-dimensional graphic visualization technology
Three-dimensional graphic visualization technology
OpenGL(Open Graphics Libaray) is a graphics development system developed by SGI for its graphics workstation, which can be independent of window operation and hardware environment. Its purpose is to free users from specific hardware and operating systems. With this system, you don't need to know the structure and instruction system of these systems, but you can write applications in a specified format and execute them on any hardware platform that supports the language. Because of its high reusability, dozens of large companies have accepted OpenGL as the standard software interface. At present, members who have joined OpenGL ARB(OpenGL Architecture Review Committee) are SGI, HP, Microsoft, Intel, IBM, SUN, DEC, AT & amp; Unix software laboratory of t company, etc. With the efforts of this organization, OpenGL has become the industrial standard for high-performance graphics and interactive visual processing, which can be applied to Windows95/98, Windows NT, Windows 2K, Macos, Beos, OS/2 and Unix. The essence of OpenGL is as a software interface of graphics hardware, and it is a set of three-dimensional API functions.
The main functions of 1 OpenGL
(1) modeling. There are not only simple points, lines and surfaces, but also complex drawing functions for three-dimensional objects (balls, cones, etc.). ) and complex curves and surfaces (Bessel, Nurbs, etc. ).
(2) transformation. It mainly includes basic transformations (translation, rotation, etc.). ) and projection transformation (parallel and perspective projection, etc. ).
(3) Color mode setting. RGBA mode, ColorIndex color index.
(4) Lighting and material settings. OpenGL light includes radiation light, ambient light, diffuse reflection light and mirror light; The material is expressed by the reflectivity of light. The color that the objects in the scene finally reflect to the human eye is formed by the superposition of RGB components of light and RGB components of materials.
(5) Texture mapping. Mainly shows the details of the surface of the object.
(6) bitmap display and image enhancement. In addition to basic copying and image pixel reading and writing, the image function also provides special image processing effects such as blending, anti-aliasing and fogging.
(7) Double buffer animation. Double buffering refers to foreground buffering and background buffering. The background calculates the scene and generates a picture, and the foreground displays the calculated picture in the background.
(8) Interactive technology. It mainly provides three working modes: drawing mode, selecting mode and feedback mode. The drawing mode completes the drawing of the scene. With the help of geometric parameters and motion control parameters of objects, observation parameters of the scene, illumination parameters and material parameters, texture parameters, many constant control parameters of OpenGL functions, time parameters, window dialogs, menus and external devices, a real-time interactive program system can be formed. In the selection mode, you can name objects, select named objects and control the drawing of named objects. The feedback mode provides the information of the program operation for the program design, and can also be fed back to the user, telling the user the running state of the program and monitoring the running process of the program.
(9) others. Using OpenGL can also achieve special effects such as depth prompt and motion blur.
The basic principles of 2.2. OpenGL
OpenGL is the software interface of hardware generator. Its main purpose is to draw 2D and 3D objects into a frame buffer, which includes hundreds of graphics functions. Developers mainly use these functions to build 3D models for 3D real-time interaction.
(1) Basic operations and instructions. OpenGL can draw primitives from a variety of optional modes, and the setting of one mode generally does not affect the setting of other modes. No matter how the black ink appears, the instructions are always processed in sequence, that is, a primitive must be drawn completely before the subsequent primitives can affect the frame storage.
(2) Graphic control. OpenGL provides parameters such as transformation matrix, illumination, anti-aliasing method and pixel operation to control the drawing of two-dimensional and three-dimensional graphics. It does not provide a way to describe or build complex geometric objects. OpenGL provides a mechanism for drawing complex objects, rather than a comprehensive tool for describing complex objects themselves. In other words, OpenGL is procedural, not descriptive.
(3) the mode of implementation. The interpretation mode of OpenGL command is client/server mode, that is, the command is issued by the client and processed by OpenGL server (interpreter), which can run on the same or different computers. Based on this, OpenGL is network transparent.
Development and application of groundwater three-dimensional visualization system
3.3 command syntax and status. OpenGL
The microcomputer application program developed based on OpenGL standard must be under the 32-bit Windows platform, such as Windows98/NT environment, and the dynamic link libraries needed for running are OpenGL32.DLL and Glu32.DLL. OpenGL contains more than 100 library functions, which are named according to a certain format.
(1) has 1 15 core functions, each of which starts with gl. These functions are the most basic and can run on any working platform. These functions can create two-dimensional and three-dimensional geometric bodies, set viewpoints, establish visual bodies, set colors and materials, create lights, perform texture mapping, anti-aliasing, handle fusion, fog scenes and so on. They can accept different parameters, so they can derive more than 300 functions.
(2) There are 43 OpenGL utility library functions starting with glu. These functions are based on the core functions of OpenGL, which mainly provide the support of auxiliary functions and perform the interaction of core OpenGL functions, so they are higher than the core functions and more universal. It can run on any OpenGL platform.
(3) Auxiliary library function, ***3 1. Starting from aux, they are a special class of OpenGL functions, which are used to help beginners to enter OpenGL programming as soon as possible and do simple exercises. Therefore, it cannot run on all platforms. But Windows98/NT supports them.
(4)Windows-specific library functions, starting with wgl. It is mainly connected with OpenGL and Windows window system, and can be used to manage coloring description table and display list, expand functions, manage font bitmap and so on.
(5)Win32 API function, ***6, used to handle pixel format and buffering.
(6)OpenGL structure, ***4.
4.OpenGL graphics operation steps
Step 1: Set pixel format: It mainly includes establishing OpenGL drawing style, color mode, color digits, depth digits, etc.
Step 2, establishing a model: establishing a three-dimensional model;
Step 3: Stage scenery: how to place the scene in a proper position in the three-dimensional space and set up a three-dimensional perspective visual body to observe the scene;
Step 4: Effect processing: Set the material (color, optical performance and texture map, etc.) of the object. ) and increase lighting and lighting conditions;
Step 5: Rasterization: Transform the scene and its color information into pixel information that can be displayed on the computer.
(2) Virtual Reality Modeling Language
1 introduction. virtual reality modeling language
VRML is the abbreviation of English virtual reality modeling language. Its original name is virtual reality makeup language. This name was put forward by a group called Bird-of-Feather(BOF) organized by Tim Berners Lee and Dave Raggett at the first session of WWW( 1994, Geneva). Later, the makeup was changed to a shape. VRML is closely connected with HTML, which is the simulation and extension of HTML in 3D field. Because VRML has good simulation and interactivity on the Internet, it shows great vitality.
VRML is a 3D exchange format, which defines the most common concepts in 3D applications, such as transformation level, light source, viewpoint, geometry, animation, fog, material properties and texture mapping. The basic goal of VRML is to ensure that it can become an effective 3D file exchange format.
VRML is a 3D model of HTML. It brings interactive 3D capability to the World Wide Web, that is, VRML is a cross-platform language that can publish 3D web pages. In fact, 3D provides a more natural way of experience, such as games, engineering and scientific visualization, education and architecture. For a typical project like this, it is not enough to rely only on text and images based on web pages, but to enhance interactivity, continuity of dynamic effects and users' ability to participate in exploration, which is the goal of VRML.
The technology provided by VRML can integrate 3D, 2D, text and multimedia into a unified whole. When these media types are combined with scripting language and Internet functions, it is possible to produce a brand-new interactive application. VRML not only supports the classic two-dimensional desktop model, but also extends it to a wider space-time background.
VRML is the foundation of cyberspace. The concept of cyberspace was put forward by William Gibson, a science fiction writer. Although VRML does not define the network and database protocols necessary for real user simulation, we should see the rapid development of VRML. As a standard, it must be simple and realizable. On this premise, it must encourage cutting-edge experiments and expansion.
2.2. The basic working principle and characteristics of VRML.
(1) Describe the 3D scene with text information. It is transmitted on the Internet, and the 3D scene is interpreted and generated by VRML browser on the local machine. The standard specification generated by interpretation is VRML specification. It is this working mechanism based on VRML that makes it possible to develop rapidly in network applications. At first, the designers of VRML considered that the transmission speed of text description information on the network was faster than that of graphic files, so they avoided transmitting graphic files directly on the network, but transmitted text description information of graphic files, and handed over complicated processing tasks to local computers, thus reducing the load on the network.
(2) the combination of unity and separation. The access mode of VRML is based on C/S mode. The server provides the VRML file, the client downloads the file it wants to access through the network, and accesses the VR world described by the file through the browser on the local platform, that is, the VRML file contains the logical structure information of the VR world, and the browser realizes many VR functions according to this information. This access mode, in which the server provides unified description information and the client establishes its own VR world, is called the combination mode of unification and separation, which is also the basic concept of VRML. Because the browser is provided by the local platform, the platform independence of VR is realized.
(3) Feasibility of low bandwidth based on ASCII code. VRML, like HTML, uses ASCII text format to describe the world and links, which ensures universality on various platforms and reduces the amount of data, so it can also be implemented on low-bandwidth networks.
(4) Real-time 3D rendering engine. The real-time 3D coloring engine used in traditional VR is better reflected in VRML. This feature separates VR modeling from real-time access more clearly, which is also the difference between VR and 3D modeling and animation. The latter is pre-colored, so it cannot provide interactivity. VRML provides 6+ 1 degrees of freedom, that is, movement and rotation in three directions, and is anchored with other 3D spaces.
(5) expansibility. As a standard, VRML cannot meet the needs of all applications. Some applications want more interactivity, some want higher image quality, and some want the VR world to be more complicated. These requirements are often restricted by each other and the hardware performance of the user platform at the same time, so VRML is extensible, that is, it can define its own objects and their attributes as needed, and let the browser explain such objects and their behaviors through Java language and other means.
(3) X3D
X3D (Extensible 3D-Extensible 3D) is a software standard, which defines how to integrate interactive 3D content based on network communication in multimedia. X3D can be used in different hardware devices and different application fields. For example, engineering design, scientific visualization, multimedia reproduction, entertainment, education, web pages and enjoying the virtual world. X3D is also committed to establishing a unified exchange format between 3D graphics and multimedia. X3D is the inheritance of VRML. VRML (Virtual Reality Modeling Language) is the original ISO standard for network 3D graphics (ISO/IEC 14772). X3D is improved compared with VRML, providing the following new features: more advanced application programming interface, newly added data coding format, strict consistency, and component structure (used to allow modularity to support various parts of the standard).
1.X3D design target
X3D has established the following design goals:
(1) separation of data coding and runtime structure;
(2) Support a large number of data coding formats, including XML (Extensible Markup Language);
(3) Add new drawing objects, behavior objects and interactive objects;
(4) Providing an optional application program interface (API) for 3D scenes;
(5) defining a subset of specification "profiles" to meet different market demands;
(6) X3D specification can be implemented in different levels of services (1evels);
(7) As far as possible, add the definition or description of behavior to the perfect specification.
2.X3D features
In order to meet the needs of engineering design, scientific visualization, multimedia reproduction, entertainment, education, web pages and enjoying the virtual world, X3D has added the following new functions:
(1)3D graphics: polygon geometry, parametric geometry, transformation levels, lighting, materials, multi-channel/multi-process texture mapping;
(2)2D graphics: displaying text, 2D vectors and plane graphics in the three-dimensional transformation hierarchy;
(3) Animation: continuous animation driven by timer and interpolator; Humanized animation and deformation;
(4) Spatial audio and video: mapping audio and video sources on the scene geometry;
(5) User interaction: mouse-based selection and dragging; Keyboard input;
(6) navigation: camera; The user's movement in the 3D scene; Collision, approach and visibility detection;
(7) User-defined object: By creating user-defined data types, the functions of the browser can be extended;
(8) Scripting: Through programs or scripting languages, the scene can be changed dynamically;
(9) Network: A single X3D scene can be composed of resources on the network; You can connect to other scenes or other resources on the network through hyperlink objects;
(10) Physical simulation: humanized animation; Geographic data set; Protocol integration of distributed interactive simulation.
Java 3D
Java 3D constructs the upper structure of 3D with its own defined scene diagram and observation mode, and realizes the use of 3D technology on the Java platform. Java 3D API is an interface defined by Sun for 3D display. 3D technology is the bottom display technology, and Java 3D provides the upper interface based on Java. Java 3D wraps OpenGL and DirectX in the Java interface. This brand-new design makes 3D technology no longer cumbersome and can be added to the whole building of J2SE and J2EE. These characteristics ensure the powerful expansibility of Java 3D technology. Java 3D is based on Java2(Java 1.2), and the simplicity of Java language makes it possible to popularize Java 3D. Java 3D is developed on the basis of OpenGL, which can be said to be an extension of Java language in the field of three-dimensional graphics. Its essence is a set of API, that is, application program interface. Using the API provided by Java 3D, you can write some 3D animations, remote 3D teaching software, 3D aided design analysis simulation software, 3D games and so on. It realizes the following three-dimensional functions:
(1) Generate simple or complex shapes (existing 3D shapes can also be called);
(2) Make the shape have color, transparency and texture;
(3) generating and moving light in a three-dimensional environment;
(4) Ability to handle and judge behaviors (keyboard, mouse, timing, etc.). );
(5) generating fog, background and sound;
(6) deform, move and generate three-dimensional animation;
(7) Write very complex applications for VR (Virtual Reality) and other fields.
The data structure of 1 Java 3D
Like OpenGL, the data structure of Java 3D adopts the data structure of scene graph, but Java 3D is based on the characteristics of Java language. The scene graph of Java 3D is DAG (Directed Acyclic Graph), which is characterized by asymmetric directions. The scene diagram of Java 3D is directly converted from the running environment of Java 3D to the video memory data with three-dimensional display effect, so as to display the three-dimensional effect on the computer, and the latest running results of Java 3D are continuously received in the video memory, so as to generate three-dimensional animation.
Class (API) in 2.Java 3D
Java 3D is an API developed on the basis of OpenGL 3D graphics library and VRML, which contains almost all the most basic classes (class methods) and interfaces needed to write Java interactive 3D applications. Mainly stored in the package Javax.media.j3d, which are the core classes of Java 3D. In addition, there is a utility package com. sun.j3d.utils (essential, mainly to greatly improve programming efficiency). In addition to the core classes and utility packages, there are:
(1)Java.awt (mainly defining a window for display);
(2)Javax.vecmath (mainly dealing with the classes used for vector calculation defined, and the core classes in the future);
(3)3)Java 3D classes can be divided into Node and NodeComponent according to their functions, and Node is divided into two subclasses: Group and Leaf.
(5) IDL
1 Introduction. international date line
IDL(Interactive Data Language) is a product of RSI Company in the United States, which integrates visualization, interactive analysis and large-scale commercial development, providing users with a perfect, flexible and effective development environment. The main functions of IDL include:
(1) Advanced image processing, interactive 2D and 3D graphics technology, object-oriented programming mode, OpenGL graphics acceleration, cross-platform graphical user interface toolkit, ODBC-compatible database connection and various program connection tools.
(2)IDL is completely matrix-oriented, so it has the ability to process large-scale data. IDL can read or output formatted or unformatted data types, support general text and image data, support scientific data formats such as HDF, CDF and netCDF widely used by NASA, TPT and NOAA, and DICOM format, the standard format of medical scanning equipment. IDL also supports characters, bytes, 16-bit integer, long integer, floating point, double precision, complex number and other data types. Able to handle data files larger than 2Gb. IDL adopts OpenGL technology and supports OpenGL software or hardware acceleration, which can accelerate interactive 2D and 3D data analysis, image processing and visualization. Can realize the rotation and flight of the surface; Shading or lighting with multiple light sources; Can observe the complex details inside the volume; Once an object is created, it can be visually analyzed from different angles.
(3)IDL has image processing software packages, such as region of interest (ROI) analysis and a set of image analysis tools, map projection and transformation software packages, which are suitable for the development of GIS.
(4)IDL has a software package for mathematical analysis and statistics, which provides a scientific calculation model. It can be used for curve and surface fitting analysis, multi-dimensional grid division and interpolation, linear and nonlinear system analysis and so on.
(5) IDL DataMiner can quickly access, query and manage ODBC-compatible databases, and support Oracle, Informix, Sybase, MS SQL and other databases. You can create, delete, query tables and execute any SQL commands.
(6)IDL can integrate IDL application development into COM-compatible environment through ActiveX controls. Using Vi-sual Basic and Visual C++ to access IDL, you can also call C and Fortran programs from IDL or call IDL from other languages through dynamic link libraries.
(7) Using IDL GUIBuilder, cross-platform user graphical interface (GUI) can be developed, and users can create application interface flexibly and quickly by dragging GUI.
(8)IDL provides users with some visual data analysis solutions. As early as 1982, the software IDL was used in the development of NASA's Mars flying vehicle.
2. The programming mode is 2. international date line
There are two programming methods for IDL. One is to use GUIBuilder of IDL platform for programming, which is characterized by what you see is what you get, and to use IDL's own controls for programming and interface setting, but it is not flexible enough. The other is the component programming technology of IDL platform integrated development environment, which is characterized by strong flexibility and powerful functions and can be set according to the wishes of programmers. In addition, there are batch file statements in IDL, that is, directly input command statements on the command line to read and output data, and set and process properties. In addition, IDL provides IDLDRAW widget control, which can be developed based on COM technology.
3.3 Application fields. international date line
Because of its powerful functions and unique characteristics, IDL language can be applied to many fields of earth science (including meteorology, hydrology, ocean, soil, geology, groundwater, etc.). ), medical imaging, image processing, GIS system, software development, university teaching, laboratory, testing technology, astronomy, aerospace, signal processing, national defense engineering, mathematical statistics and analysis, environmental engineering, etc. IDL language can be widely used. At present, mature products such as ENVI, IMAGIS, RiverTools and medicine have been developed by using IDL language. There are also many concrete application examples, such as the comprehensive forecast system of the Sydney Olympic Games in Australia in 2000 and the El Ni? o phenomenon analysis of the National Environmental Satellite Data and Information Service Center of the United States.
AutoDig, a true three-dimensional geological analysis system developed by Beijing Institute of Survey and Design, can directly realize scientific and complete three-dimensional modeling of simple geological data or other levels of data. At the same time, it also provides a true three-dimensional display function, which can not only rotate, enlarge and shrink the three-dimensional body at will, but also realize the interactive true three-dimensional cutting function.
(6) Summary
Three-dimensional graphics technology is developing and changing with the development of computer software and hardware technology, and its originator is OpenGL three-dimensional graphics library introduced by SGI company. OpenGL is the most popular and widely supported underlying 3D technology in the industry, and almost all graphics card manufacturers support and optimize OpenGL at the bottom. OpenGL also defines a series of interfaces for programming 3D applications, but these interfaces are all implemented in C(C++) language, which is very complicated. It takes a lot of time and energy to master OpenGL programming technology.
Java 3D is developed on the basis of OpenGL, which can be said to be an extension of Java language in the field of three-dimensional graphics. Its essence is a set of API, that is, application program interface.
Direct3D is a three-dimensional graphics programming API launched by Microsoft, which is mainly used for programming three-dimensional games. Many excellent 3D games are realized through this interface. Like OpenGL, the implementation of Direct3D mainly uses C++ language.
VRML2.0(VRML97) has been widely used on the Internet since it became an international standard from 1997 to 12. It is a simpler language than BASIC and JAVASCRIPT. Now it has developed to X3D. Scripted sentences can be used to write three-dimensional cartoons, three-dimensional games and computer-aided three-dimensional teaching. Its biggest advantage is that it can be embedded in web page display.
IDL(Interactive Data Language), the latest visualization software developed by RSI Company in America, is a good choice for data analysis, visualization and cross-platform application development. It integrates visualization, interactive analysis and large-scale commercial development, providing users with a perfect, flexible and effective development environment. See table 1-2 for the comparison of 3D technologies.
Table 1-2 3D technology comparison
- Previous article:
What is patriarchal system and what are its characteristics
- Next article:Sanshou leg technique training method
- Related articles
- How to make jelly from grape skins
- How to recognize the simple lacquer painting?
- The same black, why Kenyans are good at long-distance running, while Jamaicans are good at sprinting?
- Can stainless steel pot use gas stoves?
- Folk taboos on the 23rd of the twelfth lunar month.
- Please briefly talk about the principles of Chinese teaching design.
- Research direction of rural development
- What are the national musical instruments in Xinjiang?
- What should I do to open a physical store now?
- How to build a bathroom niche?