返回介绍

Plane平面

发布于 2019-12-18 15:38:18 字数 3869 浏览 1006 评论 0 收藏 0

Description 描述

Representation of a plane in 3D space.

表示三维空间里的平面。

A plane is an infinitely large, flat surface that exists in 3D space and divides the space into two halves known as half-spaces. It is easy to determine which of the two half-spaces a particular point is in and also how far the point is from the plane. Walls, floors and other flat surfaces are common in games, so a plane is sometimes useful for mathematical calculations with these objects. Also, there are cases where a real surface does not exist but it is useful to imagine that one is there. For example, in sports, a goal line or out-of-bounds line is often assumed to extend into the air, effectively defining a plane.

平面是存在于三维空间中的一个无限大而平整的表面,它将这个空间切分为被称为半空间的两部分。判定一个特定的点是在哪个半空间内以及它与该平面的距离是很容易的。墙,地面以及其他平整表面在游戏中是很常见的,所以平面有时候很适用于这些物体的数学计算。同样的,某些情况下可能并不真的存在一个具体的面,但把它想象成一个面还是很有用。举个例子,在运动项目中,(足球)球门线或出界线往往被假定延伸到空中,实际上就界定了一个面。

When a plane passes through the <0,0,0> point in world space, it is defined simply by a normal vector that determines which way it faces. It is easy to visualise this if you imagine looking at the plane edge-on.

当已知一个平面通过世界坐标中的<0,0,0>点时,面所朝的方向则取决于其法向量。如果你想象看着面的边缘的话很容易设想这样的画面。

Note that the side from which the normal vector points is important since it is used to identify which half-space a point is in (ie, on the positive or “normal” side of the plane or the other side). When the plane doesn't pass through <0,0,0> it can be defined by the normal vector along with a distance from <0,0,0>

注意,法向量所指的方向是很重要的,因为它被用于判定某个点是在哪个半空间里(ie,是在该面的正向或“法向”边还是另一边)。当该面不通过点<0,0,0>时,它可以由其法向量以及它与<0.0.0>的距离一道定义。

A plane can also be defined by the three corner points of a triangle that lies within the plane. In this case, the normal vector points toward you if the corner points go around clockwise as you look at the triangle face-on.

平面同样可以由位于该平面的三角形的三个角点定义。这种情况下,当你正对着此三角形,角点顺时针旋转时法向量指向你。

Variables 变量

distanceDistance from the origin to the plane.
从原点到平面的距离
normalNormal vector of the plane.
平面的法向量

Constructors 构造器

PlaneCreates a plane.
创建一个平面

Functions 函数

GetDistanceToPointReturns a signed distance from plane to point.
返回带符号的平面到点的距离。
GetSideIs a point on the positive side of the plane?
一个点在平面的正面吗?
RaycastIntersects a ray with the plane.
平面与一条射线相交。
SameSideAre two points on the same side of the plane?
两个点在平面的同一侧么?
Set3PointsSets a plane using three points that lie within it. The points go around clockwise as you look down on the top surface of the plane.
通过位于面内的三个点设置平面。当你朝下看平面的上表面时这些点顺时针旋转。
SetNormalAndPositionSets a plane using a point that lies within it along with a normal to orient it.
通过位于面内的一个点以及其法线设置平面。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文