Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What is the created plane by these 2 Vector3?

Discussion in 'Physics' started by GeorgeMincila, May 10, 2017.

  1. GeorgeMincila

    GeorgeMincila

    Joined:
    Feb 28, 2016
    Posts:
    36
    Hi,

    I am new to Unity and have yet to master all the notions. I am working on some existing code and I have this line that I do not understand exactly:

    Plane p = new Plane (Vector3.up, Vector3.zero);

    Vector3.up is the Y axis, but Vector3.zero is the point of origin. It has no direction..
    What is the plane created by this line?

    Thanks,
    George
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    The plane created by that line is an horizontal plane (as for the normal being Vector3.up) that crosses the origin of coordinates (as for the point being Vector3.zero).

    Vector3 is just a set of three coordinates, x y z. It may represent a vector or a point, depending on the usage. The constructor "new Plane(Vector3, Vector3)" takes the first parameter as a 3D vector and the second parameter as 3D point.