Mathutils Module -- Blender Game Engine 2.49b


Class index  __

Method index  __

Mathutils index  __

Euler index  __

Matrix index  __

Quaternion index  __

Vector index  __


 




LineIntersect

LineIntersect(vec1, vec2, vec3, vec4)

Note:
Because the lines are evaluated as infinite lines in space, the values returned may not be between the 2 points given for each line.

Returns a tuple with the points on each line respectively closest to the other (when both lines intersect, both vector hold the same value).

Return Type:  ([Vector], [Vector])

vec1
A 3d vector, one point on the first line
Type:  Vector
vec2
A 3d vector, another point on the first line
Type:  Vector
vec3
A 3d vector, one point on the second line
Type:  Vector
vec4
A 3d vector, another point on the second line
Type:  Vector

Sample Code

# import Mathutils
import Mathutils

# create 1st vector for 1st point on 1st line
vec1 = Mathutils.Vector(0.0, 0.0, 0.0)

# create 2nd vector for 2nd point on 1st line
vec2 = Mathutils.Vector(5.0, 0.0, 0.0)

# create 1st vector for 1st point on 2nd line
vec3 = Mathutils.Vector(2.0, -2.0, 0.0)

# create 2nd vector for 2nd point on 2nd line
vec4 = Mathutils.Vector(2.0, 2.0, 0.0)

# get line intersect
lineIntersect = Mathutils.LineIntersect(vec1, vec2, vec3, vec4)

 
The Blender Game engine uses the Python programming language to extent the capabilities of the game engine.  The Python programming language is open source and free to use, even for commercial products.  Python is a multi-platform programing language that runs on Windows, Linux/Unix and Mac OS X operating systems.  A general-purpose programming language, Python is a high-level, dynamic, object-oriented language that beginners find easy to learn.