3D 空間での平面の表示
平面は、3D 空間に存在する無限に大きく平らな面であり、空間を「半空間」と呼ばれる 2 つの空間に分割します。特定の点がどちらの半空間に存在するか、また平面からどれだけ距離があるか算出することは容易です。壁、床、その他の平面はゲームでよく登場するため、これらのオブジェクトを使用した数学的計算には平面が役立つ場合があります。さらに現実には空間が存在しないけれども、あると仮定したほうが便利な場合があります。例えば、スポーツではゴールラインやサイドラインは地上から離れた空中にも存在するものと仮定し、効果的に平面を定義します。
平面がワールド座標の (0, 0, 0) 点を通過する場合、平面の向きは、その法線ベクトルで定義されます。平面を真横から見ていると考えれば、わかりやすいでしょう。
法線ベクトルがどちら側から指しているかは重要です。なぜなら、それによってどちらの半空間 (すなわち、平面の正の側にあるか負の側にあるか) に点が存在するかを判断できるからです。平面が (0, 0, 0) 点を通過しない場合、法線ベクトルに加えて (0, 0, 0) からの距離により定義できます。
平面は、平面上にある三角形の 3 つの頂点によって定義することもできます。その場合、三角形を正面から見ながら三角形の頂点を反時計周りにすると、法線ベクトルの向きは自分の方に向きます。.
distance | The distance measured from the Plane to the origin, along the Plane's normal. |
flipped | 反対方向を向く平面のコピーを返します。 |
normal | 平面の法線ベクトルを返します |
Plane | 平面を作成します |
ClosestPointOnPlane | 指定した point に対して、平面上の最も近い点を返します。 |
Flip | 平面を反対方向に向けます。 |
GetDistanceToPoint | 平面から点までの距離を返します。 |
GetSide | 平面の表がどちらを向いているかを判断します。 |
Raycast | レイを平面と交差させます |
SameSide | 2 つの点が同じ面側にあるかどうかを判断します。 |
Set3Points | 3 点の位置を設定して、平面を作成します。このときの 3 点の位置は、上部から見て時計回りで設定されます |
SetNormalAndPosition | ベクトルの法線と地点により平面を設定します |
Translate | Returns a copy of the given plane that is moved in space by the given translation. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.