3D game and the mathematical method in computer graphics-point line surface

Source: Internet
Author: User

"Yi Chuan," The word upload: "Easy to have Tai Chi, is born two, two Miriam born four elephant, four elephant health gossip." ”

Borrow the wisdom of the ancient people to introduce the theme of this article-three-dimensional graphics point line surface, in three-dimensional geometry there is also a sentence can be compared with the above words: from the point into the line, from the line into the face, from the face of the adult, by the body forming.

Point vector and direction vector

First we want to make clear the difference between the point vector representing the point in three-dimensional space and the direction vector, for example, a (x, Y, z) can represent a point vector, and OA (x, Y, z) represents a direction vector. The direction vector will remain the same during panning.

Lines in 3D space

There are two points P1 and P2 in the 3-D space, then the lines through these two points can be defined as: P (t) = (1-T) P1 + tP2, where t can be any real number. The line between P1 and P2 corresponds to the value of T between 0 and 1.

A ray is a straight line that has only one endpoint and is infinitely extended in the given direction v. The parameter equation for the ray is: P (t) = P0+tv, where the value of T is greater than 0.

As you can see, both the line and the ray can be made up of a point plus a pointing.

The relationship between two straight lines

In two straight lines in the same plane, there are two kinds of relationships, intersecting or parallel. Of course, overlap is also included in the intersection.

But in the three-dimensional world, the concept of space has been added, so the relationship between the two lines has added another, that is, the other side.

The two lines are as follows:

P (s) = P0+SVP

Q (t) =q0+tvq

where S and T can be any real number.

A plane in 3D space

For a given 3D point P0 and normal vector n, then the P0 and N vertical plane can be defined as satisfying equation N. (P-P0) A collection of =0 points. As shown in the following:

The plane equation can be expressed as ax+by+cz+d=0, where a,b,c is the component of x, Y, Z of normal vector N, and D =-N. P0.

The relationship between plane and line

(1) The straight line and the plane have countless common points within the plane.

(2) lines and planes intersect that line and plane have only one common point (vertical is also a kind of intersection).

(3) lines and planes are parallel, i.e. straight lines and planes have no common points.

The relation between plane and plane

The relationship between plane and plane in 3-D space is similar to the relationship between lines and lines in 2-dimensional space:

(1) Two planar intersections (coincident is a special intersection).

(2) Two planes parallel.

3D game and the mathematical method in computer graphics-point line surface

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.