Login

Fancade Wiki

Updated Line vs Plane.md (markdown)

... ...
@@ -1,7 +1,24 @@
1 1
Finds the point at which a line intersects a plane.
2 2
3
Plane point: A position in the plane.
3
[[/uploads/Line_VS_Plane.png]]
4 4
5
Plane normal: A vector that is perpendicular to that plane (the direction the plane is pointing at, the angle of the plane)
5
Inputs:
6
* Line From: Line's starting position
7
* Line To: Line's end position
8
* Plane Point: A position in the plane (defaults to 0,0,0 if unwired)
9
* Plane Normal: A vector perpendicular to the plane (i.e. the direction the plane is pointing at, or the angle of the plane)
6 10
7
[[/uploads/Line_VS_Plane.png]]
... ...
\ No newline at end of file
0
Outputs:
1
* Intersection: The point where the line intersects the plane (or [[nan]] if there is no such point)
2
3
## Notes
4
5
* It's a line, not a line segment, so the intersection will be found even if it's not in-between the line's from/to positions.
6
7
## Example
8
9
A common use case for Line vs Plane is to find the world coordinate of the user's finger:
10
11
[[/uploads/line_vs_plane_example01.png]]
12
13
The finger touches a 2D screen, but there's a whole bunch 3D points along a line *into* the scene, which are all at that 2D coordinate. So the above script first uses [[Screen To World]] to get two points on that line, and then Line vs Plane to pick out the *one* position that lies on the floor plane (point 0,0,0 and normal 0,1,0). As a result, the Wood block will move to the finger!
... ...
\ No newline at end of file
Fancade Wiki