Coordinate System and geometry-2

Source: Internet
Author: User

3D primitives

In direct3d, polygon is composed of triangles. Because the three vertices of a triangle are always in common, rendering of non-common images is inefficient. Therefore, various ry in direct3d are made up of triangle elements.

Rasterization rules (raster Rules)

Triangle Rasterization rules: direct3d uses top-left filling to fill the ry. the center point of each pixel on the screen device is the decisive point, if the dot is in the graph, the pixel is in the graph. In addition, the midpoint of a pixel is in the integer coordinate.

Point and line rules:

Points are rendered the same as point Sprites, which are both rendered as screen-aligned quadrilaterals and thus adhere to the same rules as polygon rendering.

Point sprite rules:

Point sprites and Patch primitives are rasterized as if the primitives were first tessellated into triangles and the resulting triangles rasterized.

Rectangles

Throughout Microsoft direct3d and Microsoft Windows programming, objects on the screen are referred to in terms of bounding rectangles. the sides of a bounding rectangle are always parallel to the sides of the screen. managed code applications shocould use the rectangle structure, in the system. drawing namespace, for storing rectangle information and when blitting to the screen or locking Ming Collision Detection.

Triangle Interpolation

During rendering, the pipeline interpolates vertex Data Processing SS each triangle. Several Types of data can be interpolated.

  • Diffuse color
  • Specular color
  • Diffuse alpha (Triangle opacity)
  • Specular alpha
  • Fog factor (taken from specular alpha for fixed function vertex pipeline and from fog register for programmable vertex pipeline)
  • Texture coordinates

The interpolation of the vertex data is dependent on the current shading mode-flat or gourand.

The color and specular interpolated values are treated differently, depending on the color model. In the RGB color model, the system uses the red, green, and blue color components in the interpolation.

The Alpha component of a color is treated as a separate interpolated value because device drivers can implement transparency in two different ways: by using texture Blending or by using stippling.

Vector, vertices and Quaternions

Throughout Microsoft direct3d, vertices describe position and orientation. Each vertex in a primitive is described by a vector that gives its position, color, texture coordinates, and Normal Vector that gives its orientation.

Quaternions add a fourth element to [X,Y,Z] Values that define a three-component vector. quaternions are an alternative to the matrix methods that are typically used for 3-D rotations. A quaternion represents an axis in 3-D space and a rotation around that axis. for example, a quaternion might represent a (1 radian, 2) axis and a rotation. quaternions carry valuable information, but their true power comes from the two operations that you can perform on them: composition and interpolation.

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.