Silverlight computer graphics 3 3D spatial coordinates

Source: Internet
Author: User

1. Odd coordinates

Why should we introduce homogeneous coordinates? This is mainly due to the following two reasons:
First, in physics, vectors are used to represent physical quantities such as force and speed. They are usually expressed by line segments with length and direction, and 4.1. We often use mathematical symbols to represent a vector. It has nothing to do with the space location. For a point P located at (x, y, z) in a three-dimensional space, if we use a column matrix to represent it, this will be confused with the representation of vectors.
Secondly, in a two-dimensional or three-dimensional space, the product of a matrix, such as Q = TP, can only represent transformations such as rotation, ratio, and cut, but not translation transformations.


For example, in Figure 4.2, when point P rotates the θ angle around the coordinate origin and reaches P', its coordinates can be calculated in the following formula:
(4-1-1)

Where

.
For proportional, reflection, and shear transformations, we can all get a Matrix Expression similar to (4-1-1. However, if we translate an object from one coordinate position to another along a straight line path, that is, by giving the Original Coordinate Position (x, y, z) add the translation distance Tx, Ty, and TZ to move it to a new position (x', y', Z ′). So that p = [x, y, z] T, Pt = [Tx, Ty, TZ] T, p' = [x', y', Z'] T, then
. (4-1-2)
The right side of the above formula cannot be written as a multiplication of two matrices as the right side of the formula (4-1-1.
To avoid these difficulties, we use a four-dimensional column matrix to represent vertices and vectors in 3D space. Assume that (E1, E2, E3, P0) is used to specify the frame of the three-dimensional space coordinate system. E1, E2, and E3 are the coordinate axis vectors, and P0 is the coordinate origin. Then, any point P in the space can be uniquely written in the coordinate system framework.
.

We can use the matrix product form to rewrite the above formula
.
Strictly speaking, the above formula is not a dot product or inner product, because its matrix elements are different. The 4-dimensional row matrix on the right of the preceding formula is the X-coordinate representation of point P under the given coordinate system framework. Or equivalent, the homogeneous coordinates of a point can be expressed
.
In the same coordinate system frame, any vector V can be written

,
Therefore, V can be expressed as a column matrix.
It should be noted that there are different interpretations of this Sub- ry, which we will introduce later.


 
AffineTransform

Affine transformation is the most commonly used transformation in computer graphics. The coordinate transformations in the following forms are called three-dimensional affine transformations:
Left (4-2-1)
That is, the coordinate of Q is a linear combination of the coordinates of P. It can be expressed by homogeneous coordinates:
Left (4-2-2)
An affined transform converts a vector into a vector. As described in the previous section, if the coordinate of the Space Vector V is VX, Vy, and VZ, its coordinate frame representation (that is, homogeneous coordinate representation) is a column vector with 4th components 0. It is converted:
Left (4-2-3)
It can be seen that vector V is transformed into another vector: The 4th component of its homogeneous coordinates is also 0.
(4-2-1)
,

,
.

(4-2-2)
.

(4-2-3)
.


3D geometric Transformation


All three-dimensional geometric transformations can be realized by using homogeneous coordinates and affine transformations. Any complex geometric transformation can be decomposed into a combination of simple transformations, such as proportional, shear, reflection, rotation, and moving.
4.3.1 Ratio
A reference point should be specified for both proportional and Rotation Transformations. Here, we first assume that the reference point is the origin. In Section 4.3.6, we will introduce the translation and Rotation Transformations around any point.

Proportional transformation is a geometric transformation that scales up or down an object in a certain proportion. Take the coordinate origin as the reference point, and scale the proportional transformation of α X, α y, and α Z times independently along the X, Y, and Z axes respectively, which can be expressed in homogeneous coordinates as follows (see figure 4.3):
P' = Sp
P and p 'represent the vertices before and after transformation in homogeneous coordinates, P = [x y z 1] t, p' = [x' y 'Z' 1] T; s is the proportional transformation matrix,
(4-3-1)
.
Figure 4.3 proportional Transformation

inverse transformation matrix
(4-3-2)
.
for any Three-dimensional Geometric transformation, once you know its transformation matrix (such as S), this transformation is uniquely identified. So next we will focus on the transformation matrices of other geometric transformations.

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.