(I) OpenGL
OpenGL (Open Graphics Libaray) developed by SGI for its graphics workstations can be independent of the window operation and hardware environment of the graphics development system. Its purpose is to free users from specific hardware and operating systems. With this system, you can not understand the structure of these systems and instruction systems, as long as the application program written in the prescribed format can be executed on any hardware platform that supports the language. Due to OpenGL's highly reusable, there have been dozens of large companies said to accept OpenGL as a standard software interface, currently joining the OpenGL ARB (OpenGL Architecture Review Board) members are SGI, HP, MicroSoft, Intel, IBM, SUN, DEC, AT&. amp;T's Unix Software Labs and others. With the efforts of this organization, OpenGL has become the industry standard for high-performance graphics and interactive view processing, and can be applied on Windows95/98, Windows NT, Windows 2K, Macos, Beos, OS/2, and Unix.The essence of OpenGL is that it serves as a software interface to the graphics hardware, and is a set of three-dimensional API functions.
1. Main functions of OpenGL
(1) Modeling. Not only simple point and line surface also provides complex three-dimensional objects (ball, cone, etc.) and complex curved surfaces (Bezier, Nurbs, etc.) drawing functions.
(2) transformation. Mainly includes basic transformations (translation, rotation, etc.) and projection transformations (parallel, perspective projection, etc.).
(3) color mode settings. RGBA mode, ColorIndex color index.
(4) Light and material settings. OpenGL light has radiant light, ambient light, diffuse light, specular light; material is represented by light reflectivity. The final color of the objects in the scene reflected to the human eye is formed by superimposing the RGB component of the light and the RGB component of the material.
(5) Texture mapping. Mainly expresses the details of the object surface.
(6) Bitmap display and image enhancement. Image functions in addition to the basic copy and image pixel reading and writing, but also provides fusion (Blending), anti-wandering (Antialiasing), fog (Fog) and other special image processing effects.
(7) Double Buffering (Double Buffering) animation. Double buffering that is, foreground buffering and background buffering. The background calculates the scene and generates the picture, and the foreground displays the picture that has been calculated in the background.
(8) Interactive technology. It mainly provides three working modes: drawing mode, selection mode and feedback mode. Drawing mode completes the drawing of the scene, which can constitute a real-time interactive program system with the help of geometric parameters and motion control parameters of the objects, observation parameters of the scene, lighting parameters and material parameters, texture parameters, numerous constant control parameters of OpenGL functions, time parameters, etc., and Windows dialog boxes, menus, external devices and so on. In selection mode, you can name objects, select named objects, and control the drawing of named objects. Feedback mode, on the other hand, gives the programmer information about the operation of the program, which can also be fed back to the user to tell the user how the program is running and to monitor the progress of the program.
(9) Other. Using OpenGL also enables special effects such as Depth Cue and Motion Blur.
2. The basic principle of OpenGL
OpenGL is a software interface to a hardware generator, whose main purpose is to draw 2D and 3D objects into a frame buffer, which includes hundreds of graphics functions. Developers primarily use these functions to build 3D models and interact in 3D in real time.
(1) Tuple manipulation and commands.OpenGL is able to draw tuples from a variety of selectable modes, and the setting of one mode does not generally affect the setting of other modes.Regardless of what happens to the depth of the ink, the commands are always processed sequentially, that is to say, a tuple has to be completely finished before a subsequent tuple can affect the framebuffer.
(2) Graphics control. OpenGL provides parameters such as transformation matrices, lighting, anti-alignment methods, pixel manipulation, and so on to control the drawing of 2D and 3D graphics. It does not provide a means of describing or building complex geometric objects.OpenGL provides a mechanism for how to draw complex objects rather than a faceted tool for depicting complex objects themselves. That is, OpenGL is procedural rather than descriptive.
(3) Execution mode. the interpretation mode of OpenGL commands is client/server mode, i.e., the client issues the commands, and the commands are processed by the OpenGL server (interpreter), which can be running on the same or different computers, based on which OpenGL is network transparent.
Groundwater 3D Visualization System Development and Application
3. Command Syntax and State of OpenGL
Microcomputer applications developed based on the OpenGL standard must be developed under 32-bit Windows platforms, such as Windows98/NT environments, and the dynamic connection libraries required for runtime are OpenGL32.DLL, Glu32.DLL. OpenGL contains more than 100 library functions, which are named in a certain format.
(1) There are 115 core functions, each beginning with gl. These functions are the most basic and can run on any workbench. These functions create 2D and 3D geometries, set viewpoints, build visual bodies, set colors and materials, build lights, perform texture mapping, anti-alignment, handle fusion, fog the scene, etc. They can accept different parameters, and thus can be derived from more than 300 functions.
(2) The OpenGL utility library functions start with glu, ****43 of them. These functions are based on the OpenGL core functions, mainly provide support for helper functions, and perform interactions with the core OpenGL functions, and thus are a higher level than the core functions, and are more generalized. It can run on any OpenGL workbench.
(3) Auxiliary library functions, ***31 of them. Starting with aux, they are a special class of OpenGL functions that help beginners get into OpenGL programming as quickly as possible for simple exercises. Therefore, they do not run on all platforms. But Windows 98/NT supports them.
(4) Windows-specific library functions, starting with wgl. Mainly connect OpenGL and Windows window system, with them you can manage the coloring description table and display list, extend the function, manage the font bitmap and so on.
(5) Win32 API functions, ****6, used to deal with pixel format and buffering.
(6) OpenGL structures, ****4 of them.
4. OpenGL graphics operation steps
Step 1: set the pixel format: mainly includes the establishment of OpenGL drawing style, color mode, color bits, depth bits, etc.;
Step 2: build the model: to build a three-dimensional model;
Step 3: stage set: how to place the scene in the appropriate location in three-dimensional space, the Setting up the 3D perspective visual body to observe the scene;
Step 4: Effect Processing: Setting up the material of the object (color, optical properties and texture mapping, etc.) Adding lighting and lighting conditions;
Step 5: Rasterization: Converting the scene and its color information into pixel information that can be displayed on the computer.
(II) VRML
1. Introduction to VRML
VRML is an acronym for Virtual Reality Modeling Language. Its original name was Virtual Reality Makeup Language, which was proposed by a group called Bird-of-a-Feather (BOF) organized by Tim Berners Lee and Dave Raggett at the first WWW (1994, Geneva) conference. Later Makeup was changed to Modeling, VRML and HTML are closely related, and are simulations and extensions of HTML in the 3D domain. Because VRML has good simulation and interactivity in Internet, it shows strong vitality.
VRML is a 3D interchange format that defines most of the common concepts used in today's 3D applications, such as transformation hierarchies, light sources, viewpoints, geometry, animation, fog, material properties, and texture mapping.
The basic goal of VRML is to ensure that it can be a valid format for exchanging 3D files.
VRML is a 3D model of HTML. It brings interactive 3D capabilities to the World Wide Web, i.e. VRML is a cross-platform language that can publish 3D web pages. Indeed, 3D provides a more natural way of experiencing things such as games, engineering and scientific visualization, education and architecture. Typical projects such as these are not enough to rely on web-based text and images, but require enhanced interactivity, a sense of continuity in dynamic effects, and user participation in exploration, which is the goal of VRML.
VRML provides the technology to integrate 3D, 2D, text, and multimedia into a unified whole. When these media types are combined with a scripting language and the power of the Internet, a whole new kind of interactive application is possible, and VRML supports the classic two-dimensional desktop model while extending it to a wider spatial and temporal context.
VRML is the foundation of cyberspace. The concept of cyberspace was developed by science fiction writer William Gibson. Although VRML does not define the necessary network and database protocols for true user simulation, VRML should be seen to be rapidly evolving. As a standard, it must maintain simplicity and realizability, and within that context encourage cutting-edge experimentation and extensions.
2. The basic working principle of VRML and its characteristics
(1) Textual information is used to describe a three-dimensional scene. In the Internet network transmission, in the local machine by the VRML browser to explain the generation of three-dimensional scene, the interpretation of the generated standard specification that is the VRML specification. It is based on this working mechanism of VRML, which makes it possible to have a rapid development in network applications. When the designers of VRML consider the text description of the information on the network than the transmission of graphics files quickly, so they avoided the direct transmission of graphics files on the network and instead of using the transmission of graphics files of text description of the information, the complexity of the processing task to the local machine, thereby reducing the load on the network.
(2) The combined mode of VRML access is based on the C/S mode, in which the server provides the VRML file, the client downloads the desired file through the network and accesses the VR world described by the file through the local platform's viewer, i.e., the VRML file contains information about the logical structure of the VR world, and the viewer realizes many VR functions according to this information. The VRML file contains information about the logical structure of the VR world, and the browser realizes many VR functions based on this information. This kind of access method in which the server provides unified description information and the client builds the VR world individually is called the unity-division model, which is also the basic concept of VRML. Since the browser is provided by the local platform, thus realizing the platform-independence of VR.
(3) Low-bandwidth feasibility based on ASCII code.VRML describes the world and links in ASCII text format like HTML, which guarantees generalization across various platforms, and at the same time reduces the amount of data so that it can be implemented on low-bandwidth networks.
(4) Real-time 3D coloring engine. The real-time 3D coloring engine traditionally used in VR is better represented in VRML. This feature isolates the modeling of VR more clearly from real-time access, and is what sets VR apart from 3D modeling and animation. The latter are pre-colored and thus do not provide interactivity.VRML provides 6+1 degrees of freedom, i.e., movement and rotation in three directions, as well as hyperlinks (Anchor) to other 3D spaces.
(5) Expandability: VRML, as a standard, cannot fulfill the needs of all applications. Some applications want more interactivity, some want higher quality images, and some want a more complex VR world. These requirements are often constrained by each other and by the hardware performance of the user's platform, so VRML is extensible, i.e., it can define its own objects and their attributes as needed, and make it possible for the browser to interpret such objects and their behavior through, for example, the Java language.
(c) X3D
X3D (Extensible 3D) is a software standard that defines how to integrate web-based interactive 3D content in multimedia. x3D will be available in different hardware devices and can be used in different application areas. For example, engineering design, scientific visualization, multimedia reproduction, entertainment, education, web pages, ****enjoying virtual worlds, etc. X3D also aims to establish a unified exchange format for 3D graphics and multimedia. x3D is the successor of VRML (Virtual Reality Modeling Language), the original VRML (Virtual Reality Modeling Language - Virtual Reality Modeling Language) is the original ISO standard for 3D graphics on the Web (ISO/IEC 14772). X3D is an improvement over VRML, offering the following new features: a more advanced application interface, a new data encoding format, strict conformance, and a componentized architecture (to allow modular support for various parts of the standard).
1. X3D Design Goals
X3D establishes the following design goals:
(1) Separation of data encoding and runtime structures;
(2) Support for a large number of data encoding formats, including XML (Extensible Markup Language);
(3) Addition of new drawing objects, behavioral objects, and interactive objects;
(4) providing optional Application Programming Interfaces (APIs) for 3D scenes;
(5) defining a subset of specifications called "profiles" to suit different market needs;
(6) allowing the use of different levels of specifications at different (6) Allow the X3D specification to be implemented at different levels of service;
(7) Add definitions or descriptions of behaviors in the specification wherever possible.
2. X3D Features
To meet the needs of engineering design, scientific visualization, multimedia reproduction, entertainment, education, web pages, and ****-enjoyment of virtual worlds, the following new features have been added to X3D:
(1) 3D Graphics: Polygonal Geometry, Parametric Geometry, Transformation Hierarchies, Lighting, Textures, Multi-Channel / Multi-Processing texture postings;
(2) 2D graphics: display of text, 2D vectors, and planar shapes in 3D transform hierarchies;
(3) animation: timer- and interpolator-driven sequential animation; humanized animation and morphing;
(4) spatially-enabled audio and video: mapping of audio-visual sources on scene geometry;
(5) user interaction: mouse-based mouse selection and dragging; keyboard input;
(6) Navigation: cameras; user movement through the 3D scene; collision, proximity, and visibility detection;
(7) User-defined objects: the browser can be extended through the creation of user-defined data types;
(8) Scripting: the ability to dynamically change the scene through a program or scripting language;
(9) Networking: a single X3D scene can be composed from resources on the network; it is possible to connect to other scenes or other resources on the network through hyperlink objects;
(10) Physical simulation: humanized animation; geo-realized datasets; distributed interactive simulation- (DIS) protocol integration. DIS) protocol integration.
(D) Java 3D
Java 3D with its own definition of the scene graph and observation mode and other technologies to construct the 3D superstructure, to achieve the use of three-dimensional technology in the Java platform. Java 3D API is a Sun-defined for the implementation of the interface for the 3D display. 3D technology is the underlying display technology, Java 3D provides a Java-based upper layer interface. Java 3D is the underlying display technology, and Java 3D provides a Java-based upper-layer interface. Java 3D wraps OpenGL and DirectX, the underlying technologies, in a Java interface. This new design makes 3D technology becomes less cumbersome and can be added to the whole set of J2SE, J2EE architecture, these features ensure that Java 3D technology is powerful scalability. Java 3D is based on the development of OpenGL, can be said to be the expansion of the Java language in the field of three-dimensional graphics, in essence, a set of APIs that is the application program interface. Using the APIs provided by Java 3D, it is possible to write such things as three-dimensional animation, remote three-dimensional teaching software, three-dimensional auxiliary design analysis and simulation software, as well as three-dimensional games. It implements the following three-dimensional functions:
(1) generate simple or complex form (you can also call the existing three-dimensional form);
(2) so that the form of color, transparency, mapping;
(3) in the three-dimensional environment to generate lights, moving lights;
(4) with the behavior of the processing judgement ability (keyboard, mouse, timing, etc.) ;
(5) generate fog, background, sound;
(6) make the shape deformation, movement, generation of three-dimensional animation;
(7) write very complex applications for a variety of fields such as VR (virtual reality).
1. Data structure of Java 3D
The data structure of Java 3D is the same as that of OpenGL, using the data structure of the scene graph, but Java 3D is based on the characteristics of the Java language.The scene graph of Java 3D is a DAG (Directed-acyclic Graph), which is characterized by a directional asymmetry. Directed-acyclic Graph, which is characterized by directional asymmetry.The scene graph of Java 3D is directly transformed by the running environment of Java 3D into the display memory data with three-dimensional display effect, so as to display the three-dimensional effect on the computer, and the display memory constantly receives the latest results of the running of Java 3D, so as to produce three-dimensional animation.
2., Java 3D (API) in the class
Java 3D is based on OpenGL's three-dimensional graphics library and VRML developed on the basis of an API, which contains almost all of the writing of the Java interactive three-dimensional applications required for the most basic classes (class methods), interfaces. Mainly stored in the program package Javax.media.j3d, these are the core classes of Java 3D. In addition, there is the provision of a package to help rapid programming application type (Utility package) com.sun.j3d.utils (or lack of, mainly can greatly improve the efficiency of the program written). In addition to the core classes and Utility package, there are:
(1) Java.awt (mainly to define a window for display);
(2) Javax.vecmath (mainly to deal with the definition of the vector calculation of the class used in the future, the core class);
(3) Java 3D classes according to the role can be divided into Node, NodeComponent, of which Node is divided into Group and Leaf two subclasses.
(E) IDL
1. IDL Introduction
IDL (Interactive Data Language) is the United States of America RSI (Research System Inc) products, which set the visualization, interactive analysis, large-scale commercial development as a whole, to provide users with a perfect, flexible and effective development environment. The main features of IDL include:
(1) advanced image processing, interactive two-dimensional and three-dimensional graphics technology, object-oriented programming, OpenGL graphics acceleration, cross-platform graphical user interface toolkit, ODBC-compatible databases and a variety of program connectivity tools.
(2) IDL is completely matrix-oriented, so it has the ability to handle large-scale data. IDL can read or output formatted or unformatted data types, support for general-purpose text and image data, and support for NASA, TPT, NOAA and other organizations in the large number of used in the scientific data formats such as HDF, CDF, and netCDF, as well as the standard format DICOM medical scanning equipment. IDL also supports characters, bytes, 16-bit integers, long integers, floating point, double precision, complex numbers and other data types. Capable of handling 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. It enables surface rotation and flight; shading or illumination with multiple light sources; observation of complex details inside a volume; and visual analysis of objects from various viewpoints once they have been created.
(3) IDL has image processing software packages, such as region of interest (ROI) analysis and a set of image analysis tools, map projection and conversion software packages, suitable for GIS development.
(4) IDL has a mathematical analysis and statistical software package that provides scientific calculation models. Curve and surface fitting analysis, multi-dimensional meshing and interpolation, linear and non-linear systems and other analyses can be performed.
(5) With IDL DataMiner you can quickly access, query and manage ODBC-compatible databases, supporting 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 a COM-compatible environment through ActiveX controls. Access IDL with Vi-sual Basic, Visual C++, etc. You can also call C, Fortran programs from IDL or IDL from other languages by means of dynamic connection libraries.
(7) With IDL GUIBuilder, you can develop cross-platform graphical user interfaces (GUIs), and users can drag-and-drop to build GUIs, flexibly and quickly generate GUIs, and then create GUIs. GUI, flexible and fast to generate the interface of the application program.
(8) IDL provides users with a number of visual data analysis solutions, as early as 1982 NASA's Mars flyby aircraft development on the use of IDL software.
2. IDL programming
IDL has two programming methods, one is the use of IDL platform GUIBuilder programming, this way is characterized by what you see is what you get, the use of IDL itself has the control of programming and interface settings, but the use of the flexibility is not enough; the other is the use of IDL platform IDL integrated development environment of component programming technology, this way is characterized by what you see is what you get, the use of the IDL itself has the control of programming and interface settings, but the use of flexibility is not enough; another is the use of IDL platform integrated development environment components Programming technology, this way is characterized by more flexible, and more powerful, can be set up with the programmer's wishes. In addition, there are batch file statements in IDL, i.e., directly entering command statements in the command line to read in and output data, as well as property settings and processing. In addition, IDL provides the IDLDRAW WIDGET control for COM-based development.
3. Application areas of IDL
Because of its powerful functions and unique features, IDL language can be applied to geoscience (including meteorology, hydrology, ocean, soil, geology, groundwater, etc.), medical imaging, image processing, GIS systems, software development, university teaching, laboratories, testing technology, astronomy, aerospace, signal processing, defense engineering, Mathematical statistics and analysis, environmental engineering and many other fields, IDL language can be widely used. At present, the application of IDL language, has developed ENVI, IMAGIS, RiverTools, medical and other mature products. Specific application examples are also very many, such as in the 2000 Olympic Games in Sydney, Australia, integrated forecasting system, the U.S. National Environmental Satellite Data and Information Service Center for the El Ni?o phenomenon analysis and other work has been successfully applied.
Beijing Survey and Design Institute application of IDL language, has developed a true three-dimensional geological analysis system AutoDig, can be directly on the simple geological data, or other data with hierarchical to achieve scientific, complete three-dimensional modeling; also provides true three-dimensional display function, not only can the three-dimensional body to achieve arbitrary rotation, zoom in, zoom out, and also can achieve interactive true three-dimensional The cutting function can also be realized interactively.
(F) Summary
Three-dimensional graphics technology is with the development of computer hardware and software technology and the development of change, its ancestor is the SGI company launched the OpenGL three-dimensional graphics library. OpenGL is the industry's most popular is also the most widely supported one of the bottom of a 3D technology, almost all of the graphics card manufacturers in the bottom of the implementation of the OpenGL support and optimization. OpenGL also defines a series of interfaces for programming 3D applications, but these interfaces are implemented in C (C++) and are very complex. Programming for OpenGL takes a lot of time and effort.
Java 3D was developed on the basis of OpenGL, and can be considered an extension of the Java language in the field of three-dimensional graphics, which is essentially a set of APIs, i.e., application program interfaces.
Direct3D is a three-dimensional graphics programming API introduced by Microsoft, which is mainly applied to the programming of three-dimensional games. Many excellent 3D games are realized by this interface. Like OpenGL, Direct3D is mainly implemented in C++.
VRML2.0 (VRML97) has been widely used on the Web since December 1997 when it officially became an international standard, and it is a simpler language than BASIC, JAVASCRIPT, and so on. It has now been developed into X3D. Scripted statements can be written for 3D animated films, 3D games, and computer 3D-assisted teaching. Its biggest advantage is that it can be embedded in the web page display.
The United States RSI company (Research System Inc) research and development of the latest visual software IDL (Interactive Data Language) Interactive Data Language, data analysis, visualization and cross-platform application development is a better choice, it is a set of visualization, interactive analysis, large-scale commercial development as a whole, for the user 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 a comparison of 3D technologies.
Table 1-2 Comparison of 3D Technologies