When you learn a stereo, you must use the coordinate system to position and calculate the geometry. A 3D image is displayed in the computer, that is, the geometry is displayed to convert those digitized coordinates into geometric image display. Therefore, the coordinate system must learn, otherwise the large pile of coordinate data has no way to display, or it is displayed in chaos.
The coordinate system is also used in Direct3D, and its coordinate system is the left hand coordinate system. There are currently two coordinate systems, as shown below:
Figure 1.1: Left hand coordinate system, right hand coordinate system
The left hand coordinate system is the positive direction of the X-axis pointing to the right, the Y-axis positive direction, and the positive direction of the z-axis points. When the left hand is extended, let four fingers refer to the positive direction of the X-axis, the large mother point to the positive direction of the Z-axis, and the positive direction of the Y-axis. The coordinate system in line with such a rule is called the left hand coordinate system.
The right hand coordinate system is the positive direction of the X-axis pointing to the right, the Y-axis positive direction, and the positive direction of the z-axis points to the outside. When the right hand is extended, let four fingers refer to the positive direction of the X-axis, the large mother point points to the positive direction of the Z-axis, and the positive direction of the Y-axis. The coordinate system in line with such a rule is called the right hand coordinate system.
Of course, there are still many other coordinate systems, it will not be introduced.
If you want to read the geometric model of the left hand coordinate system from the file, it is necessary to make a corresponding conversion. For example, switch from the right hand coordinate system to the left hand coordinate system, it is to change and flip in the order of triangle vertices.
The 3D drawing is created three-dimensional illusion on the 2D computer screen. In order to do this, a mathematical transformation is used to model and process images. In order to familiarize yourself with 3D algorithms and concepts, the 3D world and object preparations are created and processed using Direct3D. Understanding how the 3D algorithm is achieved will help you understand Direct3D.
3D drawing is more complicated than 2D drawings, because the program needs to understand the principle of two-dimensional graphic display, much more than displayed on the screen. Creating 3D graphics usually uses commercial 3D modeling software, such as 3DS, or 3D Max, etc.
You can use a 3D drawing algorithm to deal with all kinds of models in real time, making the model in your world more realistic. This realistic model consists of objects, cameras, and light sources.
3D objects included in the world have various properties, which can be changed by handling these properties.
The shape of an object is defined by the surface, and the surface can be defined as a planar or secondary surface. If some contour models have been seen, the basic surface used for entity objects will be known. Each object has texture to define the roughness and smoothness of the surface. Each object diffuses and specular reflection, and the reflection attribute determines the degree of light reflection of the object to the object. The diffuse reflection represents the object is dark. A new clean ball is more diffuse reflection than the old and grown. The mirror reflection represents the brightness of the object, and the crystal bottle has a higher specular reflection than the wood block. The location of the object is defined by three coordinate axes in 3D space: x, y, z coordinate. The orientation of object, that is, some direction of three-dimensional space. The effect of rotating the processing of the direction is the rotation of the object.
The small, or the most basic object constitutes a large material, which is called a combination. The combination simplifies the movement of complex major objects. For example, a bicycle is composed of two rotating wheels. When the wheel rotates, the entire car moves forward. Rotary rotation and moving relative static coordinate system. The combination allows the moving coordinate system while maintaining the wheel to constrain the wheel; there is no need for a clear moving wheel. A combination of some complex moving objects, such as cars, aircraft, animals, etc. are very useful.
In order to see objects, the camera represents the user's association on the 3D world on behalf of the user. The camera has a position and a direction, which defines what the observer looks like to see and see what the objects seen are like. Moving a camera in a 3D world and changing its direction to see different parts of the object.
Although there is an object and a camera, it is still not seen unless some light is hit on the surface of the object. You can create light of different styles, change the appearance of the object in the scene by changing the extent of the light illumination. Different light types and effects are different from CPUs and other resources. The ambient light provides a fixed illumination for all objects in the scene, and all other light lights are different in the intensity and direction.
The point light source is the light emitted from a point, and the angle of reflection depends on the angle between the spot and the object position. It will be reflected in the surface of the object.
The parallel light is similar, but it is the light emitted from a plane, and the incident angle and the reverse reflection angle are as large as the reflection angle. This is the reason why the parallel light is calculated, but some real feelings are lost.
As its name, the concentration is as its name, the light intensity changes.
Direction light is most often used to simulate sunlight and other infinity light sources. This source is seen from infinity, and its strength does not change with the object. In the unique direction, the brightness is fixed.
You can determine the brightness or intensity to affect the extent of the object illuminated. The concentrating source and other light sources have a direction that determines where the light is emitted.
The intensity of certain light sources is affected by the distance. But the environment is not like this, it doesn't have a position, not a direction of the direction. Usually with the scene with an infinite distance.
You can create different colored lights. This is more complicated than white, because it changes the color of each object taken.
3d drawings There are two important crop concepts: View Volumes and visible surfaces (Visible Surface). The view area is used to reduce the number of objects that are rendered. The closer to the camera, the larger the object, the more details. When moving away from the camera, the object is small, and the details are small. When the object is very far, it can disappear from the field of view without losing the real feeling that can be perceived. In fact, the object is always simulated in an appropriate distance to be unaware of it.
The object behind the camera can be cropped; in the 2D application, the object exceeding the four sides of the screen is cropped. Two projections were used in crop. One is parallel (orthogonal) projection, and the other is a perspective projection. Perspective projection has no shadow point. As its name, the object from the observer is smaller.
Visual surface detection is a method of accelerating rendering algorithms by avoiding calculating the rendering of non-visible objects. It needs to calculate which object's surface is not cropped in the viewpoint and which faces away from the camera.
Rendering 3D scenes in real time requires a lot of calculations, so find some good way to reduce the amount of computation, optimize program performance, but with the development of technology, it is not so much attention to optimization, and the display is very Realism.
With an overview of 3D graphics programming, you can consider making an application using Direct3D. Direct3D allows you to write drivers directly, you can access many graphics card 3D hardware acceleration functions, so that many 3D algorithms can be run directly in the graphics card, which greatly accelerates performance of 3D program.